[sebhc] Dave Dunfield's H8 emulator

Dave Dunfield dave04a at dunfield.com
Thu May 13 07:13:20 CDT 2004

At 06:44 13/05/2004 -0500, you wrote:
>> I have found the cause of this:
>> When 040.000 is the monitors RAM area. It just happens that 
>> at 040.003 there is $C9(311) which is a RET instruction.
>> I see three options:
>>  1 - do nothing - the emulator will crash under these 
>> conditions, however
>>      it will operate at it's highest speed
>>  2 - split all 16 bit accesses into 2 8-bit accesses, this 
>> will slow it down,
>>      but it will crash the virtual 8080 only - just like the real H8.
>>  3 - Perform a test and halt the simulation (eventually into 
>> the debugger) if
>>      a stack wrap occurs.
>I would suggest a combination of (1) and (3) - under normal conditions,
>do nothing and let the emulator run at full speed. Implement (3) as an
>option (like the Ignore parameter) for debugging.

Unfortuntely such a "combination" is not practical - to perform a test
to see if stack wrap checking is enabled would take as many instructions
as to check the stack pointer - so you would be no further ahead - I'll
probably just perform the (3) test all the time - (But later - got lots
else to do for now) - in the meantime, don't go executing RET without a
valid stack.

Once I have the debugger installed (hopefully in the next few days), I
can add the stack check and have it trap to the debugger when it finds
a pending fault.

>A semi-related issue is how fast the emulator should run relative to
>wall-time. Are you planning to allow an option for running H8 as if it
>were a true 1MHz system regardless of the system clock of the host? I
>think this will become more important if you interface to real-world
>devices like disk drives and tape drives.

The 8080 engine already has a throttle implemented, however because I have
not installed the calibration, it does not get set. I will make this an
option, which allows you to run "real time" or "full bore".

[It's really cool on my Altair simulator - I have a chess game which has
5 levels of play - on the top level, it takes about 1/2 hour to make a
move on the actual machine (or the emulator in real-time), but in "full
bore" mode on my P3/733 it takes only a few seconds].

dave04a (at)    Dave Dunfield
dunfield (dot)  Firmware development services & tools: www.dunfield.com
com             Vintage computing equipment collector.

Delivered by the SEBHC Mailing List

More information about the Sebhc mailing list