| |
Mace
Registered: May 2002 Posts: 1799 |
How is carry affected by compare?
Somewhere I read that the carry is affected by the result of a compare.
It's not in the Prog.Ref.Guide, other than a flag in the register table.
How does this work?
|
|
... 27 posts hidden. Click here to view all posts.... |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
agreed :) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: agreed :)
Also, I'm quite sure both SBC and CMP uses the ALU-block of the CPU to perform the subtraction. It would be quite wasteful otherwise. :D |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
"check exactly how much chip-area that is common for SBC and CMP"
yes, probably a lot, thats why its an sbc without carry IMHO,and not a sec+sbc :) |
| |
GT Account closed
Registered: Sep 2008 Posts: 308 |
IMHO Oswald and Jackasser are confusing newbe's with "big-coca-cola-glasses", trying to explain what goes on inside the silicon.
CMP #$40 for instance, gives you the same result(READ RESULT) except touching the A, as:
SEC
SBC #$40
Don't listen to them newbe's.
;-) |
| |
GT Account closed
Registered: Sep 2008 Posts: 308 |
I do admire Oswald and Jackasser coding skills. Don't take me wrong. :)
I'm curious, though, about the inner workings. I guess Mace got his answer how the CMP affects the carry by now?! :) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: I do admire Oswald and Jackasser coding skills. Don't take me wrong. :)
I'm curious, though, about the inner workings. I guess Mace got his answer how the CMP affects the carry by now?! :)
Mnaw! :D But yeah, we're just attention whores really! :D Happy WE! |
| |
Mace
Registered: May 2002 Posts: 1799 |
Yes, the answer is clear. Thanks for that!
And although the related subjects are interesting too, I think most if not all is said by now ;-) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
what jackie said, and as I think about it, implementing it with the "implied" SEC way may be just as simple as doing an SBC which just ignores the carry. Someone ask Chuck Peddle :) |
| |
GT Account closed
Registered: Sep 2008 Posts: 308 |
Quote: what jackie said, and as I think about it, implementing it with the "implied" SEC way may be just as simple as doing an SBC which just ignores the carry. Someone ask Chuck Peddle :)
A simple SBC doesn't ignore the carry. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
I speculate about how cmp does its thing, wether it has a built in sec, or it just ignores the carry. |
Previous - 1 | 2 | 3 | 4 - Next |