{% load staticfiles %}
An interpreter for QFTASM (Quest For Tetris Assembly).
| – Ticks per sec: ; Millisecs per tick:
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 |
---|
Direct write to RAM – value: , address:
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:
MNZ [test] [value] [dest]
– Move if not zero; sets [dest]
to [value]
if [test]
is not zero.MLZ [test] [value] [dest]
– Move if less than zero; sets [dest]
to [value]
if [test]
is less than zero.ADD [val1] [val2] [dest]
– Add; adds [val1]
to [val2]
and stores the result in [dest]
.SUB [val1] [val2] [dest]
– Subtract; subtracts [val2]
from [val1]
and stores the result in [dest]
.AND [val1] [val2] [dest]
– Bitwise AND; bitwise ANDs together [val1]
and [val2]
and stores the result in [dest]
.OR [val1] [val2] [dest]
– Bitwise OR; bitwise ORs together [val1]
and [val2]
and stores the result in [dest]
.XOR [val1] [val2] [dest]
– Bitwise XOR; bitwise XORs together [val1]
and [val2]
and stores the result in [dest]
.ANT [val1] [val2] [dest]
– Bitwise AND-NOT; bitwise ANDs together [val1]
and (NOT [val2]
) and stores the result in [dest]
.SL [val1] [val2] [dest]
– Shift left; shifts [val1]
left by [val2]
bits and stores the result in [dest]
.SRL [val1] [val2] [dest]
– Shift right (logical); shifts [val1]
right by [val2]
bits and stores the result in [dest]
. Doesn't preserve sign.SRA [val1] [val2] [dest]
– Shift right (arithmetic); shifts [val1]
right by [val2]
bits and stores the result in [dest]
, while preserving sign.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
.
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.
1,2,3
', '1, 2, 3
', '1 2 3
'.
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.