15 lines
568 B
Plaintext
15 lines
568 B
Plaintext
program Add
|
|
// Input: Stored in memory location 00 and 01
|
|
// Output: Sum of two integers 5 + 8 = D saved in memory location 02.
|
|
// Remarks:
|
|
// -----------------------------------------------------------------------------
|
|
00: 0008 (0000 0000 0000 1000, 8)
|
|
01: 0005 (0000 0000 0000 0101, 5)
|
|
02: 0000 (0000 0000 0000 0000, 0)
|
|
|
|
10: 8A00 R[A] <- mem[00]
|
|
11: 8B01 R[B] <- mem[01]
|
|
12: 1CAB R[C] <- R[A] + R[B]
|
|
13: 9C02 mem[02] <- R[C]
|
|
14: 0000 halt
|