110 likes | 271 Views
Tutorial 3. assembly language program. assemble. machine code program. using the MC68000 Reference Card to assemble an instruction. STEP 1 Obtain bit pattern for instruction from Opcode Bit Pattern column of Alphabetic List.
E N D
assembly language program assemble machine code program
using the MC68000 Reference Card to assemble an instruction STEP 1 Obtain bit pattern for instruction from Opcode Bit Pattern column of Alphabetic List STEP 2 Obtain codes from Opcode Bit PatternCodes table at bottom of alphabetic list STEP 3 Look up addressing mode category in Effective Addressing Mode Categories table at bottom of back page
absolute short data register direct org $400 MOVE.B $1000,D2 MOVE.B #$30,D3 AND.B D2,D3 MOVE.B D3,$100A immediate
MOVE.B $1000,D2 00XX RRRM MMee eeee XX size: byte 01 RRR destination register 010 MMM destination EA mode: data register direct 000 eeeeee source EA: absolute short 111000 next word 0001 0000 0000 0000 0001 0100 0011 1000 0001 0000 0000 0000 $14381000
MOVE.B #$30,D3 00XX RRRM MMee eeee XX size: byte 01 RRR destination register 011 MMM destination EA mode: data register direct 000 eeeeee source EA: immediate 111100 next word 0000 0000 0011 0000 0001 0110 0011 1100 0000 0000 0011 0000 $163C0030
AND.B D2,D3 1100 DDD0 SSee eeee DDD destination data register number 011 SS size: byte 00 eeeeee source EA: data register direct 000010 1100 0110 0000 0010 $C602
MOVE.B D3,$100A 00XX RRRM MMee eeee XX size: byte 01 RRR destination register 000 MMM destination EA mode: absolute short 111 eeeeee source EA: data register direct 000011 next word 0001 0000 0000 1010 0001 0001 1100 0011 0001 0000 0000 1010 $11C3100A
MC68000 memory data registers $400 program $401 D0 D1 D2 D3 $402 $403 $404 $405 D4 D5 D6 D7 $1000 data $1001 $1002 $1003 $1004
org $400 MOVE.B $1000,D2 MOVE.B #$30,D3 AND.B D2,D3 MOVE.B D3,$100A • 400 14 38 10 00 • 404 16 3C 00 30 • 408 C6 02 • 40A 11 C3 10 0A
org $400 program MOVE.B #5,D0 TRAP #15 MOVE.B #9,D0 TRAP #15 end program