RosettaCodeData/Task/Generic-swap/Z80-Assembly/generic-swap-3.z80
2023-07-01 13:44:08 -04:00

5 lines
316 B
Z80 Assembly

;16-bit swap:
ld hl,(&C000) ;load the byte at &C000 into L and the byte at &C001 into H.
ld de,(&D000) ;load the byte at &D000 into E and the byte at &D001 into D.
ld (&D000),hl ;store the contents of L into &D000 and H into &D001.
ld (&C000),de ;store the contents of E into &C000 and D into &C001.