Saturday, April 29, 2017

It appears it's time to start uploading files.
The first file will be assembly source for generating the original ROM.

The biggest change from the disassembly (other than removal of the leftmost columns) is every JSR >CHRGET and JSR >CHRGOT were replaced with a forced extended address version of the JSR instruction.  The assembler Microsoft used clearly didn't take advantage of the direct addressing form of JSR.  This alone would have freed up some space in the ROM and saved some clock cycles.  Every direct version saves 1 clock cycle, and one byte. It's a small optimization, but the interpreter reads a lot of characters through that routine.

To build the original ROM, comment out (add a semicolon in front of) line 40 which says:
#define VERSION   The TASM (Telmark Assembler) is required to build the ROM..

If you leave it in, it will build a ROM displaying V1.1 which uses direct addressing for those calls, uses corrected math constants, removes Microsoft Easter eggs, and removes the programmer's name.
This saves 71 BYTEs and is close to what Microsoft should have produced to begin with.
This is also the file I'm using as a basis for testing other changes.

During testing I encountered one little problem.  I've tried testing this and many other optimizations with Ahl's Benchmark (a simple benchmark in Creative computing) and I cannot duplicate the time listed in the magazine with VMC10, even though the new ROM is faster than the original when compared side by side.  Either the number in the magazine is off, or the emulator is slow.


Source Code
ROM V 1.1

No comments:

Post a Comment