You may refer to the 6800 instruction set while taking this test, both otherwise it is closed-book.

Problems 1 and 2. Complete the conversions.

1. Three points.

7C16 = 01111100______2

= 124______10 (interpreting binary as unsigned)

= 124______10 (interpreting binary as two's complement)

2. Three points.

D016 = 11010000______2

= 208______10 (interpreting binary as unsigned)

= -48______10 (interpreting binary as two's complement)

Problems 3-8. Replace each JMP command with a BRA command that has the same effect.

3. 07 – 02 = 05

Address Old contents New contents

0000 7E 20______

0001 00 05______

0002 07 01

4. 0E – 02 = 0C, two's complement = F4

Address Old contents New contents

000C 7E 20______

000D 00 F4______

000E 02 01

5. F1F0 – F1DB = 15

Address Old contents New contents

F1D9 7E 20______

F1DA F1 15______

F1DB F0 01

6. 7EA1 – 7E95 = 0C, two's complement = F4

Address Old contents New contents

7E9F 7E 20______

7EA0 7E F4______

7EA1 95 01

7. A000 – 9F88 = 78, two's complement = 88

Address Old contents New contents

9FFE 7E 20______

9FFF 9F 88______

A000 88 01

8. A03D – A000 = 3D

Address Old contents New contents

9FFE 7E 20______

9FFF A0 3D______

A000 3D 01


Problems 9-13 are based on the following program (all numbers are hexadecimal):

LDAA A0

CMPA A1

BNE 07

CLR 00A0

CLR 00A1

WAI

CMPA# 77

BNE 04

LDAA# 55

BRA 02

LDAA# 77

STAA A0

STAA A1

WAI

9. Fourteen points. If you wanted to load the program into memory, starting at address 0000, what would you load?

Address Contents Address Contents

0000 96______000E 77______

0001 A0______000F 26______

0002 91______0010 04______

0003 A1______0011 86______

0004 26______0012 55______

0005 07______0013 20______

0006 7F______0014 02______

0007 00______0015 86______

0008 A0______0016 77______

0009 7F______0017 97______

000A 00______0018 A0______

000B A1______0019 97______

000C 3E______001A A1______

000D 81______001B 3E______

If the original contents of addresses 00A0 and 00A1 are the same, they are both cleared and the program ends. Otherwise, if the original contents of 00A0 are 77, then 55 is stored in both 00A0 and 00A1. If the original contents of 00A0 are not 77, then 77 is stored in both 00A0 and 00A1.

10. If addresses 00A0 and 00A1 each contain 7716 before the program runs, what do addresses 00A0 and 00A1 contain after the program runs?

00

11. If addresses 00A0 and 00A1 each contain 5516 before the program runs, what do addresses 00A0 and 00A1 contain after the program runs?

00

12. If address 00A0 contains 7716 and address 00A1 contains 5516 before the program runs, what do addresses 00A0 and 00A1 contain after the program runs?

55

13. If address 00A0 contains 5516 and address 00A1 contains 7716 before the program runs, what do addresses 00A0 and 00A1 contain after the program runs?

77