--
On Tue, 17 Apr 2001 12:43:35
Jim Ursetto wrote:
>At 12:02pm on 2001 April 17, Rigel did write:
>> >> 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"...).
>But ASL when A=01 does not carry
oops, doh. back to the cave
Who needs Cupid? Matchmaker.com is the place to meet somebody.
FREE Two-week Trial Membership at http://www.matchmaker.com/home?rs=200015
|