Changing The Stack
The stack can be changed in three ways. It can be enlarged, reduced or rearanged. All this can be done with the following words DUP n - nn Duplicate top of stack. DROP n Throw away the top of SWAP nn'-n'n Reverse the two top elements. OVER n'n-n'nn' Copy of the second Fig 3-1 shows how these words affect the stack. Now let us do some examples and exercises. Example 1 The stack contains the numbers 3 2 1 with the 1 on top of the stack. What words must be entered to obtain the sequence 3 2 2 1...
Hex Ddump 1
The word ATARI changes all unwanted characters for example the byte 9B which erases the screen to dots. This word is used within the word ASCII, which prints the ASCII characters. LNE prints one line of hex bytes while NR does the numbering on top of the printout. Next we look at some mathematical examples.
Serial Output Via Game Port Three
The game port three is used to transmit data from the ATARI to a printer with a serial input. One half of an RS232 interface is simulated by software. The connections to be made are shown in Fig 84. Fig 8-4 Transmit data from the ATARI to a printer or RS232 input. This application also shows how to use machine code without using an assembler in FORTH. The program is listed in Fig 8-5. The word CREATE lt name gt creates an entry into the vocabulary with the name lt name gt . It writes the...
Pad Type Ret This Is Forth
We can make a printout of only a part of the text. We are able to change the starting address and the number of characters. We use a new word, TEXT, to read text into PAD. In some versions TEXT is a predefined word. The definition is PAD 72 32 FILL WORD HERE COUNT PAD SWAP CMOVE First, we must describe several new words used in this definition. The word FILL fills memory cells withe the byte b. The next new word is WORD. There are two different definitions of WORD in FIG FORTH and in FORTH-79....
Ekkehard Floegel Elcomp Publishing Redrock Lane Pomona Ca
Fig 8-2 Example for an address input. The main words of the mailing list are NEW NEW creates a new mailing list. The number FIRST , stored in the first two bytes in block 100 is set to one. In FIRST the number of the next entry is stored. INPUT enters the input mode of the mailing list. The mask is placed on the screen and the cursor is placed into the first field. The cursor is moved to the next field by pressing the RETURN key. It is also moved if all places of a field are filled with...