Prev: 62865 Up: Map Next: 62926
62916: Swap Bytes
Used by the routine at SwapPlayers.
Swaps two blocks of memory.
Input
B Number of bytes
DE Address of the first block
HL Address of the second block
SwapBytes 62916 LD C,(HL) Read HL into C.
62917 LD A,(DE) Read DE.
62918 LD (HL),A Write A where HL points.
62919 LD A,C A=C.
62920 LD (DE),A Write A where DE points.
62921 INC HL Advance HL.
62922 INC DE Advance DE.
62923 DJNZ SwapBytes Decrease B and jump to SwapBytes until none remain.
62925 RET Return.
View the equivalent code in;
Prev: 62865 Up: Map Next: 62926