| |
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 |
|
| |
Hoogo
Registered: Jun 2002 Posts: 105 |
_number is not initialized. You add 16 to an unknown value. |
| |
SIDWAVE Account closed
Registered: Apr 2002 Posts: 2238 |
ah, this example has no init, but the real code does. :-) |
| |
hollowman
Registered: Dec 2001 Posts: 474 |
you have a c64 which can load or assemble code and run
it, but it cant add correctly? interesting.. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
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. |
| |
SIDWAVE Account closed
Registered: Apr 2002 Posts: 2238 |
i dont know whats wrong, its so weird.
|
| |
WVL
Registered: Mar 2002 Posts: 902 |
bring your machine to x and show us ;) |
| |
WVL
Registered: Mar 2002 Posts: 902 |
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.. |
| |
Perff Administrator
Posts: 1680 |
@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. :)
|
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
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 |
| |
WVL
Registered: Mar 2002 Posts: 902 |
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 |