Date : Mon, 15 Aug 1994 13:33:29 EST
From : Stephen Quan <quan@...>
Subject: Re: i see basic! :-)
>> 386DX-33 it is operating at about 30 times slower than a real beeb.
> 30 times slower?!? That's pretty awful (no offence)! I would have thought
> that even a C version would be a bit faster than that. Although I have
> yet to get BASIC going, I would have thought that it would go no slower
> than about 1/2 Beeb speed. However, I might retract that when I get it going!
I tried a 256^2 loop (LDX #0 LDY #0 DEY BNE DEX BNE), and it took about
30 seconds to run. Oh geeze, that means I am 1/256 times slower, not 1/30.
Hmmrph, mumble, grumble. ( :-) )
I have pretty awful memory read/write routines as it was not possible to
create one flat 64K block of memory using simple Borland C. I opted to
have 32K for RAM, 16K for the OS and 16*16K for the ROMs. I had to
navigate through ifs statements to determine which array I should be
accessing, and (in the case of ROM), whether I should write to there.
In my assembly version I can create a 64K flat block of memory with
no hassles. As a matter of fact, I decided to model it using the EMS
page frame (as I proposed to do so earlier!). I have
DS = EMS page frame
SI = 6502 PC
And load opcodes and operands using LODSB and LODSW. My memory map is :
EMS logical page 0 = user memory 0000-3FFF (EMS page 16).
EMS logical page 1 = user memory 4000-7FFF (EMS page 17).
EMS logical page 2 = sideways RAM/ROM (EMS page 0-15).
EMS logical page 3 = OS (EMS page 18).
But, because of this and of other things I have done in my code, I
cannot run my emulator on anything less than a 386.
ALSO, in the name of performance, I have opted to restrict ROM special
behaviour only for LDA/LDX/LDY and STA/STX/STY instructions, meaning
that other instructions will see the 64K as a flat piece of memory.
This speeds up performance by not having to always check for the ROM
special behaviour for nearly every memory related command. There is
also a risk of somebody (using the emulator) changing the ROMs during
run time using the ROL command. If this looks bad, I may have to
extend ROM special behaviour to include other commands as well.
I hardly see it necessary to implement ROM special behaviour for
straight 6502 fetch and execute cycle.
--
Stephen Quan (quan@... ), SysAdmin, Analyst/Programmer.
Centre for Spatial Information Studies, University of Tasmania, Hobart.
GPO BOX 252C, Australia, 7001. Local Tel: (002) 202898 Fax: (002) 240282
International Callers use +6102 instead of (002).