Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user psenough ! (Registered 2024-05-21) 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: 5028
agreed :)
2010-11-12 15:13
JackAsser

Registered: Jun 2002
Posts: 1993
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: 5028
"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: 1993
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: 5028
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: 5028
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
MWR/Visdom
Bitbreaker/Performers
Deev/Onslaught
csabanw
Alakran_64
Oswald/Resource
jmin
Guests online: 101
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Bromance  (9.5)
10 Wonderland XII  (9.5)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 It's More Fun to Com..  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Booze Design  (9.3)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 Performers  (9.3)
Top Diskmag Editors
1 Jazzcat  (9.4)
2 Magic  (9.4)
3 hedning  (9.2)
4 Elwix  (9.1)
5 A Life in Hell  (9.1)

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