Superbes cours en ligne: http://atariste.free.fr/asm/assembleur.html
16 registres: d0-d7, a0-a7, tous de 4 octets (longwords).
a7: stack pointer
Taille des opérations: b (byte), w (word), l (long).
Address space de 24bits ($FFFFFF)
SR: Status register (16 bits), MSB: system byte, LSB: user byte.
Immediate addressing: move.b #1,d0
Register addressing: move.l d0,d1
Absolute addressing: mode d0,$100000 (en mémoire)
Pointer addressing:
movea.l #$FF0000,a0
move.w #1, (a0)
Pointer relative addressing: (offest de -$8000 à $7FFF)
movae.l #$FF0000,a0
move.w #1, (a0) ;store the number 1 at memory location $FF0000
move.w #1, 2(a0) ;store the number 1 at memory location $FF0002
PC Relative Addressing:
move.w #1, $100(pc) ;stores the value 1 at the memory location $100 bytes
from the current instruction.
Pointer Addressing with Predecrement/Postincrement:
movea.l #$FF0000, a0
move.b #7, (a0)+ ;store 7 at $FF0000 and add 1 to a0, a0 now equals $FF0001
move.b #4, (a0)+ :store 4 at $FF0001 and add 1 to a0
move.w #3, (a0)+ ;store 3 at $FF0002 and add 2 to a0
move.l #9, (a0)+ ;store 9 at $FF0004, a0 is now equal to $FF0008
move.w #6, -(a0) ;store 7 at $FF0006
BEQ: Si Zero
BNE: Si pas Zero
Byte writes to any even address store the same data to the MSB and LSB:
Byte writes to any odd address are ignored.
Byte reads from any even address return the MSB of the 16-bit data from
that register:
move.b $3C0002, d0 : Data read is $AB where word in VRAM is $ABCD
Byte reads from any odd address return the last value on the 68K data
bus:
move.b $3C0003, d0 : Data read is $71
nop : Opcode is $4E71
For example, if we want to push D0.W (with this I mean D0, the lower
16 bits) we just MOVE.W D0,-(A7).
And to pop it back, just MOVE.W (A7)+,D0. Remember that when popping a
word, the upper 16 bits in D0 is still there.
movem d0-d4/a0-a2,-(a7) and then movem (a7)+,d0-d4/a0-a2
|