Monday, December 10, 2018

Finding Prime Numbers

Another speed comparison, finding prime numbers up to 10,000.

Thursday, December 6, 2018

CoCo 3 vs MC-10 with new ROM

Up to this point I've shown comparisons of the new vs old MC-10 ROM.  This video demonstrates  the difference in speed between the CoCo 3 running at double speed vs the MC-10 with the new ROM.  This is the difference the hardware multiply makes, along with a better implementation of the interpreter.  The CoCo 3 will show a greater difference on non-math oriented programs, but this provides a rather interesting comparison.  If I were to replace the MC-10's Motorola 6803 with a Hitachi 6303, and if it provided even a 10% speed increase, the MC-10 would win in this comparison.   The 6309 provides at least a 20% speedup over the 6809 so that is a very real possibility.

Wednesday, December 5, 2018

Some last minute notes on the new MC-10 ROM

Just some notes on last minute changes to the new MC-10 ROM.

The 16 bit string compare may be a few clock cycles slower when comparing strings of 1-3 bytes in length(?), but anything longer will be faster.  The slower performance on short strings will be more than made up for by the faster interpreter, but the difference on longer strings is significant enough to make this change well worthwhile.  The new interpreter will always be faster, but should be noticeably so when comparing a lot of long strings like with my test sort code (which I'll release shortly).

The manner in how the the main loop calls the functions associated with tokens has been changed. 
The size of the "Command Dispatch Table" has been enlarged to account for all potential tokens.  This allowed the removal of the range check before calling the address in the Command Dispatch Table, saving a few clock cycles.  Tokens that would result in a syntax error, now jump directly to the error, and undefined tokens jump to the RAM hook "RVEC10" which is set to jump to syntax error by default.  This lets the main loop skip the jump to the RAM hook for every ROM based token routine, saving multiple instructions for every token executed, but you can still intercept unused tokens to extend the ROM.
While existing programs that override tokens will not work on the new ROM (I can only think of one), it is still possible to extend BASIC, and alternative versions of existing commands could replace the current ones.  I'm working on a way to embed new tokens and parameters directly into the code.

Please note that tokens $F0-$FF cannot be used at this time.  The token number is multiplied by 2 to calculate the offset in the dispatch table.  This is done with a bit shift, but the result is only one byte and the carry is lost.  It's a trade off for speed.  It still leaves room for 38 new tokens, and I'd like to reserve $EF for future expansion.  (Two byte tokens could be a possibility in the future)

Monday, November 26, 2018

MC-10 ROM fixes before a release

The bug in the code that converts ASCII to floating point by changing divide by 10 to multiplying by 1/10 is now fixed.  This offered a significant speedup, so I'm happy that code will make it into the release.  That leaves one bug to fix before an official release.  That bug is likely to be in the math library, and I'm pretty sure I know what it is.  Once I get time it shouldn't take too long to fix.  The first release will definitely be a 16K ROM, but an 8K ROM with most of the code may follow if it will fit.  I am not going to fight with it to get that working though.

You can see the bug in my youtube video with the sort comparison.  The gap values are different between the original and new ROM.  That is no longer the case.  FWIW, the the constant for 1/10 was wrong and it was the first thing I checked, so... easy fix.

Thursday, November 22, 2018

Breaking the chains... of the 8K barrier

Only one day after deciding to finally ditch the MC-10 8K ROM limitation, a couple small changes have pushed the new ROM to almost 10% faster than the original, and the actual executable code is smaller.  I simply dumped the valid token check in the main loop and extended the command dispatch table.  Anything invalid jumps strait to SN ERROR, and valid tokens are executed quicker.  The table wastes some space, but there will be less wasted space as I add Extended BASIC commands to the ROM.

This does not include the code that uses multiplication to convert ASCII numbers to binary instead of division, and the code that stores the current line pointer instead of the current line number.

Solitaire Solver, original ROM vs new ROM 

Again... with feeling!

For your viewing pleasure

Wednesday, November 21, 2018

Latest MC-10 ROM snapshot

The video is still uploading, but here is a snapshot of the difference in speed between the original MC-10 ROM and new one on the "Fedora" 3D Plot.  The SIN(), COS(), TAN(), and string compare are faster.
I'd make a video of a large sort to show off the string compare, but it's not as dramatic and would take several minutes to watch.