Retro Gerry · @gerrykelly
369 followers · 562 posts · Server mastodon.gamedev.place

Newbie type Question for types in case im missing it or doing it wrong.

Is there a quicker way to get both nibbles from a byte. Not a BCD though. So to take a byte in register a,put each nibble into hl i do some shifts to right then left and a subtraction.
Is there mabe a command im missing, some binary math invert wizardry or is this a acceptable way to do this.

Ld a, %11111010
Ld h,a
Srl h
Srl h
Srl h
Srl h
Ld e, h
Sla e
Sla e
Sla e
Sla e
Sub e
Ld l, a

#z80 #assemblyprogramming

Last updated 1 year ago