Re: A85: SBC HL, DE


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

Re: A85: SBC HL, DE




On Tue, 1 Sep 1998 CashOnly@aol.com wrote:
> > What commands can I use to do this?
> 
> You can use this if you want to find if the outcome is negative...which will
> be the case if de was greater then hl:
> 
>       sbc     hl,de
>     
> 	bit 	7,h  				
> 	jp 		nz,LESSTHENZERO 	; HL<0
if de was greater after sbc hl,de then carry will be set.
so you don't need bit 7,h.
so instead like this:

or a			;he didn't want to subtract carry also
sbc hl,de
jr c,LessThanZero

remember cp is really subtracting and only changing flags.  So when you
subtract you can use the resulting flags to compare.

-Humberto Yeverino Jr.

"I kick ass for the Lord."

***********************************************************
Home Page:                                               
  http://www.engr.csufresno.edu/~humberto/Home.html      

Ti Page:                                                 
  http://www.engr.csufresno.edu/~humberto/tex.html       

z80 Source Page:                                         
  http://www.engr.csufresno.edu/~humberto/z80source.html 

Official Tyrant Home Page:                              
  http://www.engr.csufresno.edu/~humberto/tyrant.html    

E-mail:                                                  
  humberto@engr.csufresno.edu                            
***********************************************************



References: