Array: Difference between revisions

m
Line 70:
 
Iteration over the elements of an array is fairly straightforward.
<lang 68000devpac>LEA;68000 myArray,A0Assembly example
LEA myArray,A0
loop:
MOVE.B (A0)+,D0
JMP loop</lang>
 
<lang z80>;z80 Assembly example
<lang z80>ld hl,myArray ;load the address of myArray into hl
ld de,userRam ;load the address of work RAM into de
ld bc,myArrayEnd-myArray ;assembler directive that auto-calculates the array size using labels placed at the beginning and end.
1,489

edits