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 > ADC bug, CPU fried ?
2004-10-20 23:07
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
ADC bug, CPU fried ?

Hi,

I have this code:

_index .byt 2

LDX #0
CLC
.re LDA _number
ADC #8
STA _number
INX
CPX _index
BNE .re

This should give 24 or not ?

Nomatter where I place the CLC,
it always gives +2

2 times 8 gives me 18

Is my 6510 fried ?



Jan
2004-10-21 05:35
Hoogo

Registered: Jun 2002
Posts: 105
_number is not initialized. You add 16 to an unknown value.
2004-10-21 10:14
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
ah, this example has no init, but the real code does. :-)
2004-10-21 10:53
hollowman

Registered: Dec 2001
Posts: 475
you have a c64 which can load or assemble code and run
it, but it cant add correctly? interesting..
2004-10-21 12:26
JackAsser

Registered: Jun 2002
Posts: 2038
The example above should add 16, not 24. But 18 seems weird.... Are you telling us the whole truth here? Is it really initialized, do you have IRQ that destroy A and X etc... And since CPX _index sets C=0 when X<_index it's ok to have the CLC before .re.

And Hollowman has a REALLY good point.
2004-10-21 20:36
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
i dont know whats wrong, its so weird.
2004-10-21 20:50
WVL

Registered: Mar 2002
Posts: 924
bring your machine to x and show us ;)
2004-10-27 12:53
WVL

Registered: Mar 2002
Posts: 924
too bad i didn't get to see your machine and see it for myself.

anyway, i can't believe this bug is actually happening..
2004-10-27 13:32
Perff
Administrator

Posts: 1686
@Rambones

Perhaps if you somehow post the machinecode generated by the assembler, we could find an answer? Perhaps the assembler does something strange?

There shouldn't be that many hex-numbers to post for that small code. :)
2004-10-27 13:33
JackAsser

Registered: Jun 2002
Posts: 2038
Ofcourse it wasn't any HW bug as we all said... :D Rambones and some other dude found out the _SW_ at X and he came to me dead drunk explaining the bug. It was something that wrote garbage in the memory somehow. Anyway.... I could barly hear him since he was absolutly dead drunk. You really have too look for more drunk persons... :D
2004-10-27 14:10
WVL

Registered: Mar 2002
Posts: 924
Good ;) that's another 'mystery' solved ;)

it was ofcourse impossible the cpu had problems adding. The whole c64 would never have been able to boot to the basic editor..
 
... 10 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - 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
Scooby/G★P/Light
Mike
Doc Strange/Atlantis
Stratford/Xenon
DonChaos
Guests online: 138
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Wonderland XIV  (9.5)
9 Uncensored  (9.5)
10 Comaland 100%  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.7)
2 Black Beard  (9.2)
3 Baracuda  (9.2)
4 hedning  (9.1)
5 Irata  (8.8)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.045 sec.