<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sat, 20 Jan 1996 20:39:45 GMT0BST
From   : "Tom Seddon" <T.W.Seddon@...>
Subject: HELP (please!)

Please... can anyone help me?

I've finally got round to writing a new version of my emulator. I'm
doing it using GCC rather than assembler this time, but it's not
proving any easier...

The current situation is that I have BASIC loaded in at &8000 and the 
OS ROM loaded in at &C000. I don't trap IO reads (so they read the 
copyright messages) but I trap writes above &8000 and ignore them. I 
have hacks for OSWRCH and OSRDCH, calling printf() and getch() 
respectively. Although the system boots into BASIC alright, there are 
a number of small peculiarities:

1. Typing in programs doesn't work. Typing in one line of a program 
(eg 10PRINT "HELLO") works OK but when you type LIST it reports 'Bad 
program'. Typing in two lines (eg 10PRINT "HELLO" <return> 20END) 
makes the computer hang up after the second has been typed in.

2. Strange FOR...NEXT behaviour. FOR X=0 TO 50 reports 'Syntax 
error'. FOR X=10 TO 20 reports 'No TO'.

3. BASIC doesn't count brackets as well as it used to :-)
   PRINT SIN(RAD(90)) produces 'Missing )', and PRINT DEG(90) does 
the same. Strangely PRINT RAD(1) DOES work, I think.

I've been through my 6502 routines with a toothcomb and I can't see
anything wrong with them. I've got the computer running a register
dump and disassembly at the top of the screen, with OSWRCH output
going to the bottom, and I've single-stepped through what seems like
half the BASIC ROM (and a large proportion of the OS)... but I can't
see anything wrong.

If anyone had this particular problem with their emulator I'd be
interested (desparate?!) to know how to fix it. It sounds like the
problems are in the instructions used in the routine that converts
ASCII numbers into bytes, although this is just a guess. I'm going
to have another step through the BASIC ROM tonight (now I don't
normally spend Saturday nights like that but I've been quite ill and
have to stay in this week!) but I doubt I'll find anything new. If 
noone had this problem themselves then it doesn't matter, because I'm 
sure I'll fix this problem one day.

--Tom
     .                 ** Tom Seddon **                 .
    / \          E-mail: T.W.Seddon@...          / \
   /(o)\                                              /(o)\
  /=====\        Call out GANDHU and be happy        /=====\
 /       \                                          /       \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>