This progam automatically sets your machine up for machine code routines in high memory by moving RAMTOP. I don’t like to figure a new RAMTOP by hand, then POKE the right number into the right location. This program does it for you, displaying the new RAMTOP and the two numbers to POKE. To POKE RAMTOP yourself, write down the numbers in the box and POKE them, following the example on pp.124-5 (Chap. 25, Using Machine Code) of the Timex manual. Or the computer will POKE them for you. Enter and run AUTO RAMTOP before entering your other programs.
Another handy use: suppose your program uses 4K RAM. To speed it up, enter the number of bytes not used (subtract the number used from 32768 if you have 16K) or enter 1024 times the number of K not used. For example, your program is 4K bytes long; you have 16K RAM. Enter 1024*12. Then LOAD and RUN your program–it runs faster.
SAVE the program before it RUNs to avoid the line 995 wipeout.
Variables
RT RAMTOP BYTES How many bytes in routine (number to subtract from RAMTOP) NA New Address to locate RAMTOP RE Remainder after dividing NA by 256*A (See lines 60&230) A Whole number to multiply by 256 and add to RE to get NA
Graphics and Inverse Video
line 800 graphics E 17 graphics 7 graphics R line 810 graphics 5 graphics 8 line 820 graphic W 17 graphic 6 graphic Q line 960 "DONE"
5 SLOW
10 LET RT=PEEK 16388+256*PEEK 16389
20 PRINT TAB 10;"RAMTOP=";RT
30 PRINT
35 PRINT "HOW MANY BYTES IS YOUR ROUTINE?"
40 INPUT BYTES
45 PRINT
50 PRINT TAB 10;"BYTES LONG=";BYTES
55 LET NA=RT-BYTES
60 LET A=NA/256
63 PRINT
65 PRINT "MAKE RAMTOP=";NA
70 LET A$=STR$ A
100 FOR X=1 TO LEN A$
110 IF A$(X)="." THEN GOTO 200
120 NEXT X
200 LET A$=A$( TO X-1)
210 LET A=VAL A$
230 LET RE=NA-256*A
800 PRINT AT 8,3;"▛▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▜"
810 PRINT AT 9,3;"▌";AT 9,21;"▐"
820 PRINT AT 10,3;"▙▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟"
830 PRINT AT 9,4;NA;"=";RE;"+256*";A
840 PRINT
850 PRINT
860 PRINT "DO YOU WANT MEMORY SET TO ",NA;"?"
870 LET Q$=INKEY$
880 IF Q$="Y" THEN GOTO 950
890 IF Q$="N" THEN GOTO 999
900 GOTO 870
950 PRINT
960 PRINT TAB 11;"DONE"
970 PAUSE 80
980 POKE 16388,RE
990 POKE 16389,A
995 NEW
SYNTACTIC SUM: 44014, 8K ROM
Media
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.