-
Notifications
You must be signed in to change notification settings - Fork 14
/
DemoProgram.asm
16 lines (16 loc) · 1.79 KB
/
DemoProgram.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
LDA 10 // Load into register A, the value stored in memory location 10 [Memory address 0 (Zero-indexed)]
ADD 11 // Add into A, the value stored in memory location 11 [Memory address 1 (Zero-indexed)]
JMP 5 // Jump to the instruction at memory location 5 [Memory address 2 (Zero-indexed)]
SUBT 12 // Subtract from A, the value stored in memory location 12 [Memory address 3 (Zero-indexed)]
ADD 13 // Add into A, the value stored in memory location 13 [Memory address 4 (Zero-indexed)]
OUT // Output the value in A [Memory address 5 (Zero-indexed)]
LDA 14 // Load into register A, the value stored in memory location 14 [Memory address 6 (Zero-indexed)]
ADD 15 // Add into A, the value stored in memory location 15 [Memory address 7 (Zero-indexed)]
OUT // Output the value in A [Memory address 8 (Zero-indexed)]
HLT // Halt the program, stop all operations [Memory address 9 (Zero-indexed)]
3 // [Memory address 10 (Zero-indexed)]
2 // [Memory address 11 (Zero-indexed)]
1 // [Memory address 12 (Zero-indexed)]
5 // [Memory address 13 (Zero-indexed)]
10 // [Memory address 14 (Zero-indexed)]
11 // [Memory address 15 (Zero-indexed)]