QFTASM Interpreter

An interpreter for QFTASM (Quest For Tetris Assembly).

| – Ticks per sec: ; Millisecs per tick:
Permalink |

Program counter: 0; step number: 0

ASM Opcode Address 1 Address 2 Address 3
Type Location Type Location Type Location
Address (decimal) Address (binary) Data (decimal) Data (binary) Reads Writes

Breakpoints Instruction:
RAM read:
RAM write:
Direct write to RAM – value: , address:
RAM addresses to display:

RAM Display:


QFTASM is a very simple version of Assembly developed for the Quest For Tetris project. To use this interpreter, put your code in the text box and click Set code to enable the flow control buttons. Run will execute the instructions as quickly as possible, Step will execute one instruction at a time, and Slow will execute instructions at a user-defined rate.

Each instruction should be formatted like this: [number]: [INST] [arg1] [arg2] [arg3]. Optional comments are also allowed, and are denoted by a semicolon. Here is a list of instructions along with their arguments:

There are two formats for arguments: literal integers and references. Integers may either positive or negative, with the negative ones converted to two's complement (for example, -37 becomes 65573), and they are limited to the range 0–65535 (16 bits). For references, the number of dereferences is notated by one of A, B, C. For instance, A37 will be replaced with the data in address 37 at execution time. B37 will be replaced with the data in the address given by the data in address 37, and likewise, with one more level, for C37.

The first table shows the instructions and their machine code equivalents. In the ASM column is the code exactly as it appears in the input, sans comment. In the Opcode column is the code for that command. Type refers to the reference level, so 37 would have a type of 00 and A37 would have a type of 01. Finally, Location is just the value or address. Also, the highlights show the next two instructions to be executed.

The second table shows the RAM bank, and I think the columns are pretty self-explanatory. More RAM slots are added as needed (when an instruction reads from or writes to an address outside of the current range).

The three text boxes directly below can be used to set breakpoints. Simply enter addresses separated by commas and/or spaces. Any of the following will work: '1,2,3', '1, 2, 3', '1 2 3'.

Regarding the direct write to RAM line, that address will be set to that value when that address is read. Once that address is set, then the value box is blanked. Further reads of the same address will not do anything if the value box is blank. The accompanying checkbox is self-explanatory, with the caveat that if a value is entered and then the user resumes the interpreter, that address will be set to that value the next time it is read.

For specifying which addresses to display, the format should be something like 0 2-4 6. Ranges of numbers are denoted by a-b (inclusive), with no spaces on either side of the dash. Separate numbers and ranges by commas and/or spaces.