-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstruction Formatting Guide.txt
46 lines (45 loc) · 1.76 KB
/
Instruction Formatting Guide.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
0000000000000000000000000000000
basic:
/---------------------------------\
| extra b |
| | | |
| vvvvvvvvvvvvvvvvvvv vvv |
| 0100000000000000000000000001010 |
| ^^^ ^^^ ^^^ |
| | | | |
| opcode a c |
\---------------------------------/
load:
/---------------------------------\ /---------------------------------\
| a | | |
| | | | |
| vvv | | |
| 0100010000000000000000000000000 | | 0000000000000000000000000000000 |
| ^^^ | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| | | | | |
| opcode | | value |
\---------------------------------/ \---------------------------------/
print:
/---------------------------------\
| a |
| | |
| vvv |
| 0110111000000000000000000000000 |
| ^^^ ^ |
| | L number flag |
| opcode |
\---------------------------------/
blank 32 bit == 0000000000000000000000000000000
add r1, r2 into r3 == 0010000000000000000000000001010
load 2 into r1 == 0100000000000000000000000000000 0000000000000000000000000000010
load 2 into r2 == 0100010000000000000000000000010 0000000000000000000000000000010
print r3 as number == 0110111000000000000000000000000
OpCodes:
000 Data Word = 0 (implied)
001 Add = 1
010 Load = 2
011 Print = 3
100 Subtract = 4
101
110
111