<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 30 Apr 2002 16:03:37 +0100
From   : "Richard Gellman" <r.gellman@...>
Subject: Re: 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 >>