Motorola M68000 Assembler

MOVE and CLR

8. If the value stored in the data register of Motorola M68000 D0 = \$ABCD1234, what is the data found in register D0 at the end of each line.

a) MOVE #5, D0                  D0=\$00000005
b) MOVE #10, D0                D0=\$0000000A
c) MOVE #-1, D0                 D0=\$0000FFFF
d) MOVE #\$1234, D0        D0=\$00001234
e) MOVE #%1011, D0         D0=\$0000000B
f) MOVE #@123, D0          D0=\$00000053
g) MOVE #’B’, D0                D0=\$00000042
h) MOVE.L #’HELP’, D0      D0=\$48454C50

9. The first two registers of Motorola M68000 have the data content D0=\$1234ABCD and D1=\$56781234.  After each line what is the value stored in register D0?

a) MOVE D1, D0         D0=\$12341234
b) MOVE  D0,D1         D1=\$1234ABCD
c) MOVE.B  D1,D0      D0=\$1234AB34
d) MOVE.L D1, D0      D0=\$56781234
e) CLR.W D1                D0=\$12340000
f) CLR.B D0                 D0=\$1234AB00
g) MOVE.B D1,D1      D0=\$1234ABCD
h) MOVE.L  D0,D1    D0=\$1234ABCD

Motorola M68000 Syntax Error

6. There is an error on each line of M68000 assembly language. Please say what the error is and then give the good syntax.

a) ADD. B #1,A0

b) CMP. L DO,#9

c) MOVE.B #500,D5

d) MOVE Temp,#4

e) MOVE . B 4 (PC), D8

a) ADD.B #1, A0 Invalid size code (it means you are not allowed to do bite size operations with Address register)

Correct is ADD.L #1, A0 or ADD.B #1,D0

b) CMP.L D0,#9 Invalid addressing mode (it means you are not allowed to compare directly D0 with memory location 9)

Correct is CMP.L #9, D0

c) MOVE.B #500, D5 Imediate data exceeds 8 bits (#500 is greater than 8 bits)

Correct is MOVE.W #500, D5

d) MOVE TEMP, #4

Invalid addressing mode (you are not allowed to load #4 memory location with TEMP variable content)

Correct is

MOVE.L A0, #4

Move TEMP, (A0)

(TEMP DC.W 10)

e)

MOVE.B 4(PC), D8 Undefined symbol (it means D8 is not defined as a simbol. Data registers are only D0 to D7)

Correct MOVE.B 4(PC), D7

Continue reading on M68000 assembly language