misc definitions



p4_Q_comp_ : ?COMP ( -- )

check that the current STATE is compiling otherwise THROW
often used in control-words

reference: ../src/misc.c:0094

p4_Q_cr_ : ?CR ( -- flag )

like CR , stop 25 lines past START?CR

reference: ../src/misc.c:0700

p4_Q_csp_ : ?CSP ( -- )

check that SP == CSP otherwise THROW
used in control-words

reference: ../src/misc.c:0083

p4_Q_exec_ : ?EXEC ( -- )

check that the current STATE is executing otherwise THROW
often used in control-words

reference: ../src/misc.c:0105

p4_Q_file_ : ?FILE ( file-id -- )

check the file-id otherwise (fixme)

reference: ../src/misc.c:0114

p4_Q_loading_ : ?LOADING ( -- )

check that the currently interpreted text is from a file/block, otherwise THROW

reference: ../src/misc.c:0126

p4_Q_pairs

reference: ../src/yours.c:0657

p4_Q_pairs_ : ?PAIRS ( a b -- )

if compiling, check that the two magics on the CS-STACK are identical, otherwise throw
used in control-words

reference: ../src/misc.c:0137

p4_Q_stack_ : ?STACK ( -- )

check all stacks for underflow and overflow conditions, and if such an error condition is detected THROW

reference: ../src/misc.c:0147

p4_Q_stop_ : ?STOP ( -- flag )

check for 'q' pressed - see ?CR

reference: ../src/misc.c:0682

p4_access_array_

reference: ../src/misc.c:0403

p4_argc_ : ARGC ( -- n )

reference: ../src/misc.c:1074

p4_argv_ : ARGV ( n -- addr u )

reference: ../src/misc.c:1081

p4_backspace_ : BACKSPACE ( -- )

reverse of SPACE

reference: ../src/misc.c:0673

p4_build_array_ : BUILD-ARRAY ( n1 n2 ... nX X --- n )

writes X, n1, ... nX into the dictionary - returns product n1 * n2 * ... * nX

reference: ../src/misc.c:0387

p4_close_all_files_ : CLOSE-ALL-FILES ( -- )

reference: ../src/misc.c:0707

p4_cold_ : COLD ( -- )

   cold abort - reinitialize everything and go to => QUIT routine

reference: ../src/misc.c:0045

p4_copy_file_ : COPY-FILE ( src-str src-strlen dst-str dst-strlen -- errno|0 )

like RENAME-FILE, copies the file from src-name to dst-name and returns an error-code or null

reference: ../src/misc.c:0948

p4_dash_roll_ : -ROLL ( xn ... x2 x1 n -- x1 xn ... x2 )

the inverse of ROLL

reference: ../src/misc.c:0247

p4_dot_date_ : .PFE-DATE ( -- )

reference: ../src/misc.c:0749

p4_dot_line

reference: ../src/misc.c:0064

p4_dot_line_ : .LINE ( line# block# -- )

reference: ../src/misc.c:0062

p4_dot_memory_ : .MEMORY ( -- )

reference: ../src/misc.c:0726

p4_dot_name

reference: ../src/toolkit.c:0237

p4_dot_name_ : .NAME ( nfa -- )

print the name-field which is effectivly a bstring - in some forth implementations the name-field is identical with the flag-field, so the nfa's count has to be masked the, e.g.
 : .NAME COUNT 32 AND TYPE ;
if the name-field and flag-field are different, then this word does effectivly
 : .NAME COUNT TYPE ;

reference: ../src/misc.c:0239

p4_dot_version_ : .VERSION ( -- )

reference: ../src/misc.c:0742

p4_dup_to_r_ : DUP>R ( val -- val )

shortcut, see R>DROP
note again that the following will fail:
 : DUP>R DUP >R ;

reference: ../src/misc.c:0275

p4_executes_ : EXECUTES word ( n -- )

stores the execution token of following word into the callback pointer for the specified function-key

reference: ../src/misc.c:0902

p4_executes_execution_ : ((EXECUTES)) ( n -- )

compiled by EXECUTES

reference: ../src/misc.c:0893

p4_expand_fn_ : EXPAND-FN ( addr1 u1 addr2 -- addr2 cnt2 )

reference: ../src/misc.c:1093

p4_f_p_fetch_ : FP@ ( -- addr )

returns the floating point stack pointer

reference: ../src/misc.c:0505

p4_f_p_store_ : FP! ( addr -- )

sets the floating point stack pointer - this is the inverse of FP@

reference: ../src/misc.c:0514

p4_file_block_ : FILE-BLOCK ( a file-id -- c )

reference: ../src/misc.c:0987

p4_file_buffer_ : FILE-BUFFER ( a file-id -- c )

reference: ../src/misc.c:0996

p4_file_empty_buffers_ : FILE-EMPTY-BUFFERS ( file-id -- )

reference: ../src/misc.c:1006

p4_file_flush_ : FILE-FLUSH ( file-id -- )

 simulate      : FILE-FLUSH DUP FILE-SAVE-BUFFERS FILE-EMTPY-BUFFERS ;

reference: ../src/misc.c:1014

p4_file_list_ : FILE-LIST ( x file-id -- )

reference: ../src/misc.c:1024

p4_file_load_ : FILE-LOAD ( x file-id -- )

reference: ../src/misc.c:1033

p4_file_rw_ : FILE-R/W ( addr blk f fid -- )

like FIG-Forth R/W

reference: ../src/misc.c:0976

p4_file_save_buffers_ : FILE-SAVE-BUFFERS ( file-id -- )

reference: ../src/misc.c:1042

p4_file_thru_ : FILE-THRU ( lo hi file-id -- )

see THRU

reference: ../src/misc.c:1052

p4_file_update_ : FILE-UPDATE ( file-id -- )

reference: ../src/misc.c:1063

p4_greater_equal_ : >= ( a b -- flag )

 simulate    : >= < 0= ;

reference: ../src/misc.c:0453

p4_header

reference: ../src/lpf83.c:0388

p4_header_ : HEADER ( bstring -- )

CREATE a new header in the dictionary from the given string, the runtime is the same as with CREATE
 usage: : CREATE  BL WORD HERE HEADER ;

reference: ../src/misc.c:1268

p4_help_ : HELP ( -- )

reference: ../src/misc.c:0926

p4_include_ : INCLUDE filename ( -- ? )

load the specified file, see also LOAD" filename"

reference: ../src/misc.c:1187

p4_latest_ : LATEST ( -- nfa )

return the NFA of the lateset definition in the CURRENT vocabulary

reference: ../src/misc.c:0175

p4_less_equal_ : <= ( a b -- flag )

 simulate    : <= > 0= ;

reference: ../src/misc.c:0444

p4_license_ : LICENSE ( -- )

reference: ../src/misc.c:0757

p4_load_quote_ : LOAD" filename" ( -- ?

load the specified file - this word can be compiled into a word-definition

reference: ../src/misc.c:1164

p4_load_quote_execution_ : ((LOAD")) ( -- ? )

reference: ../src/misc.c:1151

p4_ls_cdefs_ : LS.COLON-DEFS ( -- )

see WORDS

reference: ../src/misc.c:0598

p4_ls_constants_ : LS.CONSTANTS ( -- )

see WORDS

reference: ../src/misc.c:0608

p4_ls_ddefs_ : LS.DOES-DEFS ( -- )

see WORDS

reference: ../src/misc.c:0603

p4_ls_markers_ : LS.MARKERS ( -- )

see WORDS

reference: ../src/misc.c:0623

p4_ls_primitives_ : LS.PRIMITIVES ( -- )

see WORDS

reference: ../src/misc.c:0593

p4_ls_variables_ : LS.VARIABLES ( -- )

see WORDS

reference: ../src/misc.c:0613

p4_ls_vocabularies_ : LS.VOCABULARIES ( -- )

see WORDS

reference: ../src/misc.c:0618

p4_ls_words_ : LS.WORDS ( -- )

see WORDS

reference: ../src/misc.c:0588

p4_move_file_ : MOVE-FILE ( src-str src-strlen dst-str dst-strlen -- errno|0 )

like RENAME-FILE, but also across-volumes
moves the file from src-name to dst-name and returns an error-code or null

reference: ../src/misc.c:0963

p4_paren_emit_ : (EMIT) ( val -- )

like EMIT and always to screen - the routine to be put into *EMIT*

reference: ../src/misc.c:0814

p4_paren_expect_ : (EXPECT) ( . -- . )

like EXPECT and always from screen - the routine to be put into *EXPECT*

reference: ../src/misc.c:0823

p4_paren_forget_ : (FORGET) ( addr -- )

forget everything above addr - used by FORGET

reference: ../src/misc.c:0657

p4_paren_key_ : (KEY) ( -- ... )

like KEY and always from screen - the routine to be put into *KEY*

reference: ../src/misc.c:0833

p4_paren_type_ : (TYPE) ( val -- )

like TYPE and always to screen - the routine to be put into *TYPE*

reference: ../src/misc.c:0847

p4_plus_to_ : +TO name ( val -- )

add the val to the named VALUE or LOCALS| value

reference: ../src/misc.c:0346

p4_plus_to_execution_ : ((+TO)) ( val -- )

execution compiled by +TO adds the stack-val to the lvalue compiled

reference: ../src/misc.c:0329

p4_plus_to_local_execution_ : ((+TO.local)) ( val -- )

same as ((+TO)) when the lvalue is a LOCALS| value
compiled by +TO

reference: ../src/misc.c:0338

p4_pocket_ : POCKET ( n -- addr u )

returns the specified pocket as a S" string reference

reference: ../src/misc.c:0544

p4_r_from_drop_ : R>DROP ( -- )

shortcut (e.g. in CSI-Forth)
note that
 : R>DROP R> DROP ; 
would be wrong - for a non-direct-threaded forth it would be
 : R>DROP R> R> NIP >R ;

reference: ../src/misc.c:0265

p4_raise_ : RAISE ( n -- )

send a SIGNAL to self

reference: ../src/misc.c:1243

p4_random_ : RANDOM ( n1 -- n2 )

returns random number with 0 <= n2 < n1)

reference: ../src/misc.c:0292

p4_show_status_ : SHOW-STATUS ( -- )

display internal variables

reference: ../src/misc.c:0772

p4_signal_ : SIGNAL ( xt1 n -- xt2 )

install signal handler - return old signal handler

reference: ../src/misc.c:1252

p4_smudge_ : SMUDGE (modified from FIG definition)

FIG definition toggles the bit!

reference: ../src/misc.c:0183

p4_source_line_ : SOURCE-LINE ( -- n )

if SOURCE is from EVALUATE (or QUERY ) then the result is 0 else the line-numbers start from 1

reference: ../src/misc.c:0525

p4_srand_ : SRAND ( n -- )

reference: ../src/misc.c:0304

p4_standard_io_ : STANDARD-I/O ( -- )

initialize *TYPE* , *EMIT* , *EXPECT* and *KEY* to point directly to the screen I/O routines,
namely (TYPE) , (EMIT) , (EXPECT) , (KEY)

reference: ../src/misc.c:0858

p4_start_Q_cr_ : START?CR ( -- )

initialized for more-like effect - see ?CR

reference: ../src/misc.c:0691

p4_store_csp_ : !CSP ( -- )

put SP into CSP
used in control-words

reference: ../src/misc.c:0073

p4_system_ : SYSTEM ( addr u -- ret-val )

run a shell command
(embedded systems have no shell)

reference: ../src/misc.c:1199

p4_system_quote_ : SYSTEM" commandline" ( -- ret-val )

run a shell command
(embedded systems have no shell)

reference: ../src/misc.c:1220

p4_system_quote_execution_ : ((SYSTEM"))

compiled by SYSTEM" commandline"

reference: ../src/misc.c:1208

p4_tab

reference: ../src/misc.c:0667

p4_tab_ : TAB ( n -- )

jump to next column divisible by n

reference: ../src/misc.c:0665

p4_toggle_ : TOGGLE ( c-addr charmask -- )

toggle the bits given in charmask, see also SMUDGE and = UNSMUDGE
 example: the fig-style SMUDGE had been defined such
   : FIG-SMUDGE LATEST >FFA (SMUDGE#) TOGGLE ;

reference: ../src/misc.c:0165

p4_topmost_ : TOPMOST ( wid -- a-addr )

that last valid word in the specified vocabulary

reference: ../src/misc.c:0566

p4_u_d_dot_ : UD. ( 2val -- )

see also UD.R

reference: ../src/misc.c:0222

p4_u_d_dot_r_ : UD.R ( 2val r -- )

reference: ../src/misc.c:0208

p4_u_greater_equal_ : U>= ( a b -- flag )

 simulate    : U>= U< 0= ;

reference: ../src/misc.c:0471

p4_u_less_equal_ : U<= ( a b -- flag )

 simulate    : U<= U> 0= ;

reference: ../src/misc.c:0462

p4_u_max_ : UMAX ( a b -- max )

see MAX

reference: ../src/misc.c:0480

p4_u_min_ : UMIN ( a b -- min )

see MIN , MAX and UMAX

reference: ../src/misc.c:0490

p4_under_plus_

reference: ../src/misc.c:0316

p4_unsmudge_ : UNSMUDGE (turn smudge-bit off)

neccessary because SMUDGE modified

reference: ../src/misc.c:0194

p4_using_ : USING filename ( -- )

use filename as a block file

reference: ../src/misc.c:1110

p4_using_new_ : USING-NEW filename ( -- )

like USING but can create the file

reference: ../src/misc.c:1126

p4_w_fetch_ : W@ ( addr -- w-val )

fetch a 2byte-val from address

reference: ../src/misc.c:0630

p4_w_plus_store_ : W+! ( w-val addr -- )

add a 2byte-val to addressed 2byte-value

reference: ../src/misc.c:0647

p4_w_store_ : W! ( w-val addr -- )

store a 2byte-val at addressed 2byte-value

reference: ../src/misc.c:0638

p4_warranty_ : WARRANTY ( -- )

reference: ../src/misc.c:0764

p4_wl_hash_ : WL-HASH ( c-addr n1 -- n2 )

calc hash-code for selection of thread in a threaded-vocabulary

reference: ../src/misc.c:0557

p4_zero_greater_equal_

reference: ../src/misc.c:0436

p4_zero_less_equal_ : 0<= ( a -- flag )

 simulate    : 0<= 0> 0= ;

reference: ../src/misc.c:0428

p4_alloc_parsed_string

reference: ../src/misc.c:1225

p4_file_error

reference: ../src/misc.c:1146

p4_initialize_system

reference: ../src/misc.c:0048

p4_load_file

reference: ../src/misc.c:1178

p4_read_write

reference: ../src/misc.c:0978

p4_run_forth

reference: ../src/misc.c:0053

p4_skip_delimiter

reference: ../src/misc.c:1176

p4_store_execution

reference: ../src/misc.c:0914

p4_strpush

reference: ../src/misc.c:1088