<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Wed, 01 May 2002 10:05:16 +0100 (BST)
From   : Sprow <rsprowso@...>
Subject: Re: Completely stuck on tube emulation

On Tue, 30 Apr 2002, Richard Gellman wrote:

> 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.

Acornsoft *may* have assumed that it's running with OS1.20 and that
some useful routine in the OS is at C881.Certainly DFS1.20 reads and
writes variables in page 2 by just peaking and poking rather than by
OSByte.
That would be odd.

Can we not change back to trying BASIC,then at least I have something to
refer to.

> 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).

Sounds like pushing the 2 byte address of the routine to handle the given
keyword before an RTS.

[snip]

> 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).

COMAL,COBAL,so easy for me to get confused.
Sprow.
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>