Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user eightbitswide ! (Registered 2024-12-24) 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: 474
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: 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.
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: 902
bring your machine to x and show us ;)
2004-10-27 12:53
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..
2004-10-27 13:32
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. :)
2004-10-27 13:33
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
2004-10-27 14:10
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..
2004-10-28 10:01
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
Hi WVL. yeah :-)

I was trying to convert a char to sprite.
So I get an index for the char like 02, a B.

I add 8, 2 times and get a strange number, because
I forgot to reset and start from 0A00 EVERY time.

I hope this explains it.

Murdock spotted my bug in 3 mins..
Thanks Murdock!
2004-10-28 10:53
dalezy

Registered: Apr 2002
Posts: 476
and i spotted your faulty spacebar and a-key!
2004-10-28 17:11
WVL

Registered: Mar 2002
Posts: 902
There was nothing wrong with my keys.. guess again why the WOW demo has not been released yet ;)
2004-10-29 10:47
j0x

Registered: Mar 2004
Posts: 215
The WOW demo failed for two reasons:

1) A buggy Retro Replay 3.8alpha
2) "somebody" not pressing the spacebar properly

It was a press-space demo, not a hold-space demo :)


Funny, nobody suspected the decimal flag (or the Spanish Inquisition).

j0x/WOW
2004-10-29 13:07
WVL

Registered: Mar 2002
Posts: 902
I didn't hold it, i pressed it (hundreds of times ;). It just didn't continue. After a minute i gave up and turned the sound down to ask you guys and suddenly it decided to continue on it's own. weird.

btw, what does the RR have to do with it? :)
2004-10-31 16:37
Bud

Registered: Jan 2002
Posts: 14
the Retro Replay 3.8alpha cartridge rom was used when linking the first part of the demo.
That rom sets $9ec5 to $20 which caused the crunched part 3 data in the memory to be corrupted and saved to disk.
This affected the music in the 'interference' part.

This has been fixed now, the demo (Nomen Nescio) can now be found here in the CSDb.

Bud/WOW
2004-10-31 17:06
WVL

Registered: Mar 2002
Posts: 902
Ah! I thought he meant the fact that RR3.8 was used on the compo machine! :)
2004-10-31 18:15
Bud

Registered: Jan 2002
Posts: 14
Well if that is true then it could have been the problem, as the compo rules (on the X-2004 website) stated that the compo machine would use an Action Replay 6... ;-)
But since the $20 value was in the saved file, it was the RR3.8alpha on our system.

After loading a file with the RR3.8alpha, $9ec5 will be set to $20, i have tested that.
2004-10-31 18:27
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
Quote: and i spotted your faulty spacebar and a-key!

That's strange dalezy, because it's actually the right shift key that is faulty. space is not :-)
2004-10-31 20:20
Puterman
Account closed

Registered: Jan 2002
Posts: 188
The bug was fixed quite some time ago, but unfortunately there hasn't been another rr release since then...
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
Exile/Anubis
Six/G★P
Guests online: 82
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 X-Mas Demo 2024  (9.5)
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 Censor Design  (9.3)
5 Triad  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Mutetus  (9.7)
3 Jeroen Tel  (9.7)
4 Linus  (9.6)
5 Stinsen  (9.6)

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