RE: VIC20 KERNAL Bug

From: Gideon Zweijtzer (gideonz_at_dds.nl)
Date: 2003-02-03 22:36:51

Dear all,
 
I have seen this fenomenon also in the C-64 ROM, when I was debugging my
6510 CPU with the logic analyzer. I had some triggers on erroneous
conditions, and one of them was "writing to a ROM area", which happened
exactly in the same code fragment as you mention below! A very bad
programming practice, IMHO!
 
 Gideon
 
-----Original Message-----
From: owner-cbm-hackers@cling.gu.se
[mailto:owner-cbm-hackers@cling.gu.se] On Behalf Of Baltissen, R (Ruud)
Sent: Monday, February 03, 2003 08:04
To: 'cbm-hackers@cling.gu.se'
Subject: RE: VIC20 KERNAL Bug
 
Hallo Nicolas, 
 
> Now I think I found the reason, the following code in the 
> VIC20 (PAL) KERNAL ROM: 
> .C:fd62   B1 C3      LDA ($C3),Y 
> .C:fd64   91 C3      STA ($C3),Y 
> .C:fd66   99 14 03   STA $0314,Y 
> 
> This copies some vectors from ROM to RAM, but why does it 
> contain an STA command back to ROM? 
Because this code is also used to move data from the $0314 RAM-area to
another RAM area defined by the user in $C3. This routine starts at
$FD57. The VIC-20 uses this routine only once and enters this routine
with CLC some bytes above. This performs the C3 -> 0314 copy. A SEC does
it ythe other way around.
But the trick/problem is that a JUMP-vector at $FF8B points to $FD57.
God only knows which external software uses this vector. And does this
software enter the routine with a set or reset Carry?
 
> I think I'm going to patch this out with two NOPs, 
Defenitly NO. 
 
-- 
    ___ 
   / __|__ 
  / /  |_/     Groetjes, Ruud 
  \ \__|_\ 
   \___|       http://Ruud.C64.org 
  



=====DISCLAIMER=========================================================
========

De informatie in dit e-mailbericht is vertrouwelijk en uitsluitend
bestemd voor de geadresseerde. Wanneer u dit bericht per abuis ontvangt,
verzoeken wij u contact op te nemen met de afzender per kerende e-mail.
Verder verzoeken wij u in dat geval dit e-mailbericht te vernietigen en
de inhoud ervan aan niemand openbaar te maken. Wij aanvaarden geen
aansprakelijkheid voor onjuiste, onvolledige dan wel ontijdige
overbrenging van de inhoud van een verzonden e-mailbericht, noch voor
daarbij overgebrachte virussen.

The information contained in this e-mail is confidential and may be
privileged. It may be read, copied and used only by the intended
recipient. If you have received it in error, please contact the sender
immediately by return e-mail; please delete in this case the e-mail and
do not disclose its contents to any person. We don't accept liability
for any errors, omissions, delays of receipt or viruses in the contents
of this message which arise as a result of e-mail transmission.



       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail 2.1.6.