Schoenwetter’s Signals

See all articles from SINCUS v2 n3

Tips from Dave Schoenwetter

Here are some tips for machine code programming on the TIMEX-Sinclair machines which I have found to be very useful especially when working with the 2K system. All tips will work in 16K systems too.

(1) I have accidentallly deleted my 1 REM statement when editting the BASIC part of my program on many occasions. To eliminate the possibility of deleting your 1 REM statement which contains your machine code program, ENTER 1 REM followed by enough characters to hold your MC program. POKE 16570,0 which will change 1 REM to 0 REM! The program will now LIST and RUN but the 0 REM cannot accidentally be deleted!

(2) With large 1 REM machine code programs on 2K systems the computer often gets in a loop when attempting to edit BASIC. This causes a continuous loop LISTING (or trying to) the 1 REM statement. To prevent this I I added a couple of Hex 76’s near the beginning of 1 REM text This prevents a LIST beyond the “Hex 76”. One disadvantage is that you must ENTER LIST 2 to see your BASIC program. However it’s better than losing your program to the “LIST loop”.

(3) For anyone interested in ENTERing machine code, I wrote a machine code program that loads itself above RAMTOP 2K or 16K and uses 128 bytes of storage. By using four lines of BASIC the the program then waits for the user to ENTER a four digit Hex address. The MC program then PRINTs to the screen 128 bytes of Hex data. The decimal address of the entered Hex address is also printed. The program is then in the INPUT mode for Hex data. Any number of bytes may be ENTERed on one line. The character “G” will skip over a byte and move the cursor by one byte. Any incomplete byte or non-valid Hex character (except G) will terminate the program with an error. I will bring a copy of the program to the next meeting.

Dave Schoenwetter
SINCUS,March 1984