<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 30 Apr 2002 16:59:09 +0100
From   : Seddon Tom <TSeddon@...>
Subject: Re: Completely stuck on tube emulation

Are your pushes and pops in the right order when you do a JSR/RTS/RTI? C82C
and 80C8 sound quite reasonalbe. (Er.. I tried to do the RTS+1 adjustment
there. But I might have got it wrong. Anyway, LSB/MSB the wrong way round is
what I'm getting at.)

I would have assumed this was fine, though, because I vaguely remember this
is how the OS picks up the address of text to output. So, if it were wrong,
all the OS text would be messed. Oh and it seems unlikely that such a bug
would have gone unnoticed for this long... on the other hand, I don't
suppose many programs construct return addresses themselves...

Well, you did ask for "anything" :-)

-- 
--Tom
tseddon@...                      icq 47064827
sheffield england united kingdom planet earth

> -----Original Message-----
> From: Richard Gellman [mailto:r.gellman@...           ]
> Sent: 30 April 2002 16:04
> To: bbc-list
> Subject: RE: [BBC-Micro] Completely stuck on tube emulation
> 
> 
> Numerous people have suggested problems in the area of the 
> BRK instruction.
> Point of note: The 2nd processor BRK code is the same the 
> base processor BRK
> code, which as far as I know, works fine.
> 
> But I investigated anyway, and found that (in COMAL) typing 
> something that
> is supposed to generate a language error (i.e. not a * 
> command that returns
> an error), the tube processor encounters a BRK at &2CC9.
> 
> Typing anything that should work, e.g. PRINT "hello" causes a 
> BRK to be
> encountered at &C881.
> 
> So the processor is jumping to stupid locations before it 
> even gets to the
> BRK, thus I don't think there's a fault there.
> 
> 2CC9 is in the middle of "language space" i.e. where your 
> BASIC (or COMAL)
> program is stored, this area is blank, as PAGE starts at &800.
> C881 is between the language ROM code (&8000-&BFFFF) and the 
> TUBE OS ROM
> (&F800-&FFFF). This area is also blank.
> 
> I've taken a dump of the language rom space after this weird 
> action, and it
> is byte-for-byte identical to the paged ROM image that is 
> loaded on startup,
> so it is not corrupted.
> 
> I did a log of the instructions leading up to the "fault" and 
> it seems the
> COMAL ROM jumps into the middle of a loop, in the middle of 
> an instruction.
> This loop is executed twice, the first time with half that 
> instruction, and
> the second time with the full instruction. It also causes 
> very odd things to
> occur with the stack, as is uses two PHA's before RTS. (It is 
> these two
> PHA's that cause the 2CC9 return address, and thus the 
> unintentional BRK).
> 
> As I stated before, the same ROM image works fine without the 
> TUBE, and on a
> genuine Master 128 with 6502 Second processor attached.
> 
> So I'm completely lost :(
> 
> -- Richard Gellman
> 
> P.S. Somebody mentioned that the output looked more like 
> BASIC commands.
> COMAL is a variant of BASIC made by AcornSoft. It is very 
> similar to BASIC,
> and indeed most BASIC programs work on COMAL without 
> conversion. However
> COMAL tends to run slighlty faster and support more 
> "interesting" commands,
> as well as some commands that were not in BASIC until version 
> V (CASE..OF,
> WHILE, etc).
> 
> <Serious bit>
> This email is sent to you as personal communication or to a 
> specific mailing
> list ONLY, and does not contain any form of comercial 
> advertsing (spam). By
> replying to this email you legally agree that you will honour 
> this in a
> similar fashion, and you will not send any commercial email 
> to this email
> address, or subscribe this email address to any mailing list 
> without prior
> permission. Failure to adhere to this may result in criminal 
> prosecution
> under the misuse of information laws applicable in all countries.
> <end of serious bit>
> 
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>