Skip to content

Example program

NikWillOrStuff edited this page Nov 12, 2019 · 1 revision

This program adds 2+2, then puts the result on the output screen, then freezes the computer.

copy direct operand, direct a
0x 2
copy direct operand, direct b
0x 2
mode add
copy direct ALU, direct output
halt

Here's the binary interpretation, next to the hexadecimal interpretation, next to that original text interpretation:

1000000000000100        8004        copy direct operand, direct a
0000000000000010        0002        0x 2
1000000000100100        8024        copy direct operand, direct b
0000000000000010        0002        0x 2
0100000000000000        4000        mode add
1000000001100110        8066        copy direct ALU, direct output
0000000000000000        0000        halt
...                                 
0000000000000000        0000        

Clone this wiki locally