Forth V4.0/V4.2 Source-form Functions
Forth language legacy routines now provided as source code files
This glossary describes some little-used library routines that used to reside in QED-Forth V2.xx Kernel PROM, but are now provided instead as source code files. Software development in V4 Forth uses the Mosaic IDE Integrated Development Environment; this is the same IDE used for software development in C. While Forth programmers will not use the IDE's C compiler, the IDE provides a full-featured text editor and customized terminal for rapid Forth code downloads and interactive Forth debugging sessions with the 68HC11 processor on the controller board.
For help in understanding the definitions found in the glossaries, consult the description of stack symbols, abbreviations and naming conventions.
The following glossary entries are alphabetized in ASCII Order: -./0123456789>ABCDEFGHIJKLMNOPQRSTUVWXYZ
>
--> ( -- )
When encountered while interpreting a block, causes the next block to be interpreted. Sets >IN
=
0
and increments BLK
.
Pronunciation: "to-next-block"
.LINE
.LINE ( n1\n2 -- | n1 = line#, n2 = block# )
Prints the specified line in the specified block.
Pronunciation: "dot-line" Attributes: M
2xN.MATRIX*
2xN.MATRIX* ( 2x2.matrix.xpfa\2xN.matrix.xpfa -- )
Multiplies a 2x2 source1 matrix specified by 2x2.matrix.xpfa times a 2xN source2 matrix specified by 2xN.matrix.xpfa to produce a destination 2xN matrix that is stored into the source2 matrix specified by 2xN.matrix.xpfa. No error checking is performed, so the source matrices must be properly dimensioned. Multiplies two 2x2 matrices in just 2.7 msec.
Pronunciation: "two-by-n-matrix-star" Attributes: S
3xN.MATRIX*
3xN.MATRIX* ( 3x3.matrix.xpfa\3xN.matrix.xpfa -- )
Multiplies a 3x3 source1 matrix specified by 3x3.matrix.xpfa times a 3xN source2 matrix specified by 3xN.matrix.xpfa to produce a destination 3xN matrix that is stored into the source2 matrix specified by 3xN.matrix.xpfa. No error checking is performed, so the source matrices must be properly dimensioned. Multiplies two 3x3 matrices in just 13.5 msec.
Pronunciation: "three-by-n-matrix-star" Attributes: S
>L
>L ( n <text> -- | n = line# )
Removes remaining text from the input line and puts it in the block (screen) designated by the user variable SCR at the specified line number n. Intended for use from terminal only (not from inside a block)!
Pronunciation: "to-l"
BLOCK.BUFFERS
BLOCK.BUFFERS ( xaddr\n -- | xaddr = start, n = #blocks )
Allocates a contiguous region of memory for use as block buffers. This command must be executed before using the mass memory interface. xaddr is the extended starting address of the first buffer, and n is the number of block buffers. n is typically equal to 2, although allocating more buffers reduces the time to load a new block when a slow mass memory device is used. BLOCK.BUFFERS
restricts n to the range 2 ≤ n ≤ 63. The size of each buffer is 1028 (hex 404) bytes, and the buffers may cross page boundaries. BLOCK.BUFFERS
initializes FIRST
, LIMIT
, PREV
, and USE
.
See also IS.RAMDISK
EMPTY.BUFFERS
FLUSH
INIT.UREAD/WRITE
INIT.UREAD/WRITE ( -- )
Revectors READ/WRITE to execute the RAMDISK function which treats a specified block of RAM as a mass memory device. To use the RAMDISK, execute INIT.UREAD/WRITE in your AUTOSTART or PRIORITY.AUTOSTART routine so it is installed after each restart. To use an external mass memory device, define a routine with the same stack picture as READ/WRITE (see the main glossary) that accesses the mass memory device, and install its extended code field address (xcfa) in the UREAD/WRITE user variable.
IS.RAMDISK
IS.RAMDISK ( xaddr\u -- | xaddr = start, u = number of 1K blocks )
Declares an area of memory starting with xaddr and totaling (1024*u) bytes as a ram disk, and stores 0\0 into OFFSET. The specified ram disk memory may cross page boundaries and may occupy multiple contiguous pages. This word must be executed before using the ram disk feature of the mass memory (blocks) interface. Note that BLOCK.BUFFERS must also be executed before using the blocks interface.
Implementation detail: Initializes the headerless system variables RAMDISK.START and #RAMDISK.BLOCKS appropriately, and zeroes the user variable OFFSET.
Pronunciation: "is-ram-disk"
LINE>$
LINE>$ ( n1\n2 -- xaddr\cnt | n1 = line#, n2 = block# )
Converts line# n1 and block# (screen#) n2 into a string specification xaddr\cnt.
Pronunciation: "line-to-string"
LIST
LIST ( n -- | n = block# )
Displays the specified block and stores n into the user variable SCR. The block is printed as 16 lines of 64 characters per line.
Attributes: M, S
LOAD
SAVE.BUFFERS
SAVE.BUFFERS ( -- )
Transfers the contents of all UPDATEd block buffers to mass storage. Marks all buffers as unmodified.
SUBSTRING
SUBSTRING ( xaddr1\cnt1\xaddr2\cnt2 -- xaddr3\cnt3\flag )
Searches for a substring specified by xaddr1\cnt (i.e., the address of the first character under the character count) in the larger string xaddr2\cnt2, and returns the closest match xaddr3\cnt3 in the larger string. When checking for a match, comparison starts with the first character in the smaller string. flag is TRUE if a full match is found, and FALSE if a partial or no match is found. If no match is found, flag is FALSE and cnt3 equals 0.
THRU
THRU ( u1\u2 -- | u1 = starting.block#, u2 = ending.block# )
Loads (i.e., interprets) from the starting block u1 through the ending block u2, inclusive.
Pronunciation: "through"