Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > How is carry affected by compare?
2010-11-10 19:40
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....
 
2010-11-12 15:12
Oswald

Registered: Apr 2002
Posts: 5094
agreed :)
2010-11-12 15:13
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
2010-11-12 15:37
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 :)
2010-11-12 15:57
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.

;-)
2010-11-12 16:16
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?! :)
2010-11-12 18:29
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!
2010-11-12 18:40
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 ;-)
2010-11-12 20:56
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 :)
2010-11-13 09:57
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.
2010-11-13 10:31
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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
grip
cba
void256
tlr
Epyx/TSA
Microshark/Damage(HUN)
Guests online: 124
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Sulevi  (9.6)
3 The Sarge  (9.6)
4 Veto  (9.6)
5 Facet  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.048 sec.