Prev: F591 Up: Map Next: F5CE
F5C4: 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 F5C4 LD C,(HL) Read HL into C.
F5C5 LD A,(DE) Read DE.
F5C6 LD (HL),A Write A where HL points.
F5C7 LD A,C A=C.
F5C8 LD (DE),A Write A where DE points.
F5C9 INC HL Advance HL.
F5CA INC DE Advance DE.
F5CB DJNZ SwapBytes Decrease B and jump to SwapBytes until none remain.
F5CD RET Return.
View the equivalent code in;
Prev: F591 Up: Map Next: F5CE