Wednesday 16 January 2013

Day 16 : CPU Test Code runs okay

Snow day today. So the UK grinds to a complete halt :)

I've been tinkering with the completed CP1610 version of the interpreter, and it has passed the test code I wrote for the reference implementation - it tests every instruction as far as is possible.

Initial tests show a speed of about 1,000 instructions per second, which is not blazingly fast but fast enough to write some code for this system.

Annoyingly the CP1610 assembler keeps arbitrarily plonking zeros on the end of the binary file, padding it out to the nearest page, so I might have to find a work round for that.

So, next thing is to write the CP1610 for the system functions - nearest thing I have to an "operating system".

Once that is complete the CP1610 coding is more or less over except for bug fixing - the next part is to start writing game code for the URM to run on the CP1610 virtual machine.

Later on

I've written and tested the first three system functions - they scan the player 1 and player 2 keypads and generate a pseudo random number. The last three allow program data to be accessed as code (Harvard machine) and have a fixed delay.

It also produced another problem, sort of. The constant $7F. I'm using 7 bit constants sign extended in this system. so constants can only be directly coded in the range $00-$3F to $C0-$FF. All other constants can be implemented as the sum of two constants - it's a bit long winded but I don't think it is too important. The exception to this is $7F which has to be calculated I think as $3F+$3F+$01. How important this constant will be I do not know :)

Later on again

Actually not a problem. I forgot about exclusive-or $7F = $40 ^ $3F :)

No comments:

Post a Comment