<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sun, 17 Jul 1994 16:34:51 +0100 (BST)
From   : clr1@...
Subject: My progress so far...

I've got back to work on my 6502 emulator now... I've managed to speed it 
up a bit. Here's where assembler beats C any day. ;-)

I've found (for those of you who are interested) that the PC zero and 
carry flags operate in a pretty similar way to the BBC ones and I can in 
fact use them as a substitute. Obviously I have to store them in a 
register when they're not in use (to stop other bits of my assembler 
corrupting them) but there is a command to do this (lahf) which takes 
only 2 clock cycles (3 to restore them back). This means that to do a BNE 
on the beeb, I virtually just have to do a JNE on the PC! It does make 
things a bit more complicated (and it uses up a register) but I can now 
execute the three-nested loop we've been going on about in 50.04 seconds 
on my 386/40; if anyone would like to test this against the C version, 
just for interest, I'll post the EXE. The source is just over 600 lines 
now...

Going by the performance of my master compact, this means I'm running at 
88% of the speed of a beeb. However, my emulator does not implement 
interrupts (although they aren't disabled on the PC during the tests) or 
have any form of support for anything other than the 6502.

Using the instruction block format I taked about b4, I reckon I could 
have a straight 6502 emulator running as fast as, if not faster than, the 
beeb. However, I did a count this morning and I've only got *ahem* 18 
instructions implemented.  ;-)

Here goes a long slog...

+-------------------+-------------------------------------------------+
| /-- |_| /-- | (~  | "And the driving is like the driving of Jehu,   |
| \-- | | |   | _)  | the son of Nimshi, for he drives furiously."    |
+-------------------+-------------------- Second Book of Kings 9 v20 -+
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>