Re: LZ: routine help
[Prev][Next][Index][Thread]
Steve Peterson wrote:
>
> Can anybody tell me if this will work?
>
> 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?
Try this (I don't know if your routine works, but anyway, this one
should)
ld a,$27 ;load any 8-bit hex number into a
and $0F
;a now holds $07
(this is fine if you are working with hex numbers...)
>
> Thanks
>
> _
> (_
> |_)teve
> |eterson
>
> mailto:stevep@comso.com
> http://www.geocities.com/SiliconValley/Park/2636
<pre>
--
; Max Mansour, // mail : mmansour@gis.net
; self proclaimed // irc : Justarius
; dictator. // web : maxwww.home.ml.org
;
; Drugs for Doughnuts !
; Crack, smack, weed, speed, you want it,
; I got it. I can be found in the nearest
; deep-fried pastry establishment.
; I'm the one with the badge and the gun.
.end
</pre>
References: