Re: LZ: routine help


[Prev][Next][Index][Thread]

Re: LZ: routine help



> I want to store a 2 or 3 digit number in "a".  Then I want to extract
> the digit in the one's place and compare it to a number.  Here's what I
> hope will work:
> 
> ld a,39
> 
> ld hl,a
> ROM_CALL(UNPACK_HL)
> cp $9
> jr z, loop
> ret
> 
> If this won't work, can somebody give me a routine that will?


Here's a routine that will store the digit in the one's place to A to 
A:


ld  a,39
daa
and %00001111


-Ed


References: