[A83] Re: dec (hl) and carry flag


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

[A83] Re: dec (hl) and carry flag



In a message dated 6/8/2001 10:25:41 PM Eastern Daylight Time, 
dArkSk8eR@buffbody.com writes:


> does dec (hl) not set the carry flag when it goes from 0 (zero) to 255? 
> When I use it that way i get errors, but the z80 opcode tables i have say
> it does set the carry.  

Neither dec nor inc will ever modify the carry flag.  The only thing they 
modify is z/nz.  That's why in rare circumstances you will encounter "add 
a,1" or "sub 1" and it will actually be appropriate, since that's the only 
way to test for carry (and those other goofy flags).


----
Jonah Cohen
<ComAsYuAre@aol.com>
http://jonah.ticalc.org