[ input = 1 byte ; value to be mirrored
result = 1 byte ; mirrored byte ]
org &hc000
xor a : ld (result),a
ld c,1 : ld d,128 : ld b,8
start ld a,(input)
and c
jr z,after
ld a,(result) : add a,d : ld (result),a
after sla c : srl d :djnz start
ret
Hallo ,
I coded this routine as it come up to my mind, but
I need a simplier and faster routine to mirror a byte.
when I say Mirror i mean for example
input = &b11000000 result = &b00000011
input = &b00000001 result = &B10000000
thanks
Login or register to post comments