PREPARING A PROGRAM FOR PROM The defining word VARIABLE works fine if your application is run in RAM, but when the program is moved to ROM the variable space allotted by VARIABLE becomes "frozen" in read only memory. The value of the variables can never be altered and the program will fail. An alternative to using VARIABLE is show below. HEX VARIABLE RAM_POINTER ( DEFINE A PIECE OF RAM TO HOLD ) ( A POINTER TO NEXT FREE BYTE OF RAM ) HWORD ( MOVE IT TO HEADS IF SEPERATE FROM CODE) : IS CONSTANT ; ( RENAME CONSTANT FOR EASY READING ) HWORD ( MOVE IT TO HEADS IF SEPERATE FROM CODE) 200 RAM_POINTER ! ( IN A BUFFER STARTING AT 200 ) : RAM ( n --- addr ) RAM_POINTER @ ( GET THE FREE RAM POINTER ) SWAP ( BRING THE # OF BYTES TO ALLOT UP ) RAM_POINTER +! ( ADD THAT # TO POINTER IE: ALLOT RAM ) ; ( RETURN ADDRESS OF ALLOTTED RAM ) Examples of how to use RAM: 2 RAM IS VARIABLE1 2 RAM IS VARIABLE2 4 RAM IS DVARIABLE 0 RAM IS SHOW-TABLE 2 RAM IS PARAMETER1 2 RAM IS PARAMETER2 2 RAM IS PARAMETER3 2 RAM IS PARAMETER4 0 RAM IS SHOW-END VARIABLE1 @ VARIABLE2 @ + PARAMETER1 ! DVARIABLE @ DVARIABLE 2+ @ VARIABLE1 @ U/ PARAMETER3 ! PARAMETER 4 ! : INITI SHOW-TABLE SHOW-END OVER - ERASE ; ( CLEARS PARAMETER1-4)