Assembly language for a tape-based computer system, but every instruction is an emoji.
- General-purpose registers X and Y (both 8 bits wide)
- Accumulator Register A (8 bits wide)
- 3x Tape Drives, T0 T1 and T2 (descibed below), each with the following:
- 1 input buffer register (TnI)
- 1 ouput buffer register (TnO)
- 1 write flag (TnW)
- Obviously each tape drive has a position on the tape as well, which changes as the tape gets moved. (TnP)
"n" here refers to the tape id, so for instance the input buffer register of tape 2 (T2) is known as T2I.
Tape drive details
Each tape drive supports the following operations:
- Forward - move the tape forward one space (and other things, described below)
- Backward - move the tape backward one space
- Rewind - reset the tape's position to 0, and clear both buffers and the write flag.
- Set-write - write a byte to the output buffer and set the write flag.
The forward operation is special because it also does the following:
- Reads the data in the space it has just passed over into the input buffer register
- If the write flag is set:
- Write the data in the output buffer register to the byte just passed over
- Clear the write flag
None of those things happen when going backwards, and this is the only way to read and write to or from any tape.
Each tape drive is 256 bytes long. Trying to move forwards or backwards past the end of the tape has no effect.
|n||Moves tape n forward 1 space||[see above]|
|n||Moves tape n backward 1 space||
|n||Rewinds tape n||
|n||Reads from tape n||
|n||Set-writes to tape n||
Args for all the above must immediately follow their instruction, and are as follows:
|Tape ID||Emoji Arg|
Arithmetic and Logic
|r||Add two numbers||
|r||Bitwise AND two numbers||
|r||Bitwise OR two numbers||
|r||Increment a register||
|r||Decrement a register||
|r||Perform integer division||
|Outputs a character||
|Input a character||
Note: on some systems, the
|r||Transfers A to r||
|r||Transfers r to A||
|Transfers X to Y||
|Transfers Y to X||
|Swaps X and Y||
Args for the above must immediately follow their instruction, and are as follows:
A is the low 8 bits of a 16 bit register called RJMP. Writing to A zeroes the high 8 bits of RJMP, and reading from A reads the low 8 bits of RJMP.
The following comparison flags are available:
- Equal (
EQ): the two values compared are equal.
More may follow in future.
|r||Compare r and A||
|r||Compare r and 0||
Program memory offsets are the number of characters (unicode codepoints) from the start of the file. This takes into account emojis that are actually multiple codepoints, so beware.
|Jump to memory address in RJMP||
|Jump if EQ||
|Jump if not EQ||
|msb lsb||Load literal value into A||
|himsb lomsb hilsb lolsb||Load literal value into RJMP||
|Halt the program||
Both or all 4 args should follow the
Emojis for value: