Sunday 17 January 2016

MINOL Commands

I seem to have written a lot since the last post in terms of the project moving forward. It is now executing code, albeit not in an interactive environment, and the GOTO RUN NEW CLEAR END OS CALL LET and IF commands are coded, leaving PR, IN and LIST.

Then I have to write the code so you can actually edit programs using the keyboard. At present the “program” is put in using Assembler Macros which works fine for testing but isn’t any good for the final thing.

I have also written a separate integer printing routine, so actually none of the math routines are now used that I wrote ages ago (well a few days ago anyway).

Part of the reason is this is a bit of a swine in SC/MP. You have four pointer registers. One is the program counter, one is used for subroutines (P3) and one for the stack (P2) – this is just convention.
This leaves you with one pointer register, P1. In this code it is normally pointing at the program code.

My original integer to ASCII routine (a 16 bit one) used this as a pointer to memory to store the result in. In the end I decided it was simpler just to write a simple byte only one that used subtraction not division – it only does decimal, and 0-255, but that doesn’t actually matter, and it is simpler to use – it just prints the number in ‘E’.

No comments:

Post a Comment