RE: [Tuxnes-devel] yet more asm stuff--carry f
Brought to you by:
tmmm
From: Rigel <ri...@an...> - 2001-04-17 17:02:58
|
>> let's say the operation is sh left, so in C: >> modified=orig<<1; >> carryf = modified ^ orig; // ^ is xor operator (?) >Um... try, for example, orig=1. This gives carryf = 3. >xoring won't work except by chance. ;) >For ASL, try something like >carryf = (orig & 0x80) ? 1 : 0; >or equivalently >carryf = (orig & 0x80) >> 7; >Grab a copy of an (unencumbered) C 6502 core (e.g. Nofrendo) because >it will tell you exactly how every instruction works in a high-level >language. I thought anything non-zero was true (even in asm)? I was working under that assumption, (assuming makes an ass out of "u" and "me"...). Who needs Cupid? Matchmaker.com is the place to meet somebody. FREE Two-week Trial Membership at http://www.matchmaker.com/home?rs=200015 |