Addressing ModesThe architecture explained above yield to the following addressing modes.
Mode Example Descript
--------------------------------------------------------------
Register ldr A, B r1:= r2
Immeditate ldi A, value r := value
Direct ldd A, address r := [page + address]
sto A, address [page + address] := r
Page-Zero Direct ldz A, address r := [address]
stz A, address [address] := r
Indirect ldx A, B r1:= [r2]
stx A, B [r2]:= r1
Indirect w/ auto-inc ldy A, B r1:= [r2], r2++
sty A, B [r2]:= r1, r2++
Index ldix A, d r := [IX + d]
stix A, d [IX + d] := r
Stack push A SP--, [SP]:=r
pop A r:=[SP], SP++
---------------------------------------------------------------
In Direct Addressing instructions, "address" is an 7-bits offset within the current memory page as explained in previous section.
Page Zero addressing allows direct access to memory locations in "page zero" (000H-07FF) independently from the page number currently held in S. This is an important feature because access to HER/12 memory is as fast as accessing registers, so Page Zero effectively provides 128 extra "registers" to the programmer.
Both Direct and Page Zero addressing are limited to registers A, B, C, PC.
Indirect Addressing is implemented by simply opening the desired pointer register to A-BUS.
Indirect with auto-increment is same as Indirect, only that the pointer register is post-incremented. This is convenient to software when looping through a memory buffer.
Indexed Addressing allows to point memory structure with IX, then get access to different fields within the structure by the mean of a 5-bits displacement (d).
|