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

4 lines
119 B
Z80 Assembly

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