RosettaCodeData/Task/Twos-complement/Z80-Assembly/twos-complement-2.z80

4 lines
119 B
Z80 Assembly
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
ld a,%00001111
cpl ;game boy doesn't have NEG but it has CPL which flips all the bits.
inc a ;returns %11110001 in a