addressinstructionmeaning 0001 01011load value at 11 into accumulator 1010 01101copy value of...

Post on 18-Jan-2018

223 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Address Instruction Meaning

0 001 01011 Load value at 11 into accumulator

1 010 01101 Copy value of accumulator to 13

2 001 01111 Load value at 15 into accumulator

3 101 0000 Print ASCII character from accumulator

4 011 01100 Add value at 12 to accumulator

5 010 01111 Copy value of accumulator into 15

6 001 01101 Load value at 13 into accumulator

7 100 01110 Sub value in 14 from accumulator

8 010 01101 Copy value of accumulator to 13

9 110 0010 Jump to 2 if accumulator is not 0

10 111 0000 Halt

11 0001 1100 (20)

12 0000 0010 (2)

13 0000 0000 (0)

14 0000 0000 (4)

15 0100 0001 (65)

Before

Accumulator: ?

Address Instruction Meaning

0 001 01011 Load value at 11 into accumulator

1 010 01101 Copy value of accumulator to 13

2 001 01111 Load value at 15 into accumulator

3 101 0000 Print ASCII character from accumulator

4 011 01100 Add value at 12 to accumulator

5 010 01111 Copy value of accumulator into 15

6 001 01101 Load value at 13 into accumulator

7 100 01110 Sub value in 14 from accumulator

8 010 01101 Copy value of accumulator to 13

9 110 0010 Jump to 2 if accumulator is not 0

10 111 0000 Halt

11

12

13

14

15

After

Accumulator:

top related