Re: A85: EASY question...


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

Re: A85: EASY question...




On Thu, 11 Jun 1998 DorkReMi@aol.com wrote:
> 
> When one calls CALL CP_HL_DE the "c" flag is set when:
> a)HL is greater than de
> b}DE is greater than HL

the zero flag is also set

> 
> Which one is it?  I desperately need this info
> 
Easy.
The cp instruction really just saves the a register and does a sub
intruction.
if you wrote cp c then it would be like this
a-c
c=a is smaller because a carry was required
nc= a>=c
z= a==c
nz a!=c

Now it works the same way for CP_HL_DE
HL is saved then sub hl,de
c=  HL<DE
nc= HL>=DE
z=  HL=DE
nz= HL!=DE


I was once writing a program and I used the Zshell school's chart to
interpret the flags, after hours of headache I realized that some of the
chart in the Zshell School is wrong.
I don't know if it still is, I may have had an older version.

-Humberto Yeverino Jr.

"I kick ass for the Lord."

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

<font size=3>For browsers:<br>
<a href="http://www.engr.csufresno.edu/~humberto/Home.html">
Have a look.</a></font><br>


References: