Date : Fri, 13 Sep 2002 12:18:48 +0100
From : jgh@... (Jonathan Graham Harston)
Subject: Re: 65C102 thousand dollar question
Accidently replyed direct to the author 'cos there's no proper replyto
header, grumble mutter mutter....
"Richard Gellman" <ricky@...> wrote:
> I'm having a problem with second processor emulation.
> Something keeps trying to execute opcode &FC on a regular basis.
> Unfortunately, this is not a valid opcode :)
> &FC is NOP Abs,X on the 6502 (undocumented), but behaves differently on the
> 65C102.
> I've tried a few tests, and with simple data in A, X, and Y, the instruction
> doesn't seem to do anything.
> Anyone got any ideas?
Where in memory is it executing the &FC opcode? It's most likely that some
other opcode isn't executing correctly and is sending the program counter
off course. Have you got any form of debug output of the addresses being
executed as it goes along?
Something I found useful when writing !Z80Tube was some debug code that
was executed between each opcode that did the following:
Read POS,VPOS
VDU 30
Output register/memory dump - for 6502 it'd be something like:
A=&xx P=&xx Ps-xN-uC X=&xx Y=&xx
YX=&xxxx: xx xx xx xx xx xx xx xx cccccccc
PC=&xxxx: xx xx xx xx xx xx xx xx cccccccc
S=&01xx: xx xx xx xx xx xx xx xx cccccccc
VDU 31,oldPOS,oldVPOS
It slows it down a right bugger, but gives a useful continous progress
display. *Spooling it allowed me to track back and forth through the code.
--
J.G.Harston (JGH BBC PD Library) 70 Camm Street, Walkley, SHEFFIELD S6 3TR
jgh@... - Running on BBCs & Masters with SJ MDFS FileServer
Z80+6502/CoPro+Tubes/Econet+SJ - - - - - - - http://www.mdfs.net/User/JGH/
Never, ever, EVER, *EVER*, *E*V*E*R* use an apostrophe to make a plural
--
J.G.Harston (JGH BBC PD Library) 70 Camm Street, Walkley, SHEFFIELD S6 3TR
jgh@... - Running on BBCs & Masters with SJ MDFS FileServer
Z80+6502/CoPro+Tubes/Econet+SJ - - - - - - - http://www.mdfs.net/User/JGH/
Never, ever, EVER, *EVER*, *E*V*E*R* use an apostrophe to make a plural
"Richard Gellman" <ricky@... > wrote:
> I'm having a problem with second processor emulation.
>
> Something keeps trying to execute opcode &FC on a regular basis.
>
> Unfortunately, this is not a valid opcode :)
>
> &FC is NOP Abs,X on the 6502 (undocumented), but behaves differently on the
> 65C102.
>
> I've tried a few tests, and with simple data in A, X, and Y, the instruction
> doesn't seem to do anything.
>
> Anyone got any ideas?
>
> -- Richard
--
J.G.Harston (JGH BBC PD Library) 70 Camm Street, Walkley, SHEFFIELD S6 3TR
jgh@... - Running on BBCs & Masters with SJ MDFS FileServer
Z80+6502/CoPro+Tubes/Econet+SJ - - - - - - - http://www.mdfs.net/User/JGH/
Never, ever, EVER, *EVER*, *E*V*E*R* use an apostrophe to make a plural
"Richard Gellman" <ricky@... > wrote:
> I'm having a problem with second processor emulation.
> Something keeps trying to execute opcode &FC on a regular basis.
> Unfortunately, this is not a valid opcode :)
> &FC is NOP Abs,X on the 6502 (undocumented), but behaves differently on the
> 65C102.
> I've tried a few tests, and with simple data in A, X, and Y, the instruction
> doesn't seem to do anything.
> Anyone got any ideas?
Where in memory is it executing the &FC opcode? It's most likely that some
other opcode isn't executing correctly and is sending the program counter
off course. Have you got any form of debug output of the addresses being
executed as it goes along?
Something I found useful when writing !Z80Tube was some debug code that
was executed between each opcode that did the following:
Read POS,VPOS
VDU 30
Output register/memory dump - for 6502 it'd be something like:
A=&xx P=&xx Ps-xN-uC X=&xx Y=&xx
YX=&xxxx: xx xx xx xx xx xx xx xx cccccccc
PC=&xxxx: xx xx xx xx xx xx xx xx cccccccc
S=&01xx: xx xx xx xx xx xx xx xx cccccccc
VDU 31,oldPOS,oldVPOS
It slows it down a right bugger, but gives a useful continous progress
display. *Spooling it allowed me to track back and forth through the code.
--
J.G.Harston (JGH BBC PD Library) 70 Camm Street, Walkley, SHEFFIELD S6 3TR
jgh@... - Running on BBCs & Masters with SJ MDFS FileServer
Z80+6502/CoPro+Tubes/Econet+SJ - - - - - - - http://www.mdfs.net/User/JGH/
Never, ever, EVER, *EVER*, *E*V*E*R* use an apostrophe to make a plural