core definitions



BL_ : BL

a quick constant returning the blank character in host encoding, in ascii that is 0x20

reference: ../src/core.c:2579

_paren_DOES_to__ : (DOES>) ( -- pfa )

execution compiled by DOES>

reference: ../src/core.c:0961

_paren_paren_ABORT_quote__ : ((ABORT")) ( -- )

compiled by ABORT" what"

reference: ../src/core.c:0652

_paren_paren_CONSTANT__ : ((CONSTANT)) ( -- )

runtime compiled by CONSTANT

reference: ../src/core.c:0833

_paren_paren_C_quote__ : ((C")) ( -- bstring )

execution compiled by C" string"

reference: ../src/core.c:2120

_paren_paren_DOES_to__ : ((DOES>)) ( -- pfa )

runtime compiled by DOES>

reference: ../src/core.c:0951

_paren_paren_DO__ : ((DO)) ( end start -- )

compiled by DO

reference: ../src/core.c:0923

_paren_paren_ELSE__ : ((ELSE)) ( -- )

execution compiled by ELSE - just a simple BRANCH

reference: ../src/core.c:1012

_paren_paren_IF__ : ((IF)) ( -- )

execution word compiled by IF - just some simple ?BRANCH

reference: ../src/core.c:1306

_paren_paren_LIT__ : ((LIT)) ( -- value )

execution compiled by LITERAL

reference: ../src/core.c:1383

_paren_paren_LOOP__ : ((LOOP)) ( -- )

execution compiled by LOOP

reference: ../src/core.c:1410

_paren_paren_MARKER__ : ((MARKER))

runtime compiled by MARKER

reference: ../src/core.c:2251

_paren_paren_OF__ : ((OF))

execution compiled by OF

reference: ../src/core.c:2279

_paren_paren_POSTPONE__ : ((POSTPONE)) ( -- )

execution compiled by POSTPONE

reference: ../src/core.c:1520

_paren_paren_Q_DO__ : ((?DO)) ( a b -- )

execution compiled by ?DO

reference: ../src/core.c:2082

_paren_paren_S_quote__ : ((S")) ( -- string-address string-length )

execution compiled by S"

reference: ../src/core.c:1649

_paren_paren_TO__ : ((TO)) ( value -- )

execution compiled by TO

reference: ../src/core.c:2402

_paren_paren_VALUE__ : ((VALUE)) ( -- value )

runtime compiled by VALUE

reference: ../src/core.c:2489

_paren_paren_VAR__ : ((VAR)) ( -- pfa )

the runtime compiled by CREATE which is the usual thing to do in VARIABLE

reference: ../src/core.c:0880

_paren_paren_colon__ : ((:)) ( -- )

compiled by :

reference: ../src/core.c:0486

_paren_paren_dot_quote__ : ((.")) _skip_string_ ( -- )

compiled by ." string"

reference: ../src/core.c:0307

_paren_paren_plus_LOOP__ : ((+LOOP)) ( increment -- )

compiled by +LOOP

reference: ../src/core.c:0250

_paren_paren_semicolon__ : ((;)) ( -- )

compiled by ; and maybe ;AND -- it will perform an EXIT

reference: ../src/core.c:0512

p4_Q_do_ : ?DO .. LOOP ( end start -- )

start a control-loop just like DO - but don't execute atleast once. Instead jump over the code-piece if the loop's variables are not in a range to allow any loop.

reference: ../src/core.c:2096

p4_Q_do_execution_ : ((?DO)) ( a b -- )

execution compiled by ?DO

reference: ../src/core.c:2083

p4_Q_dup_ : ?DUP ( value -- value|[nothing] )

one of the rare words whose stack-change is condition-dependet. This word will duplicate the value only if it is not zero. The usual place to use it is directly before a control-word that can go to different places where we can spare an extra DROP on the is-null-part. This makes the code faster and often a little easier to read.
 example:
   : XX BEGIN ?DUP WHILE DUP . 2/ REPEAT ; instead of
   : XX BEGIN DUP WHILE DUP . 2/ REPEAT DROP ;

reference: ../src/core.c:0628

p4_abort_ : ABORT ( -- ) no-return

throw - will lead back to the QUIT routine

reference: ../src/core.c:0645

p4_abort_quote_ : ABORT" what" ( -- ) no-return

throw like ABORT but print an additional error-message to stdout telling what has happened.

reference: ../src/core.c:0666

p4_abort_quote_execution_ : ((ABORT")) ( -- )

compiled by ABORT" what"

reference: ../src/core.c:0653

p4_abs_ : ABS ( value -- value' )

return the absolute value

reference: ../src/core.c:0677

p4_accept_ : ACCEPT ( a n -- n' )

get a string from terminal into the named input buffer, returns the number of bytes being stored in the buffer. May provide line-editing functions.

reference: ../src/core.c:0688

p4_again_ : AGAIN ( -- )

ends an infinite loop, see BEGIN and compare with WHILE

reference: ../src/core.c:2109

p4_align_ : ALIGN ( -- )

will make the dictionary aligned, usually to a cell-boundary, see ALIGNED

reference: ../src/core.c:0698

p4_aligned_ : ALIGNED ( addr -- addr' )

uses the value (being usually a dictionary-address) and increment it to the required alignment for the dictionary which is usually in CELLS - see also ALIGN

reference: ../src/core.c:0710

p4_allot_ : ALLOT ( count -- )

make room in the dictionary - usually called after a CREATE word like VARIABLE or VALUE to make for an array of variables. Does not initialize the space allocated from the dictionary-heap. The count is in bytes - use CELLS ALLOT to allocate a field of cells.

reference: ../src/core.c:0723

p4_and_ : AND ( val mask -- val' )

mask with a bitwise and - be careful when applying it to logical values.

reference: ../src/core.c:0732

p4_backslash_ : \ comment ( -- )

eat everything up to the next end-of-line so that it is getting ignored by the interpreter.

reference: ../src/core.c:2535

p4_begin_ : BEGIN ( -- ) compie-time: ( -- cs-marker )

start a control-loop, see WHILE and REPEAT

reference: ../src/core.c:0741

p4_bracket_char_ : [CHAR] charword ( -- char )

in compile-mode, get the (ascii-)value of the first charachter in the following word and compile it as a literal so that it will pop up on execution again. See CHAR and ASCII

reference: ../src/core.c:1935

p4_bracket_compile_ : [COMPILE] word ( -- )

while compiling the next word will be place in the currently defined word no matter if that word is immediate (like IF ) - compare with COMPILE and POSTPONE

reference: ../src/core.c:2524

p4_bracket_tick_ : ['] name ( -- ) immediate

will place the execution token of the following word into the dictionary. Does often not do what you expect in non-compiling mode. See ' and '> and may be POSTPONE

reference: ../src/core.c:1921

p4_c_comma_ : C, ( value -- )

store a new byte-value in the dictionary, implicit 1 ALLOT, see ,

reference: ../src/core.c:0762

p4_c_fetch_ : C@ ( addr -- value )

fetch a byte-value from the address, see @

reference: ../src/core.c:0770

p4_c_quote_ : C" string" ( -- bstring )

in compiling mode place the following string in the current word and return the address of the counted string on execution. (in exec-mode use a POCKET and leave the bstring-address of it), see S" string" and the non-portable " string"

reference: ../src/core.c:2133

p4_c_quote_execution_ : ((C")) ( -- bstring )

execution compiled by C" string"

reference: ../src/core.c:2121

p4_c_store_ : C! ( value address -- )

store the byte-value at address, see !

reference: ../src/core.c:0752

p4_case_ : CASE ( comp-value -- comp-value )

start a CASE construct that ends at ENDCASE and compares the value on stack at each OF place

reference: ../src/core.c:2158

p4_cell_plus_ : CELL+ ( value -- value' )

adjust the value by adding a single Cell's width - the value is often an address or offset, see CELLS

reference: ../src/core.c:0779

p4_cells_ : CELLS ( value -- value' )

scale the value by the sizeof a Cell the value is then often applied to an address or fed into ALLOT

reference: ../src/core.c:0789

p4_char_ : CHAR a ( -- value )

return the (ascii-)value of the following word's first character.

reference: ../src/core.c:0798

p4_char_plus_ : CHAR+ ( value -- value' )

increment the value by the sizeof one char - the value is often a pointer or an offset, see CHARS

reference: ../src/core.c:0815

p4_chars_ : CHARS ( value -- value' )

scale the value by the sizeof a char - the value is then often applied to an address or fed into ALLOT (did you expect that sizeof(p4char) may actually yield 2 bytes?)

reference: ../src/core.c:0826

p4_colon_ : : name ( -- )

create a header for a nesting word and go to compiling mode then. This word is usually ended with ; but the execution of the resulting colon-word can also return with EXIT

reference: ../src/core.c:0499

p4_colon_RT_ : ((:)) ( -- )

compiled by :

reference: ../src/core.c:0487

p4_colon_noname_ : :NONAME ( -- cs.value )

start a colon nested-word but do not use CREATE - so no name is given to the colon-definition that follows. When the definition is finished at the corresponding ; the start-address (ie. the execution token) can be found on the outer cs.stack that may be stored used elsewhere then.

reference: ../src/core.c:2061

p4_comma_ : , ( val -- )

store the value in the dictionary
 simulate:
   : , DP  1 CELLS DP +!  ! ;

reference: ../src/core.c:0282

p4_compile_comma_ : COMPILE, ( xt -- )

place the execution-token on stack into the dictionary - in traditional forth this is not even the least different than a simple , but in call-threaded code there's a big difference - so COMPILE, is the portable one. Unlike COMPILE , [COMPILE] and POSTPONE this word does not need the xt to have actually a name, see :NONAME

reference: ../src/core.c:2175

p4_constant_ : CONSTANT name ( value -- )

CREATE a new word with runtime ((CONSTANT)) so that the value placed here is returned everytime the constant's name is used in code. See VALUE for constant-like names that are expected to change during execution of the program. In a ROM-able forth the CONSTANT-value may get into a shared ROM-area and is never copied to a RAM-address.

reference: ../src/core.c:0847

p4_constant_RT_ : ((CONSTANT)) ( -- )

runtime compiled by CONSTANT

reference: ../src/core.c:0834

p4_convert_ : CONVERT ( a b -- a b )

digit conversion, obsolete, superseded by >NUMBER

reference: ../src/core.c:2183

p4_count_ : COUNT ( counted-string -- string-pointer string-length )

usually before calling TYPE

reference: ../src/core.c:0856

p4_cr_ : CR ( -- )

print a carriage-return/new-line on stdout

reference: ../src/core.c:0870

p4_create_ : CREATE name ( -- )

create a name with runtime ((VAR)) so that everywhere the name is used the pfa of the name's body is returned. This word is not immediate and is usually used in the first part of a DOES> defining word.

reference: ../src/core.c:0894

p4_create_RT_ : ((VAR)) ( -- pfa )

the runtime compiled by CREATE which is the usual thing to do in VARIABLE

reference: ../src/core.c:0881

p4_decimal_ : DECIMAL ( -- )

set the BASE to 10
 simulate:
   : DECIMAL 10 BASE ! ;

reference: ../src/core.c:0904

p4_depth_ : DEPTH ( -- value )

return the depth of the parameter stack before the call, see SP@ - the return-value is in CELLS

reference: ../src/core.c:0913

p4_do_ : DO .. LOOP ( end start -- )

pushes $end and $start onto the return-stack ( >R ) and starts a control-loop that ends with LOOP or +LOOP and may get a break-out with LEAVE . The loop-variable can be accessed with I

reference: ../src/core.c:0940

p4_do_execution_ : ((DO)) ( end start -- )

compiled by DO

reference: ../src/core.c:0924

p4_does_ : DOES> ( -- pfa )

does twist the last CREATE word to carry the (DOES>) runtime. That way, using the word will execute the code-piece following DOES> where the pfa of the word is already on stack.

reference: ../src/core.c:0981

p4_does_defined_RT_ : ((DOES>)) ( -- pfa )

runtime compiled by DOES>

reference: ../src/core.c:0952

p4_does_execution_ : (DOES>) ( -- pfa )

execution compiled by DOES>

reference: ../src/core.c:0962

p4_dot_ : . ( val -- )

print the numerical value to stdout - uses BASE

reference: ../src/core.c:0299

p4_dot_paren_ : .( message) ( -- )

print the message to the screen while reading a file. This works too while compiling, so you can whatch the interpretation/compilation to go on. Some Forth-implementations won't even accept a ." message" outside compile-mode while the (current) pfe does.

reference: ../src/core.c:1964

p4_dot_quote_ : ." string" ( -- )

print the string to stdout

reference: ../src/core.c:0319

p4_dot_quote_execution_ : ((.")) _skip_string_ ( -- )

compiled by ." string"

reference: ../src/core.c:0308

p4_dot_r_ : .R ( val prec -- )

print with precision - that is to fill a field of the give prec-with with right-aligned number from the converted value

reference: ../src/core.c:1993

p4_drop_ : DROP ( a -- )

just drop the word on the top of stack, see DUP

reference: ../src/core.c:0993

p4_dup_ : DUP ( a -- a a )

duplicate the cell on top of the stack - so the two topmost cells have the same value (they are equal w.r.t = ) , see DROP for the inverse

reference: ../src/core.c:1003

p4_else_ : ELSE ( -- )

will compile an ((ELSE)) BRANCH that performs an unconditional jump to the next THEN - and it resolves an IF for the non-true case

reference: ../src/core.c:1023

p4_emit_ : EMIT ( char -- )

print the char-value on stack to stdout

reference: ../src/core.c:1037

p4_endcase_ : ENDCASE ( comp-value -- )

ends a CASE construct that may surround multiple sections of OF ... ENDOF code-portions. The ENDCASE has to resolve the branches that are necessary at each ENDOF to point to right after ENDCASE

reference: ../src/core.c:2196

p4_endof_ : ENDOF ( -- )

resolve the branch need at the previous OF to mark a code-piece and leave with an unconditional branch at the next ENDCASE (opened by CASE )

reference: ../src/core.c:2212

p4_environment_dump_ : ( -- )

show the current list of wordsets NOTE, this is superfluous in PFE due to the LOADED dictionary that lists them too

reference: ../src/core.c:1047

p4_environment_query_ : ( string[str/len] -- false | prop true )

check the environment for a property, usually a condition like questioning the existance of specified wordset, but it can also return some implementation properties like "WORDLISTS" (the length of the search-order) or "#LOCALS" (the maximum number of locals) - this is an ANSI-requirement although I have never seen someone actually using it but some portable forth-code may find it useful...

reference: ../src/core.c:1111

p4_equals_ : = ( a b -- cond )

return a flag telling if a is equal to b

reference: ../src/core.c:0562

p4_erase_

reference: ../src/core.c:2224

p4_evaluate

reference: ../src/p4ed.c:1066

p4_evaluate_ : EVALUATE ( str-ptr str-len -- )

INTERPRET the given string, SOURCE id is -1 during that time.

reference: ../src/core.c:1200

p4_execute_ : EXECUTE ( xt -- )

run the execution-token on stack - this will usually trap if it was null for some reason, see >EXECUTE
 simulate:
  : EXECUTE >R EXIT ;

reference: ../src/core.c:1215

p4_exit

reference: ../src/toolkit.c:0273

p4_exit_ : EXIT ( -- )

will unnest the current colon-word so it will actually return the word calling it. This can be found in the middle of a colon-sequence between : and ;

reference: ../src/core.c:1225

p4_expect

reference: ../src/misc.c:0825

p4_expect_ : EXPECT ( str-adr str-len -- )

input handling, see WORD and PARSE and QUERY the input string is placed at str-adr and its length
 in => SPAN - this word is superceded by => ACCEPT

reference: ../src/core.c:2235

p4_f_m_slash_mod_ : ( n1.n1 n2 -- m n )

divide the double-cell value n1 by n2 and return both (floored) quotient n and remainder m

reference: ../src/core.c:1271

p4_fetch_ : @ ( addr -- value )

fetch the value from the variables address

reference: ../src/core.c:0637

p4_fill_ : FILL ( mem-addr mem-length char -- )

fill a memory area with the given char, does now simply call memset()

reference: ../src/core.c:1239

p4_find_ : FIND ( bstring -- cfa|bstring -1|0|1 )

looks into the current search-order and tries to find the name string as the name of a word. Returns its execution-token or the original-bstring if not found, along with a flag-like value that is zero if nothing could be found. Otherwise it will be 1 if the word had been immediate, -1 otherwise.

reference: ../src/core.c:1253

p4_greater_than_ : > ( a b -- cond )

return a flag telling if a is greater than b

reference: ../src/core.c:0571

p4_here_ : HERE ( -- dp-value )

used with WORD and many compiling words
 simulate:   : HERE DP @ ;

reference: ../src/core.c:1282

p4_hex_ : HEX ( -- )

set the input/output BASE to hexadecimal
 simulate:        : HEX 16 BASE ! ;

reference: ../src/core.c:2244

p4_hold

reference: ../src/double.c:0102

p4_hold_ : HOLD ( char -- )

the old-style forth-formatting system -- this word adds a char to the picutred output string.

reference: ../src/core.c:1291

p4_i_ : I ( -- value )

returns the index-value of the innermost DO .. LOOP

reference: ../src/core.c:1299

p4_if_ : IF .. THEN ( value -- )

checks the value on the stack (at run-time, not compile-time) and if true executes the code-piece between IF and the next ELSE or THEN . Otherwise it has compiled a branch over to be executed if the value on stack had been null at run-time.

reference: ../src/core.c:1321

p4_immediate_ : IMMEDIATE ( -- )

make the LATEST word immediate, see also CREATE

reference: ../src/core.c:1332

p4_invert_ : INVERT ( value -- value' )

make a bitwise negation of the value on stack. see also NEGATE

reference: ../src/core.c:1344

p4_j_ : J ( -- value )

get the current DO ... LOOP index-value being the not-innnermost. (the second-innermost...) see also for the other loop-index-values at I and K

reference: ../src/core.c:1355

p4_key_ : KEY ( -- char )

return a single character from the keyboard - the key is not echoed.

reference: ../src/core.c:1364

p4_l_shift_ : LSHIFT ( value shift-val -- value' )

does a bitwise left-shift on value

reference: ../src/core.c:1436

p4_leave_ : LEAVE ( -- )

quit the innermost DO .. LOOP - it does even clean the return-stack and branches to the place directly after the next LOOP

reference: ../src/core.c:1374

p4_left_bracket_ : [ ( -- )

leave compiling mode - often used inside of a colon-definition to make fetch some very constant value and place it into the currently compiled colon-defintion with , or LITERAL - the corresponding unleave word is ]

reference: ../src/core.c:1910

p4_less_sh_ : <# ( -- )

see also HOLD for old-style forth-formatting words and PRINTF of the C-style formatting - this word does initialize the pictured numeric output space.

reference: ../src/core.c:0554

p4_less_than_ : < ( a b -- cond )

return a flag telling if a is lower than b

reference: ../src/core.c:0543

p4_literal_ : LITERAL ( value -- )

if compiling this will take the value from the compiling-stack and puts in dictionary so that it will pop up again at the run-time of the word currently in creation. This word is used in compiling words but may also be useful in making a hard-constant value in some code-piece like this:
 : DCELLS [ 2 CELLS ] LITERAL * ; ( will save a multiplication at runtime)

reference: ../src/core.c:1397

p4_literal_execution_ : ((LIT)) ( -- value )

execution compiled by LITERAL

reference: ../src/core.c:1384

p4_loop_ : LOOP ( -- )

resolves a previous DO thereby compiling ((LOOP)) which does increment/decrement the index-value and branch back if the end-value of the loop has not been reached.

reference: ../src/core.c:1424

p4_loop_execution_ : ((LOOP)) ( -- )

execution compiled by LOOP

reference: ../src/core.c:1411

p4_m_star_ : M* ( a b -- m,m )

multiply and return a double-cell result

reference: ../src/core.c:1445

p4_marker_ : MARKER name

create a named marker that you can use for FORGET the ANSI-standard does even require to reset the search-order which is not done in pfe (FIXME:)

reference: ../src/core.c:2262

p4_marker_RT_ : ((MARKER))

runtime compiled by MARKER

reference: ../src/core.c:2252

p4_max_ : MAX ( a b -- c )

return the maximum of a and b

reference: ../src/core.c:1453

p4_min_ : MIN ( a b -- c )

return the minimum of a and b

reference: ../src/core.c:1463

p4_minus_ : - ( a b -- a-b )

return the difference of the two arguments

reference: ../src/core.c:0290

p4_mod_ : MOD ( a b -- c )

return the module of "a mod b"

reference: ../src/core.c:1473

p4_move_ : MOVE ( from to length -- )

memcpy an area

reference: ../src/core.c:1483

p4_negate_ : NEGATE ( value -- value' )

return the arithmetic negative of the (signed) cell
 simulate:   : NEGATE -1 * ;

reference: ../src/core.c:1493

p4_nip_ : NIP ( a b -- b )

drop the value under the top of stack, inverse of TUCK
 simulate:        : NIP SWAP DROP ;

reference: ../src/core.c:2271

p4_not_equals_

reference: ../src/core.c:2074

p4_of_ : OF .. ENDOF ( comp-value case-value -- comp-value )

compare the case-value placed lately with the comp-value being available since CASE - if they are equal run the following code-portion up to ENDOF after which the case-construct ends at the next ENDCASE

reference: ../src/core.c:2294

p4_of_execution_ : ((OF))

execution compiled by OF

reference: ../src/core.c:2280

p4_one_minus_ : 1- ( val -- val-1 )

return the value decremented by one
 simulate:
   : 1- 1 - ;

reference: ../src/core.c:0388

p4_one_plus_ : 1+ ( val -- val+1 )

return the value incremented by one
 simulate:
  : 1+ 1 + ;

reference: ../src/core.c:0378

p4_or_ : OR ( a b -- ab )

return the bitwise OR of a and b - unlike AND this is usually safe to use on logical values

reference: ../src/core.c:1502

p4_over_ : OVER ( a b -- a b a )

get the value from under the top of stack. The inverse operation would be TUCK

reference: ../src/core.c:1512

p4_pad_ : PAD ( -- addr )

transient buffer region

reference: ../src/core.c:2307

p4_paren_ : ( comment) ( -- )

eat everything up to the next closing paren - treat it as a comment.

reference: ../src/core.c:0177

p4_parse

reference: ../src/misc.c:1232

p4_parse_ : PARSE ( buffer-start buffer-count delim-char -- )

parse a piece of input (not much unlike WORD) and place it into the given buffer. The difference with word is also that WORD would first skip any delim-char while PARSE does not and thus may yield that one.

reference: ../src/core.c:2318

p4_pick_ : PICK ( n -- value )

pick the nth value from under the top of stack and push it note that
   0 PICK -> DUP         1 PICK -> OVER

reference: ../src/core.c:2346

p4_plus_ : + ( a b -- a+b )

return the sum of the two args

reference: ../src/core.c:0231

p4_plus_loop_ : +LOOP ( increment -- )

compile ((+LOOP)) which will use the increment as the loop-offset instead of just 1. See the DO and LOOP construct.

reference: ../src/core.c:0268

p4_plus_loop_execution_ : ((+LOOP)) ( increment -- )

compiled by +LOOP

reference: ../src/core.c:0251

p4_plus_store_ : +! ( val addr -- )

add val to the value found in addr
 simulate:
   : +! TUCK @ + SWAP ! ;

reference: ../src/core.c:0242

p4_postpone_ : POSTPONE word ( -- )

will compile the following word at the run-time of the current-word which is a compiling-word. The point is that POSTPONE takes care of the fact that word may be an IMMEDIATE-word that flags for a compiling word, so it must be executed (and not pushed directly) to compile sth. later. Choose this word in favour of COMPILE (for non-immediate words) and [COMPILE] (for immediate words)

reference: ../src/core.c:1536

p4_quit_ : QUIT ( -- ) no-return

this will throw and lead back to the outer-interpreter. traditionally, the outer-interpreter is called QUIT in forth itself where the first part of the QUIT-word had been to clean the stacks (and some other variables) and then turn to an endless loop containing QUERY and EVALUATE (otherwise known as INTERPRET ) - in pfe the primary cleanup is done through a longjmp due to the implicit THROW .

reference: ../src/core.c:1558

p4_quote_ : " string" ( -- bstring ) or sometimes ( -- string-ptr string-count )

This is the non-portable word which is why the ANSI-committee on forth has created two other word, namely S" and C" , since each implementation (and in pfe configurable) uses another result. FIG-forth did return bstring.

reference: ../src/core.c:2559

p4_r_fetch_ : R@ ( -- value )

fetch the (upper-most) value from the return-stack that had been saved there using >R - This is the traditional form of a local var space. If you need more local variables you should have a look at LOCALS| , see also >R and R> .

reference: ../src/core.c:1582

p4_r_from_ : R> ( -- value )

get back a value from the return-stack that had been saved there using >R . This is the traditional form of a local var space that could be accessed with R@ later. If you need more local variables you should have a look at LOCALS| which does grab some space from the return-stack too, but names them the way you like.

reference: ../src/core.c:1571

p4_r_shift_ : RSHIFT ( value shift-val -- value' )

does a bitwise logical right-shift on value (ie. the value is considered to be unsigned)

reference: ../src/core.c:1641

p4_recurse_ : RECURSE ( ? -- ? )

when creating a colon word the name of the currently-created word is smudged, so that you can redefine a previous word of the same name simply by using its name. Sometimes however one wants to recurse into the current definition instead of calling the older defintion. The RECURSE word does it exactly this.
   traditionally the following code had been in use:
   : GREAT-WORD [ UNSMUDGE ] DUP . 1- ?DUP IF GREAT-WORD THEN ;
   now use
   : GREAT-WORD DUP . 1- ?DUP IF RECURSE THEN ;

reference: ../src/core.c:1599

p4_refill

reference: ../src/unix.c:0894

p4_refill_ : REFILL ( -- flag )

try to get a new input line from the SOURCE and set >IN accordingly. Return a flag if sucessful, which is always true if the current input comes from a terminal and which is always false if the current input comes from EVALUATE - and may be either if the input comes from a file

reference: ../src/core.c:2359

p4_repeat_ : REPEAT ( -- )

ends an unconditional loop, see BEGIN

reference: ../src/core.c:1611

p4_restore_input_ : RESTORE-INPUT ( xn ... x1 -- )

inverse of SAVE-INPUT

reference: ../src/core.c:2367

p4_right_bracket_ : ] ( -- )

enter compiling mode - often used inside of a colon-definition to end a previous [ - you may find a , or LITERAL nearby in example texts.

reference: ../src/core.c:1949

p4_roll_ : ROLL ( xn xm ... x1 n -- xm ... x1 xn )

the extended form of ROT
    2 ROLL -> ROT

reference: ../src/core.c:2380

p4_rot_ : ROT ( a b c -- b c a )

rotates the three uppermost values on the stack, the other direction would be with -ROT - please have a look at LOCALS| and VAR that can avoid its use.

reference: ../src/core.c:1628

p4_s_m_slash_rem_ : ( a.a b -- c d )

see /MOD or FM/MOD or UM/MOD or SM/REM

reference: ../src/core.c:1718

p4_s_quote_ : S" string" ( -- string-address string-length)

if compiling then place the string into the currently compiled word and on execution the string pops up again as a double-cell value yielding the string's address and length. To be most portable this is the word to be best being used. Compare with C" and non-portable "

reference: ../src/core.c:1667

p4_s_to_d_ : S>D ( a -- a,a' )

signed extension of a single-cell value to a double-cell value

reference: ../src/core.c:1699

p4_save_input_ : SAVE-INPUT ( -- xn .. x1 )

fetch the current state of the input-channel which may be restored with RESTORE-INPUT later

reference: ../src/core.c:2394

p4_semicolon_ : ; ( -- )

compiles ((;)) which does EXIT the current colon-definition. It does then end compile-mode and returns to execute-mode. See : and :NONAME

reference: ../src/core.c:0523

p4_semicolon_execution_ : ((;)) ( -- )

compiled by ; and maybe ;AND -- it will perform an EXIT

reference: ../src/core.c:0513

p4_sh_ : # ( n.n -- n.n' )

see also HOLD for old-style forth-formatting words and PRINTF of the C-style formatting - this word divides the argument by BASE and add it to the picture space - it should be used inside of <# and #>

reference: ../src/core.c:0129

p4_sh_greater_ : #> ( n.n -- str-addr str-len )

see also HOLD for old-style forth-formatting words and PRINTF of the C-style formatting - this word drops the argument and returns the picture space buffer

reference: ../src/core.c:0140

p4_sh_s_ : #S ( n.n -- n.n ) f

see also HOLD for old-style forth-formatting words and PRINTF of the C-style formatting - this word does repeat the word # for a number of times, until the argument becomes zero. Hence the result is always null - it should be used inside of <# and #>

reference: ../src/core.c:0153

p4_sign_ : SIGN ( a -- )

put the sign of the value into the hold-space, this is the forth-style output formatting, see HOLD

reference: ../src/core.c:1709

p4_slash_ : / ( a b -- a/b )

return the quotient of the two arguments

reference: ../src/core.c:0337

p4_slash_mod_ : /MOD ( a b -- m n )

divide a and b and return both quotient n and remainder m

reference: ../src/core.c:0348

p4_source

reference: ../src/core.c:1739

p4_source_ : SOURCE ( -- buffer IN-offset )

the current point of interpret can be gotten through SOURCE. The buffer may flag out TIB or BLK or a FILE and IN gives you the offset therein. Traditionally, if the current SOURCE buffer is used up, REFILL is called that asks for another input-line or input-block. This scheme would have made it impossible to stretch an [IF] ... [THEN] over different blocks, unless [IF] does call REFILL

reference: ../src/core.c:1734

p4_space_ : SPACE ( -- )

print a single space to stdout, see SPACES
 simulate:    : SPACE  BL EMIT ;

reference: ../src/core.c:1749

p4_spaces

reference: ../src/misc.c:0215

p4_spaces_ : SPACES ( n -- )

print n space to stdout, actually a loop over n calling SPACE , but the implemenation may take advantage of printing chunks of spaces to speed up the operation.

reference: ../src/core.c:1759

p4_star_ : * ( a b -- a*b )

return the multiply of the two args

reference: ../src/core.c:0197

p4_star_slash_ : *\/ ( a b c -- a*b/c )

regard the b/c as element Q - this word has an advantage over the sequence of * and / by using an intermediate double-cell value

reference: ../src/core.c:0209

p4_star_slash_mod_ : *\/MOD ( a b c -- m n )

has an adavantage over the sequence of * and /MOD by using an intermediate double-cell value.

reference: ../src/core.c:0222

p4_store_ : ! ( val addr -- )

reference: ../src/core.c:0116

p4_swap_ : SWAP ( a b -- b a )

exchanges the value on top of the stack with the value beneath it

reference: ../src/core.c:1767

p4_then_ : THEN ( -- )

does resolve a branch coming from either IF or ELSE

reference: ../src/core.c:1778

p4_tick

reference: ../src/yours.c:0758

p4_tick_ : ' name ( -- xt )

return the execution token of the following name. This word is _not_ immediate and may not do what you expect in compile-mode. See ['] and '> - note that in FIG-forth the word of the same name had returned the PFA (not the CFA) and was immediate/smart, so beware when porting forth-code from FIG-forth to ANSI-forth.

reference: ../src/core.c:0168

p4_to_ : TO name ( value -- )

set the parameter field of name to the value, this is used to change the value of a VALUE and it can be also used to change the value of LOCALS|

reference: ../src/core.c:2413

p4_to_body_ : >BODY ( addr -- addr' )

adjust the execution-token (ie. the CFA) to point to the parameter field (ie. the PFA) of a word. this is implementation dependent and is usually either "1 CELLS +" or "2 CELLS +"

reference: ../src/core.c:0583

p4_to_execution_ : ((TO)) ( value -- )

execution compiled by TO

reference: ../src/core.c:2403

p4_to_number

reference: ../src/core.c:0595

p4_to_number_ : >NUMBER ( a,a str-adr str-len -- a,a' str-adr' str-len)

try to convert a string into a number, and place that number at a,a respeciting BASE

reference: ../src/core.c:0592

p4_to_r_ : >R ( value -- )

save the value onto the return stack. The return stack must be returned back to clean state before an exit and you should note that the return-stack is also touched by the DO ... WHILE loop. Use R> to clean the stack and R@ to get the last value put by >R

reference: ../src/core.c:0610

p4_tuck_ : TUCK ( a b -- b a b )

shove the top-value under the value beneath. See OVER and NIP
 simulate:    : TUCK  SWAP OVER ;

reference: ../src/core.c:2450

p4_two_drop_ : 2DROP ( a b -- )

double-cell drop, also used to drop two items

reference: ../src/core.c:0437

p4_two_dup_ : 2DUP ( a,a -- a,a a,a )

double-cell duplication, also used to duplicate two items
 simulate:
   : 2DUP OVER OVER ; ( wrong would be : 2DUP DUP DUP ; !!) 

reference: ../src/core.c:0448

p4_two_fetch_ : 2@ ( addr -- a,a )

double-cell fetch

reference: ../src/core.c:0427

p4_two_over_ : 2OVER ( a,a b,b -- a,a b,b a,a )

double-cell over, see OVER and 2DUP
 simulate:
   : 2OVER SP@ 2 CELLS + 2@ ;

reference: ../src/core.c:0460

p4_two_r_fetch_ : 2R@ ( -- a,a )

fetch a double-cell value from the return-stack, that had been previously been put there with 2>R - see R@

reference: ../src/core.c:2047

p4_two_r_from_ : 2R> ( -- a,a )

pop back a double-cell value from the return-stack, see R> and the earlier used 2>R

reference: ../src/core.c:2036

p4_two_slash_ : 2/ ( a -- a/2 )

divides the value by two - but it does actually use a shift1 to be faster
 simulate:
  : 2/ 2 / ; ( canonic) : 2/ 1 RSHIFT ; ( usual)

reference: ../src/core.c:0419

p4_two_star_ : 2* ( a -- a*2 )

multiplies the value with two - but it does actually use a shift1 to be faster
 simulate:
  : 2* 2 * ; ( canonic) : 2* 1 LSHIFT ; ( usual)

reference: ../src/core.c:0408

p4_two_store_ : 2! ( a,a addr -- )

double-cell store

reference: ../src/core.c:0396

p4_two_swap_ : 2SWAP ( a,a b,b -- b,b a,a )

double-cell swap, see SWAP and 2DUP
 simulate:
   : 2SWAP LOCALS| B1 B2 A1 A2 | B2 B1 A2 A1 ;

reference: ../src/core.c:0472

p4_two_to_r_ : 2>R ( a,a -- )

save a double-cell value onto the return-stack, see >R

reference: ../src/core.c:2025

p4_type

reference: ../src/p4ed.c:0250

p4_type_ : TYPE ( string-pointer string-length -- )

prints the string-buffer to stdout, see COUNT and EMIT

reference: ../src/core.c:1789

p4_u_dot_ : U. ( value )

print unsigned number to stdout

reference: ../src/core.c:1797

p4_u_dot_r_ : U.R ( value prec -- )

print right-aligned in a prec-field, treat value to be unsigned as opposed to .R

reference: ../src/core.c:2462

p4_u_greater_than_ : U> ( a b -- ab )

unsigned comparison of a and b, see >

reference: ../src/core.c:2472

p4_u_less_than_ : U< ( a b -- cond )

unsigned comparison, see <

reference: ../src/core.c:1806

p4_u_m_slash_mod_ : UM/MOD ( a b -- c,c )

see /MOD and SM/REM

reference: ../src/core.c:1823

p4_u_m_star_ : UM* ( a b -- c,c )

unsigned multiply returning double-cell value

reference: ../src/core.c:1815

p4_unloop_ : UNLOOP ( -- )

drop the DO .. LOOP runtime variables from the return-stack, usually used just in before an EXIT call. Using this multiple times can unnest multiple nested loops.

reference: ../src/core.c:1835

p4_until_ : UNTIL ( cond -- )

ends an control-loop, see BEGIN and compare with WHILE

reference: ../src/core.c:1843

p4_unused_ : UNUSED ( -- val )

return the number of cells that are left to be used above HERE

reference: ../src/core.c:2482

p4_value_ : VALUE name ( value -- )

CREATE a word and initialize it with value. Using it later will push the value back onto the stack. Compare with VARIABLE and CONSTANT - look also for LOCALS| and VAR

reference: ../src/core.c:2501

p4_value_RT_ : ((VALUE)) ( -- value )

runtime compiled by VALUE

reference: ../src/core.c:2490

p4_variable_ : VARIABLE name ( -- )

CREATE a new variable, so that everytime the variable is name, the address is returned for using with @ and ! - be aware that in FIG-forth VARIABLE did take an argument being the initial value. ANSI-forth does different here.

reference: ../src/core.c:1858

p4_while_ : WHILE ( cond -- )

middle part of a BEGIN .. WHILE .. REPEAT control-loop - if cond is true the code-piece up to REPEAT is executed which will then jump back to BEGIN - and if the cond is null then WHILE will branch to right after the REPEAT (compare with UNTIL that forms a BEGIN .. UNTIL loop)

reference: ../src/core.c:1872

p4_within_ : WITHIN ( a b c -- cond )

a widely used word, returns ( b <= a && a < c ) so that is very useful to check an index a of an array to be within range b to c

reference: ../src/core.c:2512

p4_word_ : WORD ( delimiter-char -- )

read the next SOURCE section (thereby moving >IN ) up to the point reaching $delimiter-char - the text is placed at HERE - where you will find a counted string. You may want to use PARSE instead.

reference: ../src/core.c:1889

p4_xor_ : XOR ( a b -- ab )

return the bitwise-or of the two arguments - it may be unsafe use it on logical values. beware.

reference: ../src/core.c:1898

p4_zero_equal_ : 0= ( val -- cond )

return a flag that is true if val is just zero
 simulate:
  : 0= 0 = ;

reference: ../src/core.c:0368

p4_zero_greater_ : 0> ( value -- cond )

return value greater than zero
 simulate:    : 0> 0 > ;

reference: ../src/core.c:2017

p4_zero_less_ : 0< ( val -- cond )

return a flag that is true if val is lower than zero
 simulate:
  : 0< 0 < ;

reference: ../src/core.c:0358

p4_zero_not_equals_ : 0<> ( value -- cond )

returns a logical-value saying if the value was not-zero. This is most useful in turning a numerical value into a boolean value that can be fed into bitwise words like AND and XOR - a simple IF or WHILE doesn't need it actually.

reference: ../src/core.c:2008

p4_alloc_parse_openstring

reference: ../src/core.c:2141

p4_parse_openstring_into :

   these two can replace old p4th's F_(alloc_parsed_string) 
   in words like  S" and C"; It still needs some polish.
   E.g. There are no controls or Byte-definitions in here.
   The words S" and C" don't decompile correctly, since 
   debug doesn't know about this routine yet,
   /and/ it works only in compilation mode so far
   (a lot to do though)

reference: ../src/core.c:0054