home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
- ;=C ! pop stack to memory - "store" n addr --
- ;=: !CSP save SP at CSP --
- ;=: # convert one digit of d1 to ASCII d1 -- d2
- ;=: #> end number formatting d -- addr count
- ;=# #BUFF total number of block buffers -- n
- ;=: #S process all significant digits of d1 d1 -- 0.
- ;=: ' find next input word in dictionary -- PFA
- ;=: ( begin a comment ended by ')' --
- ;=C (+LOOP) (LOOP) with increment on S1 n --
- ;=: (.") run time code for ." --
- ;=C+ (2ARR) 2d array addressing primitive n1 n2 addr1 -- addr2
- ;=C+ (2CARR) 2d byte array addressing primitive n1 n2 addr1 -- addr2
- ;=: (;CODE) run time code for ;CODE --
- ;=: (ABORT) error function when WARNING is -1 --
- ;=C+ (ARRAY) 1d array addressing primitive n1 addr1 -- addr2
- ;=C+ (BLKRD) block read primitive --
- ;=C+ (BLKWRT) block write primitive --
- ;=C+ (CARR) 1d byte array addressing primitive n addr1 -- addr2
- ;=C+ (CLOSE) close FCB, f is TRUE on error FCB -- f
- ;=C* (CR) console newline primitive --
- ;=C+ (CREATE) create file, f is TRUE on error FCB -- f
- ;=C (DO) run-time loop initialization n2 n1 --
- ;=C* (EMIT) console char. output primitive c --
- ;=C+ (FBLKRD) read n blocks from file FCB n -- f
- ;=C+ (FBLKWRT) write n blocks to file FCB n -- f
- ;=C* (FIND) dictionary search primtive a1 NFA -- [PFA b] f
- ;=C+ (FNAME) parse filename at addr using mode n FCB addr1 n -- addr2 f
- ;=C* (KEY) read console primitive -- c
- ;=: (LINE) convert a line/screen to addr/count l s -- addr count
- ;=C (LOOP) execution time loop code --
- ;=: (NUMBER) ASCII to binary conversion primitive d1 addr1 -- d2 addr2
- ;=C+ (OPEN) open FCB, f is TRUE if error FCB -- f
- ;=C+ (READ) read next record from file to addr FCB addr -- f
- ;=C+ (WRITE) write next record to file from addr FCB addr -- f
- ;=C+ (XOF) primitive compiled by CASE..OF n1 n2 -- [n1]
- ;=: * 16-bit signed multipication n1 n2 -- n1*n2
- ;=: */ scale n1 by the ratio of n2 to n3 n1 n2 n3 -- nquot
- ;=: */MOD scale n1 by the ratio of n2 to n3 n1 n2 n3 -- nrem nquot
- ;=C + 16-bit addition n1 n2 -- nsum
- ;=C +! add to a memory location n addr --
- ;=: +- apply the sign of n2 to n1 n1 n2 -- n3
- ;=:* +BUF advance addr to next buffer addr1 -- addr2
- ;=: +LOOP end of DO..+LOOP structure addr 3 --
- ;=: +ORIGIN word for accessing data in low memory n -- addr
- ;=: , compile n into the dictionary n --
- ;=C - 16-bit subtraction n1 n2 -- n1-n2
- ---------- 4TH-DISK.ASM
- ---------- 4TH-FILE.ASM
- ---------- 4TH-MAIN.ASM
- ---------- 4TH-SYSD.ASM
- ---------- 4TH-XTNS.ASM
- ;=: --> continue with next screen --
- ;=: -DUP duplicate the top number if it isn't 0 n -- n [n]
- ;=: -FIND search dictionary for next input word -- [PFA b] f
- ;=: -TRAILING adjust addr/n to avoid trailing blanks addr n1 -- addr n2
- ;=: . print a 16-bit number n --
- ;=: ." print the following string --
- ;=: .LINE type line n1 in screen n2 n1 n2 --
- ;=: .R print n1 right-aligned in n2 columns n1 n2 --
- ;=: / 16-bit signed division n1 n2 -- nquot
- ;=: /MOD 16-bit signed division with remainder n1 n2 -- nrem nquot
- ;=# 0 zero -- 0
- ;=C 0< test top of stack for negative value n -- f
- ;=C 0= test top of stack for zero n -- f
- ;=C 0BRANCH branch if f is zero f --
- ;=# 1 one -- 1
- ;=C 1+ increment the top stack item n -- n+1
- ;=C+ 1- decrement the top stack item n -- n-1
- ;=# 2 two -- 2
- ;=C 2! 32-bit store d addr --
- ;=C 2+ add 2 to the top stack item n -- n+2
- ;=C+ 2- subtract 2 from the top stack item n -- n-2
- ;=C 2@ fetch 32-bit number addr -- d
- ;=C 2DUP duplicate the top two stack items n1 n2 -- n1 n2 n1 n2
- ;=# 3 three -- 3
- ;=C : begin colon definition --
- ;=: ; end colon definition --
- ;=: ;CODE end colon compilation, start CODE --
- ;=C ;S end of screen or run time colon word --
- ;=C < test for top number > second number n1 n2 -- f
- ;=: <# begin number formatting --
- ;=: <BUILDS define compile time behavior --
- ;=: <nul> 0 in input: resets interpreter --
- ;=: = test top two items for equality n1 n2 -- f
- ;=: > test for second item > top of stack n1 n2 -- f
- ;=C >R push parm. stack to return stack n --
- ;=: ? print the value at addr addr --
- ;=: ?COMP issue a message if not compiling --
- ;=: ?CSP issue a message if SP <> (CSP) --
- ;=: ?ERROR issue error message m if f is TRUE f m --
- ;=: ?EXEC issue a message if not executing --
- ;=C+ ?FIRST search for first matching file FCB addr -- f
- ;=: ?LOADING issue a message if not loading --
- ;=C+ ?NEXT search for next matching file addr FCB -- f
- ;=: ?PAIRS issue a message if n1 <> n2 n1 n2 --
- ;=: ?STACK check if the stack is out of bounds --
- ;=C ?TERMINAL console status -- f
- ;=C @ push memory location to stack addr -- n
- ;=U+ @BLKRD CFA of function to read one block -- addr
- ;=U+ @BLKWRT CFA of function to write one block -- addr
- ;=?+ @BREAK CFA of function to get control on ^C -- addr
- ;=U+ @CR CFA of function to output newline -- addr
- ;=U+ @EMIT CFA of function to do character output -- addr
- ;=U+ @KEY CFA of function to do character input -- addr
- ;=: ABORT clear stacks and begin execution --
- ;=: ABS take the absolute value of n1 n1 -- n2
- ;=: AGAIN end of BEGIN..AGAIN infinite loop addr 1 --
- ;=: ALLOT reserve n bytes in the dictionary n --
- ;=C AND bitwise AND n n -- n
- ;=# B/BUF size of disk buffers in bytes -- 1024
- ;=# B/SCR number of disk buffers per screen -- 1
- ;=C+ B/SEC get bytes/sector -- n
- ;=: BACK compile a backward branch offset target --
- ;=U BASE current number base for i/o -- addr
- ;=: BEGIN starting point of looping structures -- HERE 1
- ;=# BL ASCII blank -- 32
- ;=: BLANKS fill n bytes at addr with blanks addr n --
- ;=U BLK current block, 0 if terminal -- addr
- ;=#+ BLK/DRIVE number of 1K blocks per drive -- n
- ;=:+ BLKRD read one block from disk to addr addr blk --
- ;=:+ BLKWRT write one block to disk from addr addr blk --
- ;=:* BLOCK get block n n -- addr
- ;=:+ BLOCK-READ read one block to addr addr blk --
- ;=:+ BLOCK-WRITE write one block from addr addr blk --
- ;=C BRANCH adds an inline offset to IP --
- ;=:* BUFFER assign an available buffer to block n n -- addr
- ;=C* BYE exit FORTH ? -- ?
- ;=C C! byte store - "see-store" b addr --
- ;=: C, compile a byte into the dictionary b --
- ;=# C/L characters per line -- 64
- ;=C C@ push byte location to stack addr -- b
- ;=: CFA convert a PFA to CFA PFA -- CFA
- ;=C CMOVE byte block move a1 a2 n --
- ;=:* COLD full initialization and restart --
- ;=: COMPILE compile the following word at run time --
- ;=: CONSTANT define a symbolic constant n --
- ;=U CONTEXT current vocabulary for execution -- addr
- ;=: COUNT prepare to type a string addr -- addr+1 n
- ;=:* CR output carriage return/line feed --
- ;=:* CREATE create a dictionary header --
- ;=U CSP temporary storage for Current SP -- addr
- ;=U CURRENT current vocabulary for definitions -- addr
- ;=:+ D&RCALC set drive/record for block n n --
- ;=C D+ 32-bit addition d1 d2 -- dsum
- ;=: D+- apply the sign of n to d1 d1 n -- d2
- ;=: D. print a 32-bit number d --
- ;=: D.R print d right-aligned in n columns d n --
- ;=: DABS take the absolute value of d1 d1 -- d2
- ;=C+ DATE! set system date n1 n2 n3 --
- ;=C+ DATE@ fetch system date -- n1 n2 n3
- ;=: DECIMAL set the current number base to 10 --
- ;=: DEFINITIONS set CURRENT to CONTEXT --
- ;=C DIGIT convert c to binary using base n1 c n1 -- [n2] f
- ;=C+ DISK set default drive to n, n2 is #drives n -- n2
- ;=? DISK-ERROR status of last disk operation -- addr
- ;=C+ DISK@ return default disk number -- n
- ;=: DLITERAL compile d to be used at run time d --
- ;=C DMINUS 32-bit two's complement d -- -d
- ;=: DO start of DO..LOOP structure -- HERE 3
- ;=: DOES> define run time behavior --
- ;=U DP top address used in dictionary -- addr
- ;=U DPL Decimal Point Locator -- addr
- ;=: DR0 set offset for drive zero --
- ;=: DR1 set offset for drive one --
- ;=? DRIVE disk drive last accessed -- addr
- ;=C DROP throw out top stack item n --
- ;=?+ DTA disk transfer address last used -- addr
- ;=C DUP duplicate the top stack item n -- n n
- ;=: ELSE optional part of IF..ELSE..THEN addr 2 -- HERE 2
- ;=:* EMIT char output c --
- ;=:* EMPTY-BUFFERS wipe out disk buffers --
- ;=C ENCLOSE text scanning primitive a1 c -- a1 n1 n2 n3
- ;=: END synonym for UNTIL addr 1 --
- ;=: ENDIF end of IF..ELSE..THEN structure addr 2 --
- ;=: ERASE fill n bytes at addr with 0's addr n --
- ;=: ERROR system error handler - n is line no. n -- [IN BLK]
- ;=C EXECUTE executes the word at CFA CFA -- ?
- ;=: EXPECT input up to n characters to addr addr n --
- ;=C+ FDEL delete file FCB -- f
- ;=U FENCE pointer to protected dictionary -- addr
- ;=C FILL fill n bytes at address with c addr n c --
- ;=# FIRST address of lowest disk buffer -- addr
- ;=:* FLUSH empty buffers, saving changed ones --
- ;=:* FORGET chop off the top of the dictionary --
- ;=: FORTH FORTH vocabulary header --
- ;=C+ FREN rename file addr -- f
- ;=: HERE next available dictionary location -- addr
- ;=: HEX set the current number base to 16 --
- ;=U HLD text pointer used in number formatting -- addr
- ;=: HOLD insert char in formatted output c --
- ;=C I leave index value -- n
- ;=: ID. print dictionary name field NFA --
- ;=: IF conditional branch structure -- 2
- ;=: IMMEDIATE mark the latest word to be executed --
- ;=U IN current character in input stream -- addr
- ;=: INDEX print line 0 of screens n1 thru n2 n1 n2 --
- ;=: INTERPRET outer text interpreter --
- ;=:* KEY char input -- c
- ;=C+ L! intersegment store operator n seg off --
- ;=C+ L@ intersegment fetch operator seg off -- n
- ;=: LATEST return the top NFA in CURRENT -- NFA
- ;=C+ LC! intersegment byte store b seg off --
- ;=C+ LC@ intersegment byte fetch seg off -- b
- ;=C LEAVE force loop exit --
- ;=: LFA convert a PFA to LFA PFA -- LFA
- ;=# LIMIT last available memory address + 1 -- addr
- ;=: LIST list screen n, as 16 lines of 64 chars n --
- ;=C LIT push an inline literal -- n
- ;=: LITERAL compile n to be used at run time n --
- ;=: LOAD interpret screen n n --
- ;=: LOOP end of DO..LOOP structure addr 3 --
- ;=: M* mixed multiplication n1 n2 -- d
- ;=: M/ mixed division d n1 -- nrem nquot
- ;=: M/MOD mixed unsigned scaler ud1 u -- urem udquot
- ;=C MATCH string search primtive addr1 n addr2 n -- f addr3
- ;=: MAX return the larger of two numbers n1 n2 -- n
- ;=#+ MAXBLOCK highest valid block number -- n
- ;=#+ MAXDRIVE highest valid drive number -- n
- ;=: MESSAGE type error message n n --
- ;=: MIN return the smaller of n1 and n2 n1 n2 -- n
- ;=C MINUS 16-bit two's complement n -- -n
- ;=: MOD 16-bit modulo division n1 n2 -- nrem
- ;=C+ MYSEG get FORTH's segment -- seg
- ;=:* NFA convert a PFA to NFA PFA -- NFA
- ;=: NOOP do nothing - no operation --
- ;=: NUMBER convert string at addr to 32-bit number addr -- d
- ;=U OFFSET number of lowest block to be used -- addr
- ;=C OR bitwise OR n n -- n
- ;=U OUT count of characters output -- addr
- ;=C OVER copy second stack item to top n1 n2 -- n1 n2 n1
- ;=C P! 16-bit port output n port# --
- ;=C P@ 16-bit port fetch port# -- n
- ;=: PAD returns addr of the text output buffer -- addr
- ;=C PC! send byte to port b port# --
- ;=C PC@ fetch byte from a port port# --
- ;=:* PFA convert a NFA to PFA NFA -- PFA
- ;=? PREV pointer to disk buffer last accessed -- addr
- ;=?* PRINTER flag controlling printer -- addr
- ;=: QUERY EXPECT 80 characters to TIB --
- ;=: QUIT halt execution, reset interpreter --
- ;=C R top of return stack to parm. stack -- n
- ;=U R# current editing cursor location -- addr
- ;=:* R/W block read/write, f=1=write, f=2=read addr blk f --
- ;=U R0 return stack base -- addr
- ;=C R> pop return stack to parm. stack -- n
- ;=#+ REC/BLK number of disk records to fill 1 buffer -- n
- ;=?+ RECORD disk record last accessed -- addr
- ;=: REPEAT end of BEGIN..WHILE..REPEAT structure addr 1 --
- ;=C ROT bring the third stack item to top n1 n2 n3 -- n2 n3 n1
- ;=C RP! reset return stack ? --
- ;=C RP@ push current RP onto parameter stack -- RP
- ;=C S->D convert a 16-bit number to 32-bits n -- d
- ;=U S0 parameter stack base -- addr
- ;=:+ SAVBUF saves buffer at addr if updated addr --
- ;=:+ SAVE-BUFFERS flush buffers but don't empty --
- ;=U SCR current screen -- addr
- ;=: SIGN places a '-' in output if n < 0 n d -- d
- ;=: SMUDGE make the latest definition unFINDable --
- ;=C SP! reset parameter stack ? --
- ;=C SP@ push current parameter stack pointer -- SP
- ;=: SPACE output a blank --
- ;=: SPACES type n spaces n --
- ;=U STATE current interpreter state -- addr
- ;=C SWAP exchange top two stack items n1 n2 -- n2 n1
- ;=: TASK word to mark the end of the dictionary --
- ;=: THEN synonym for ENDIF addr 2 --
- ;=U TIB Terminal Input Buffer address -- addr
- ;=C+ TIME! set system time n1 n2 --
- ;=C+ TIME@ fetch system time -- n1 n2
- ;=C TOGGLE toggle bits at a memory location n addr --
- ;=: TRAVERSE move across a fig-FORTH name field addr1 n -- addr2
- ;=: TRIAD list screens in groups of three n1 n2 --
- ;=: TYPE output n characters beginning at addr addr n --
- ;=C U* unsigned mixed multiply u1 u2 -- ud
- ;=: U. print an unsigned 16-bit number u --
- ;=C U/ unsigned mixed divide ud u -- urem uquot
- ;=: U< unsigned test for top > next item u1 u2 -- f
- ;=: UNTIL end of BEGIN..UNTIL loop addr 1 --
- ;=: UPDATE mark PREV buffer to be saved --
- ;=? USE pointer to disk buffer to use next -- addr
- ;=: USER define a user variable n --
- ;=: VARIABLE define a symbolic variable n --
- ;=: VLIST print the words in CONTEXT vocabulary --
- ;=U VOC-LINK pointer to top vocabulary -- addr
- ;=: VOCABULARY define a new vocabulary --
- ;=: WARM empty disk buffers and abort --
- ;=U WARNING switch for error processing: 0, 1, -1 -- addr
- ;=: WHILE conditional loop BEGIN..WHILE..REPEAT addr 2 -- HERE 4
- ;=U WIDTH maximum length of word names -- addr
- ;=: WORD get a word delimited by char to HERE c --
- ;=C XOR bitwise exclusive OR n n -- n
- ;=: [ suspend compilation to do calculations --
- ;=: [COMPILE] compile an otherwise immediate word --
- ;=: ] resume compilation after [ --