# pfe Function List

0.33.71
0.33.71 pfe
_p4_access 3
_p4_access use as _P4_access, a #define from _missing.h

    #include <pfe/_missing.h>

int _p4_access(const char *fn, int how)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2000. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
_p4_rename 3
_p4_rename ...

    #include <pfe/_missing.h>

int _p4_rename(const char *source, const char *target)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2000. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_asm_create_code 3
p4_asm_create_code CODE ( "name" -- )

    #include <pfe/assembler-ext.h>

FCode p4_asm_create_code ---

### Description

call `ALSO` and add ASSEMBLER wordlist if available. Add PROC ENTER assembler snippet as needed for the architecture into the PFA. The CFA is setup (a) with the PFA adress in traditional ITC or (b) with an infoblock as for sbr-coded colon words.

Remember that not all architectures are support and that the ASSEMBLER wordset is not compiled into pfe by default. Use always the corresponding `END-CODE` for each `CODE` start. The new word name is not smudged.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_asm_end_code 3
p4_asm_end_code END-CODE ( "name" -- )

    #include <pfe/assembler-ext.h>

FCode p4_asm_end_code ---

### Description

call `PREVIOUS` and add PROC LEAVE assembler snippet as needed for the architecture - usually includes bits to "return from subroutine". Remember that not all architectures are support and PFE usually does only do variants of call-threading with a separate loop for the inner interpreter that does "call into subroutine". Some forth implementations do "jump into routine" and the PROC LEAVE part would do "jump to next routine" also known as next-threading. The sbr-call-threading is usually similar to the native subroutine-coding of the host operating system. See `CODE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_block 3
p4_block BLOCK ( block-u -- block-addr ) [ANS]

    #include <pfe/block-ext.h>

FCode p4_block ---

### Description

load the specified block into a block buffer and return the address of that block buffer - see also `BUFFER`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_buffer 3
p4_buffer BUFFER ( block-u -- block-addr ) [ANS]

    #include <pfe/block-ext.h>

FCode p4_buffer ---

### Description

get the block buffer address for the specified block - if it had not been loaded already it is not filled with data from the disk unlike `BLOCK` does.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_save_buffers 3
p4_save_buffers SAVE-BUFFERS ( -- ) [ANS]

    #include <pfe/block-ext.h>

FCode p4_save_buffers ---

### Description

write all modified buffer to the disk, see `UPDATE` and `FLUSH`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_empty_buffers 3
p4_empty_buffers EMPTY-BUFFERS ( -- ) [ANS]

    #include <pfe/block-ext.h>

FCode p4_empty_buffers ---

### Description

unassign all block buffers, does not even `UPDATE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_flush 3
p4_flush FLUSH ( -- ) [ANS]

    #include <pfe/block-ext.h>

FCode p4_flush ---

### Description

call `SAVE-BUFFERS` and then unassign all block buffers with `EMPTY-BUFFERS`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_list 3
p4_list LIST ( block-u -- ) [ANS]

    #include <pfe/block-ext.h>

FCode p4_list ---

### Description

display the block

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_load 3
p4_load LOAD ( block-u -- ?? ) [FORTH]

    #include <pfe/block-ext.h>

FCode p4_load ---

### Description

`INTERPRET` the specified `BLOCK`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_thru 3
p4_thru THRU ( block1-u block2-u -- ) [ANS]

    #include <pfe/block-ext.h>

FCode p4_thru ---

### Description

`LOAD` a number of block in sequence.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_update 3
p4_update UPDATE ( -- ) [ANS]

    #include <pfe/block-ext.h>

FCode p4_update ---

### Description

mark the current block buffer as modified, see `FLUSH`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
P4_LISTWORDS 3
P4_LISTWORDS

    #include <pfe/block-ext.h>

P4_LISTWORDS(block) =

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_close_blockfile 3
p4_close_blockfile CLOSE-BLOCKFILE ( -- ) [FTH] w32for

    #include <pfe/block-mix.h>

FCode p4_close_blockfile ---

### Description

w32for-implementation:

      blockhandle -1 &lt;&gt; if flush close-file drop then
      -1 set-blockfile

in pfe:

      : CLOSE-BLOCKFILE
        BLOCK-FILE ?DUP IF FLUSH CLOSE-FILE DROP THEN
        OFF&gt; BLOCK-FILE ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_open_blockfile 3
p4_open_blockfile OPEN-BLOCKFILE ( "filename" -- ) [FTH] w32for

    #include <pfe/block-mix.h>

FCode p4_open_blockfile ---

### Description

w32for-implementation:

        close-blockfile
        parse-word r/w open-file abort" failed to open block-file"
        set-blockfile
        empty-buffers

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_create_blockfile 3
p4_create_blockfile CREATE-BLOCKFILE ( blocks-count "filename" -- ) [FTH] w32for

    #include <pfe/block-mix.h>

FCode p4_create_blockfile ---

### Description

w32for-implementation:

        close-blockfile
        parse-word r/w create-file abort" failed to create block-file"
        set-blockfile
        dup b/buf m* blockhandle resize-file
        abort" unable to create a file of that size"
        empty-buffers
        0 do i wipe loop
        flush

pfe does not wipe the buffers

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_zero_create_blockfile 3
p4_zero_create_blockfile USING-NEW ( "filename" -- ) [EXT] [obsolete]

    #include <pfe/block-mix.h>

FCode p4_zero_create_blockfile ---

### Description

like `USING` but can create the file OBSOLETE word, use `CREATE-BLOCKFILE`

      : USING-NEW 0 CREATE-BLOCKFILE ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_set_blockfile 3
p4_set_blockfile SET-BLOCKFILE ( block-file* -- ) [EXT] win32for

    #include <pfe/block-mix.h>

FCodep4_set_blockfile ---

### Description

win32forth uses a system-filedescriptor where -1 means unused in the BLOCKHANDLE, but we use a "FILE*"-like structure, so NULL means NOT-IN-USE. Here we set it.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_access 3
p4_file_access ...

    #include <pfe/block-sub.h>

_export int p4_file_access(const p4_char_t *fn, int len)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_open_file 3
p4_open_file ...

    #include <pfe/block-sub.h>

_export p4_File * p4_open_file(const p4_char_t *name, int len, int mode)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_create_file 3
p4_create_file ...

    #include <pfe/block-sub.h>

_export p4_File * p4_create_file(const p4_char_t *name, int len, int mode)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_close_file 3
p4_close_file ...

    #include <pfe/block-sub.h>

_export int p4_close_file(p4_File *fid)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_reposition_file 3
p4_reposition_file ...

    #include <pfe/block-sub.h>

_export int p4_reposition_file(p4_File *fid, _p4_off_t pos)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_read_file 3
p4_read_file ...

    #include <pfe/block-sub.h>

_export int p4_read_file(void *p, p4ucell *n, p4_File *fid)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_write_file 3
p4_write_file ...

    #include <pfe/block-sub.h>

_export int p4_write_file(void *p, p4ucell n, p4_File *fid)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_resize_file 3
p4_resize_file ...

    #include <pfe/block-sub.h>

_export int p4_resize_file(p4_File *fid, _p4_off_t size)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_read_line 3
p4_read_line ...

    #include <pfe/block-sub.h>

_export int p4_read_line(void* buf, p4ucell *u, p4_File *fid, p4cell *ior)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_read_write 3
p4_read_write ...

    #include <pfe/block-sub.h>

_export void p4_read_write(p4_File *fid, void *p, p4ucell n, int readflag)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_load_file 3
p4_load_file ...

    #include <pfe/block-sub.h>

_export void p4_load_file(const p4_char_t *fn, int cnt, int blk)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sh_else 3
p4_sh_else #ELSE ( -- ) [FTH]

    #include <pfe/cdecl-ext.h>

FCode p4_sh_else ---

### Description

The implementation of #ELSE is done in C for speed and being less error prone. Better use the ANSI-compatible `[IF]` `[ELSE]` `[THEN]` construct.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sh_endif 3
p4_sh_endif #ENDIF ( -- ) [FTH]

    #include <pfe/cdecl-ext.h>

FCodep4_sh_endif ---

### Description

end of `#IF` `#IFDEF` `#IFNOTDEF` and `#ELSE` contructs

        (a dummy word that does actually nothing, but #ELSE may look for it)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sh_if 3
p4_sh_if #IF ( -- C: state-save-flag mfth-if-magic S: ) [FTH]

    #include <pfe/cdecl-ext.h>

FCode p4_sh_if ---

### Description

prepares for a following `#IS_TRUE` or `#IS_FALSE`, does basically switch off compile-mode for the enclosed code. better use the ANSI style `[IF]` `[ELSE]` `[THEN]` construct.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sh_is_true 3
p4_sh_is_true #IS_TRUE ( C: state-save-flag mfth-if-magic S: test-flag -- ) [FTH]

    #include <pfe/cdecl-ext.h>

FCode p4_sh_is_true ---

### Description

checks the condition on the `CS-STACK`. Pairs with `#IF` better use the ANSI style `[IF]` `[ELSE]` `[THEN]` construct.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sh_is_false 3
p4_sh_is_false #IS_FALSE ( C: state-save-flag mfth-if-magic S: test-flag -- ) [FTH]

    #include <pfe/cdecl-ext.h>

FCode p4_sh_is_false ---

### Description

checks the condition on the `CS-STACK`. Pairs with `#IF` better use the ANSI style `[IF]` `[ELSE]` `[THEN]` construct.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sh_ifdef 3
p4_sh_ifdef #IFDEF ( "word" -- ) [FTH]

    #include <pfe/cdecl-ext.h>

FCode p4_sh_ifdef ---

### Description

better use `[DEFINED] word [IF]` - the word `[IF]` is ANSI-conform.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sh_ifnotdef 3
p4_sh_ifnotdef #IFNOTDEF ( "word" -- ) [FTH]

    #include <pfe/cdecl-ext.h>

FCode p4_sh_ifnotdef ---

### Description

better use `[DEFINED] word [NOT] [IF]` - the word `[IF]` and `[ELSE]` are ANSI-conform, while `#IFDEF` `#ELSE` are not.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_backslash 3
p4_backslash // ( [...<cr;>] -- ) [FTH]

    #include <pfe/cdecl-ext.h>

extern FCodep4_backslash ---

### Description

a line-comment

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sh_define 3
p4_sh_define #define ( "name" "value" -- ) [FTH]

    #include <pfe/cdecl-ext.h>

FCode p4_sh_define ---

### Description

create an alias, will actually make a `DEFER`ed word, and it has the magic to handle number-arguments

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sh_pragma 3
p4_sh_pragma #pragma ( "word" "evaluate<cr;>" -- ) [FTH]

    #include <pfe/cdecl-ext.h>

FCode p4_sh_pragma ---

### Description

pass the word to `ENVIRONMENT`? If the word does *not* exist, the rest of the line is parsed away with `//` - therefore, if the executed word does not consume the line itself, the rest of the line is still executed. examples:

      #pragma warnings on // if warnings is a variable, ON can set it
      #pragma stack-cells 50 &lt; [if] .( not enough stackcells ) [then]
      #pragma simply anything else you like to have in environment or not

implementation:

      : #pragma ?exec
        bl word count environment? if exit then ( interpret the rest of the line )
        [compile] \               ( parse away the rest of the line as a comment )
      ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_link_comma 3
p4_link_comma link, ( some-list* -- ) [EXT]

    #include <pfe/chain-ext.h>

FCode p4_link_comma ---

### Description

      : link,        here over @ a, swap ! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_new_chain 3
p4_new_chain new-chain ( "name" -- ) [EXT] [DOES: -- new-chain* ]

    #include <pfe/chain-ext.h>

FCode p4_new_chain ---

### Description

create a new chain and register in chain-link

      : new-chain create: 0 , ['] noop , chain-link link, ;

layout of a chain: /cell field ->chain.link /cell field ->chain.exec /cell field ->chain.next

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dot_chain 3
p4_dot_chain .chain ( some-chain* -- ) [EXT]

    #include <pfe/chain-ext.h>

FCode p4_dot_chain ---

### Description

show chain - compare with `WORDS`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dot_chains 3
p4_dot_chains .chains ( -- ) [EXT]

    #include <pfe/chain-ext.h>

FCode p4_dot_chains ---

### Description

show all chains registered in the system - compare with `VLIST`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_do_chain 3
p4_do_chain do-chain ( some-chain* -- ) [EXT]

    #include <pfe/chain-ext.h>

FCode p4_do_chain ---

### Description

execute chain

      : do-chain being @ ?dup while dup&gt;r cell+ @execute r&gt; repeat ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_chain_add_before 3
p4_chain_add_before chain-add-before ( some-chain* "word-to-add" -- ) [EXT]

    #include <pfe/chain-ext.h>

FCode p4_chain_add_before ---

### Description

add chain item, for reverse chain like BYE

      : chain-add-before ' &gt;r here over @ , r&gt; , swap ! ;
      ( chain-add-before link, ' , )

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_chain_add 3
p4_chain_add chain-add ( some-chain* "word-to-add" -- ) [EXT]

    #include <pfe/chain-ext.h>

FCode p4_chain_add ---

### Description

add chain item, for normal setup, at end of do-chain

      : chain-add ' &gt;r begin dup @ while @ repeat here swap ! 0 , r&gt; , ;
      ( chain-add begin dup @ while @ repeat  here swap ! 0, ' , )

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_new_wordlist 3
p4_new_wordlist create a single-threaded wordlist - compare with p4_make_wordlist

    #include <pfe/pfe-base.h>

_export p4_Wordl* p4_new_wordlist(p4char* nfa)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_dot_words 3
p4_dot_words .WORDS ( some-wordlist* -- ) [EXT]

    #include <pfe/pfe-base.h>

FCode p4_dot_words ---

### Description

print the `WORDLIST` interactivly to the user

      : .WORDS ALSO SET-CONTEXT WORDS PREVIOUS ;

`WORDS` / `ORDER` / `NEW-WORDLIST` / `DO-ALL-WORDS`

0.33.71
0.33.71 pfe
p4_do_all_words 3
p4_do_all_words DO-ALL-WORDS ( some-wordlist* -- ) [EXT]

    #include <pfe/pfe-base.h>

FCode p4_do_all_words ---

### Description

`EXECUTE` each entry in the wordlist in the reverse order defined

      : DO-ALL-WORDS
           0 FIRST-NAME
           BEGIN ?DUP WHILE
              DUP NAME&gt; EXECUTE
              NAME-NEXT
           REPEAT
      ;

to run the `NEW-WORDLIST` in original order, use `REDO-ALL-WORDS`

0.33.71
0.33.71 pfe
p4_redo_all_words 3
p4_redo_all_words REDO-ALL-WORDS ( some-wordlist* -- ) [EXT]

    #include <pfe/pfe-base.h>

FCode p4_redo_all_words ---

### Description

`EXECUTE` each entry in the wordlist in the original order defined

      : REDO-ALL-WORDS
           0 FIRST-NAME
           0 SWAP ( under )
           BEGIN ?DUP WHILE
              DUP NAME&gt; SWAP ( under )
              NAME-NEXT
           REPEAT
           BEGIN ?DUP WHILE
              EXECUTE
           REPEAT
      ;

to run the `NEW-WORDLIST` in last-run-first order, use `DO-ALL-WORDS`

0.33.71
0.33.71 pfe
p4_do_all_words_while_loop 3
p4_do_all_words_while_loop DO-ALL-WORDS-WHILE-LOOP ( some-wordlist* test-xt* -- ) [EXT]

    #include <pfe/pfe-base.h>

FCode p4_do_all_words_while_loop ---

### Description

`EXECUTE` each entry in the wordlist in the reverse order defined but only as long as after EXECUTE of "word" a TRUE flag is left on the stack. The wordlist execution is cut when a FALSE flag is seen. (the current wordlist entry is _not_ on the stack!)

      : DO-ALL-WORDS-WHILE-LOOP &gt;R
           0 FIRST-NAME
           BEGIN ?DUP WHILE
              R@ EXECUTE 0= IF R&gt;DROP DROP EXIT THEN
              DUP NAME&gt; EXECUTE
              NAME-NEXT
           REPEAT R&gt;DROP
      ;

compare with `DO-ALL-WORDS-WHILE`

0.33.71
0.33.71 pfe
p4_do_all_words_while 3
p4_do_all_words_while DO-ALL-WORDS-WHILE ( some-wordlist* "word" -- ) [EXT]

    #include <pfe/pfe-base.h>

FCode p4_do_all_words_while ---

### Description

`EXECUTE` each entry in the wordlist in the reverse order defined but only as long as after EXECUTE of "word" a TRUE flag is left on the stack. The wordlist execution is cut when a FALSE flag is seen. (the current wordlist entry is _not_ on the stack!)

      : DO-ALL-WORDS-WHILE '
           STATE @ IF LITERAL, COMPILE DO-ALL-WORDS-WHILE-LOOP EXIT THEN
           &gt;R 0 FIRST-NAME
           BEGIN ?DUP WHILE
              R@ EXECUTE 0= IF R&gt;DROP DROP EXIT THEN
              DUP NAME&gt; EXECUTE
              NAME-NEXT
           REPEAT R&gt;DROP
      ;

to run the `NEW-WORDLIST` in original order, use `REDO-ALL-WORDS`

0.33.71
0.33.71 pfe
p4_do_synonym 3
p4_do_synonym DO-SYNONYM ( some-wordlist* "do-name" "orig-name" -- ) [EXT]

    #include <pfe/pfe-base.h>

FCode p4_do_synonym ---

### Description

create a `SYNONYM` in the specified wordlist.

      : DO-SYNONYM GET-CURRENT SWAP SET-CURRENT SYNONYM SET-CURRENT ;

`DO-ALIAS` / `DO-ALL-WORDS` / `NEW-WORDLIST` / `WORDLIST` / `ORDER`

0.33.71
0.33.71 pfe
p4_alias_atexit 3
p4_alias_atexit ALIAS-ATEXIT ( some-xt* "name" -- ) [EXT]

    #include <pfe/pfe-base.h>

FCode p4_alias_atexit ---

### Description

create a defer word that is initialized with the given x-token.

      : ALIAS-ATEXIT ATEXIT-WORDLIST DO-ALIAS ;

`ATEXIT-WORDLIST` `DO-ALL-WORDS`

0.33.71
0.33.71 pfe
p4_do_alias 3
p4_do_alias DO-ALIAS ( some-xt* definition-wordlist* "do-name" -- ) [EXT]

    #include <pfe/pfe-base.h>

FCode p4_do_alias ---

### Description

create an `ALIAS` with the exec-token in the specified wordlist

      : DO-ALIAS GET-CURRENT SWAP SET-CURRENT SWAP ALIAS SET-CURRENT ;

`DO-SYNONYM`

0.33.71
0.33.71 pfe
p4_z_fetch 3
p4_z_fetch Z@ ( addr -- f: z )

    #include <pfe/option-ext.h>

FCode p4_z_fetch ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_store 3
p4_z_store Z! ( addr f: z -- )

    #include <pfe/option-ext.h>

FCode p4_z_store ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_x_fetch 3
p4_x_fetch X@ ( zaddr -- f: x )

    #include <pfe/option-ext.h>

FCode p4_x_fetch ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_x_store 3
p4_x_store X! ( zaddr f: x -- )

    #include <pfe/option-ext.h>

FCode p4_x_store ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_y_fetch 3
p4_y_fetch Y@ ( zaddr -- f: y )

    #include <pfe/option-ext.h>

FCode p4_y_fetch ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_y_store 3
p4_y_store Y! ( zaddr f: x -- )

    #include <pfe/option-ext.h>

FCode p4_y_store ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_dot 3
p4_z_dot Z. (f: z -- )

    #include <pfe/option-ext.h>

FCode p4_z_dot ---

### Description

Emit the complex number, including the sign of zero when `signbit()` is available.

0.33.71
0.33.71 pfe
p4_z_s_dot 3
p4_z_s_dot ZS. (f: z -- )

    #include <pfe/option-ext.h>

FCode p4_z_s_dot ---

### Description

Emit the complex number in scientific notation, including the sign of zero when `signbit()` is available.

0.33.71
0.33.71 pfe
p4_real 3
p4_real REAL (f: x y -- x )

    #include <pfe/option-ext.h>

FCode p4_real ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_imag 3
p4_imag IMAG (f: x y -- y )

    #include <pfe/option-ext.h>

FCode p4_imag ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_conjg 3
p4_conjg CONJG (f: x y -- x -y )

    #include <pfe/option-ext.h>

FCode p4_conjg ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_drop 3
p4_z_drop ZDROP (f: z -- )

    #include <pfe/option-ext.h>

FCode p4_z_drop ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_dup 3
p4_z_dup ZDUP (f: z -- z z )

    #include <pfe/option-ext.h>

FCode p4_z_dup ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_swap 3
p4_z_swap ZSWAP (f: z1 z2 -- z2 z1 )

    #include <pfe/option-ext.h>

FCode p4_z_swap ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_over 3
p4_z_over ZOVER (f: z1 z2 -- z1 z2 z1 )

    #include <pfe/option-ext.h>

FCode p4_z_over ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_nip 3
p4_z_nip ZNIP (f: z1 z2 -- z2 )

    #include <pfe/option-ext.h>

FCode p4_z_nip ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_tuck 3
p4_z_tuck ZTUCK (f: z1 z2 -- z2 z1 z2 )

    #include <pfe/option-ext.h>

FCode p4_z_tuck ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_rot 3
p4_z_rot ZROT (f: z1 z2 z3 -- z2 z3 z1 )

    #include <pfe/option-ext.h>

FCode p4_z_rot ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_minus_z_rot 3
p4_minus_z_rot -ZROT (f: z1 z2 z3 -- z3 z1 z2 )

    #include <pfe/option-ext.h>

FCode p4_minus_z_rot ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_plus 3
p4_z_plus Z+ (f: z1 z2 -- z1+z2 )

    #include <pfe/option-ext.h>

FCode p4_z_plus ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_minus 3
p4_z_minus Z- (f: z1 z2 -- z1-z2 )

    #include <pfe/option-ext.h>

FCode p4_z_minus ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_star 3
p4_z_star Z* (f: x y u v -- x*u-y*v x*v+y*u )

    #include <pfe/option-ext.h>

FCode p4_z_star ---

### Description

Uses the algorithm followed by JVN: (x+iy)*(u+iv) = [(x+y)*u - y*(u+v)] + i[(x+y)*u + x*(v-u)] Requires 3 multiplications and 5 additions.

0.33.71
0.33.71 pfe
p4_z_slash 3
p4_z_slash Z/ (f: u+iv z -- u/z+iv/z )

    #include <pfe/option-ext.h>

FCode p4_z_slash ---

### Description

Kahan-like algorithm *without* due attention to spurious over/underflows and zeros and infinities.

0.33.71
0.33.71 pfe
p4_z_negate 3
p4_z_negate ZNEGATE (f: z -- -z )

    #include <pfe/option-ext.h>

FCode p4_z_negate ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_two_star 3
p4_z_two_star Z2* (f: z -- z*2 )

    #include <pfe/option-ext.h>

FCode p4_z_two_star ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_two_slash 3
p4_z_two_slash Z2/ (f: z -- z/2 )

    #include <pfe/option-ext.h>

FCode p4_z_two_slash ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_i_star 3
p4_i_star I* (f: x y -- -y x )

    #include <pfe/option-ext.h>

FCode p4_i_star ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_minus_i_star 3
p4_minus_i_star -I* (f: x y -- y -x )

    #include <pfe/option-ext.h>

FCode p4_minus_i_star ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_one_slash_z 3
p4_one_slash_z 1/Z (f: z -- 1/z )

    #include <pfe/option-ext.h>

FCode p4_one_slash_z ---

### Description

Kahan algorithm *without* due attention to spurious over/underflows and zeros and infinities.

0.33.71
0.33.71 pfe
p4_z_hat_two 3
p4_z_hat_two Z^2 (f: z -- z^2 )

    #include <pfe/option-ext.h>

FCode p4_z_hat_two ---

### Description

Kahan algorithm without removal of any spurious NaN created by overflow. It deliberately uses (x-y)(x+y) instead of x^2-y^2 for the real part.

0.33.71
0.33.71 pfe
p4_z_abs_hat_two 3
p4_z_abs_hat_two |Z|^2 (f: x y -- |z|^2 )

    #include <pfe/option-ext.h>

FCode p4_z_abs_hat_two ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_hat_n 3
p4_z_hat_n Z^N ( n f: z -- z^n )

    #include <pfe/option-ext.h>

FCode p4_z_hat_n ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_x_plus 3
p4_x_plus X+ (f: z a -- x+a y )

    #include <pfe/option-ext.h>

FCode p4_x_plus ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_x_minus 3
p4_x_minus X- (f: z a -- x-a y )

    #include <pfe/option-ext.h>

FCode p4_x_minus ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_y_plus 3
p4_y_plus Y+ (f: z a -- x y+a )

    #include <pfe/option-ext.h>

FCode p4_y_plus ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_y_minus 3
p4_y_minus Y- (f: z a -- x y-a )

    #include <pfe/option-ext.h>

FCode p4_y_minus ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_star_f 3
p4_z_star_f Z*F (f: x y f -- x*f y*f )

    #include <pfe/option-ext.h>

FCode p4_z_star_f ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_slash_f 3
p4_z_slash_f Z/F (f: x y f -- x/f y/f )

    #include <pfe/option-ext.h>

FCode p4_z_slash_f ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_f_star_z 3
p4_f_star_z F*Z (f: f x y -- f*x f*y )

    #include <pfe/option-ext.h>

FCode p4_f_star_z ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_f_slash_z 3
p4_f_slash_z F/Z (f: f z -- f/z )

    #include <pfe/option-ext.h>

FCode p4_f_slash_z ---

### Description

Kahan algorithm *without* due attention to spurious over/underflows and zeros and infinities.

0.33.71
0.33.71 pfe
p4_z_star_i_star_f 3
p4_z_star_i_star_f Z*I*F (f: z f -- z*if )

    #include <pfe/option-ext.h>

FCode p4_z_star_i_star_f ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_minus_i_star_z_slash_f 3
p4_minus_i_star_z_slash_f -I*Z/F (f: z f -- z/[if] )

    #include <pfe/option-ext.h>

FCode p4_minus_i_star_z_slash_f ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_i_star_f_star_z 3
p4_i_star_f_star_z I*F*Z (f: f z -- if*z )

    #include <pfe/option-ext.h>

FCode p4_i_star_f_star_z ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_i_star_f_slash_z 3
p4_i_star_f_slash_z I*F/Z (f: f z -- [0+if]/z )

    #include <pfe/option-ext.h>

FCode p4_i_star_f_slash_z ---

### Description

Kahan algorithm *without* due attention to spurious over/underflows and zeros and infinities.

0.33.71
0.33.71 pfe
p4_z_star_to_real 3
p4_z_star_to_real Z*>REAL (f: z1 z2 -- Re[z1*z2] )

    #include <pfe/option-ext.h>

FCode p4_z_star_to_real ---

### Description

Compute the real part of the complex product without computing the imaginary part. Recommended by Kahan to avoid gratuitous overflow or underflow signals from the unnecessary part.

0.33.71
0.33.71 pfe
p4_z_star_to_imag 3
p4_z_star_to_imag Z*>IMAG (f: z1 z2 -- Im[z1*z2] )

    #include <pfe/option-ext.h>

FCode p4_z_star_to_imag ---

### Description

Compute the imaginary part of the complex product without computing the real part.

0.33.71
0.33.71 pfe
p4_z_abs 3
p4_z_abs |Z| (f: x y -- |z| )

    #include <pfe/option-ext.h>

FCode p4_z_abs ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_box 3
p4_z_box ZBOX (f: z -- box[z] )

    #include <pfe/option-ext.h>

FCode p4_z_box ---

### Description

Defined *only* for zero and infinite arguments. This difffers from Kahan's `CBOX` [p. 198] by conserving signs when only one of x or y is infinite, consistent with the other cases, and with its use in his `ARG` [p. 199].

0.33.71
0.33.71 pfe
p4_arg 3
p4_arg ARG (f: z -- principal.arg[z] )

    #include <pfe/option-ext.h>

FCode p4_arg ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_to_polar 3
p4_to_polar >POLAR (f: x y -- r theta )

    #include <pfe/option-ext.h>

FCode p4_to_polar ---

### Description

Convert the complex number z to its polar representation, where theta is the principal argument.

0.33.71
0.33.71 pfe
p4_polar_from 3
p4_polar_from POLAR> (f: r theta -- x y )

    #include <pfe/option-ext.h>

FCode p4_polar_from ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_ssqs 3
p4_z_ssqs ZSSQS (f: z -- rho s: k )

    #include <pfe/option-ext.h>

FCode p4_z_ssqs ---

### Description

Compute rho = |(x+iy)/2^k|^2, scaled to avoid overflow or underflow, and leave the scaling integer k. Kahan, p. 200.

0.33.71
0.33.71 pfe
p4_z_sqrt 3
p4_z_sqrt ZSQRT (f: z -- sqrt[z] )

    #include <pfe/option-ext.h>

FCode p4_z_sqrt ---

### Description

Compute the principal branch of the square root, with Re sqrt[z] >= 0. Kahan, p. 201.

0.33.71
0.33.71 pfe
p4_z_ln 3
p4_z_ln ZLN (f: z -- ln|z|+i*theta )

    #include <pfe/option-ext.h>

FCode p4_z_ln ---

### Description

Compute the principal branch of the complex natural logarithm. The angle theta is the principal argument. This code uses Kahan's algorithm for the scaled logarithm `CLOGS(z,J)` = ln(z*2^J), with J=0 and blind choices of the threshholds T0, T1, and T2. Namely, T0 = 1/sqrt(2), T1 = 5/4, and T2 = 3;

0.33.71
0.33.71 pfe
p4_z_exp 3
p4_z_exp ZEXP (f: z -- exp[z] )

    #include <pfe/option-ext.h>

FCode p4_z_exp ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_hat 3
p4_z_hat Z^ (f: x y u v -- [x+iy]^[u+iv] )

    #include <pfe/option-ext.h>

FCode p4_z_hat ---

### Description

Compute in terms of the principal argument of x+iy.

0.33.71
0.33.71 pfe
p4_z_cosh 3
p4_z_cosh ZCOSH (f: z -- cosh[z] )

    #include <pfe/option-ext.h>

FCode p4_z_cosh ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_sinh 3
p4_z_sinh ZSINH (f: z -- sinh[z] )

    #include <pfe/option-ext.h>

FCode p4_z_sinh ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_tanh 3
p4_z_tanh ZTANH (f: z -- tanh[z] )

    #include <pfe/option-ext.h>

FCode p4_z_tanh ---

### Description

Kahan, p. 204, including his divide by zero signal suppression for infinite values of `tan()`. To quote the very informative "=>'man math'" on our Darwin system about IEEE 754: "Divide-by-Zero is signaled only when a function takes exactly infinite values at finite operands."

0.33.71
0.33.71 pfe
p4_z_coth 3
p4_z_coth ZCOTH (f: z -- 1/tanh[z] )

    #include <pfe/option-ext.h>

FCode p4_z_coth ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_cos 3
p4_z_cos ZCOS (f: z -- cosh[i*z] )

    #include <pfe/option-ext.h>

FCode p4_z_cos ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_sin 3
p4_z_sin ZSIN (f: z -- -i*sinh[i*z] )

    #include <pfe/option-ext.h>

FCode p4_z_sin ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_tan 3
p4_z_tan ZTAN (f: z -- -i*tanh[i*z] )

    #include <pfe/option-ext.h>

FCode p4_z_tan ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_cot 3
p4_z_cot ZCOT (f: z -- -i*coth[-i*z] )

    #include <pfe/option-ext.h>

FCode p4_z_cot ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_acos 3
p4_z_acos ZACOS (f: z -- u+iv=acos[z] )

    #include <pfe/option-ext.h>

FCode p4_z_acos ---

### Description

Kahan, p.202.

0.33.71
0.33.71 pfe
p4_z_acosh 3
p4_z_acosh ZACOSH (f: z -- u+iv=acosh[z] )

    #include <pfe/option-ext.h>

FCode p4_z_acosh ---

### Description

Kahan, p.203.

0.33.71
0.33.71 pfe
p4_z_asin 3
p4_z_asin ZASIN (f: z -- u+iv=asin[z] )

    #include <pfe/option-ext.h>

FCode p4_z_asin ---

### Description

Kahan, p.203.

0.33.71
0.33.71 pfe
p4_z_asinh 3
p4_z_asinh ZASINH (f: z -- -i*asin[i*z] )

    #include <pfe/option-ext.h>

FCode p4_z_asinh ---

### Description

Kahan, p. 203, couth.

0.33.71
0.33.71 pfe
p4_z_atanh 3
p4_z_atanh ZATANH (f: z -- u+iv=atanh[z] )

    #include <pfe/option-ext.h>

FCode p4_z_atanh ---

### Description

Kahan, p. 203.

0.33.71
0.33.71 pfe
p4_z_atan 3
p4_z_atan ZATAN (f: z -- -i*atanh[i*z] )

    #include <pfe/option-ext.h>

FCode p4_z_atan ---

### Description

Kahan, p. 204, couth.

0.33.71
0.33.71 pfe
p4_z_constant 3
p4_z_constant ZCONSTANT ( "name" f: z -- ) "name" execution: (f: -- z )

    #include <pfe/option-ext.h>

FCode p4_z_constant ---

### Description

Define a word that leaves x+iy on the fp stack upon execution.

0.33.71
0.33.71 pfe
p4_z_literal 3
p4_z_literal ZLITERAL Compilation: (f: z -- ) Run: (f: -- z )

    #include <pfe/option-ext.h>

FCode p4_z_literal ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_z_variable 3
p4_z_variable ZVARIABLE ( "name" -- ) "name" exection: ( -- zaddr )

    #include <pfe/option-ext.h>

FCode p4_z_variable ---

### Description

Allocate aligned memory for an fp complex number, with the real part first in memory, and define a word that leaves the address on the data stack.

0.33.71
0.33.71 pfe
p4_store 3
p4_store ! ( value some-cell* -- | value addr* -- [?] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_store ---

### Description

store value at addr (sizeof `CELL`)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sh 3
p4_sh # ( n,n -- n,n' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_sh ---

### Description

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 `#>`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sh_greater 3
p4_sh_greater #> ( n,n -- hold-str-ptr hold-str-len ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_sh_greater ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sh_s 3
p4_sh_s #S ( n,n -- 0,0 ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_sh_s ---

### Description

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 `#>`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_tick 3
p4_tick "'" ( 'name' -- name-xt* ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_tick ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren 3
p4_paren "(" ( 'comment<closeparen;>' -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_paren ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_star 3
p4_star "*" ( a# b# -- mul-a#' | a b -- mul-a' [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_star ---

### Description

return the multiply of the two args

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_star_slash 3
p4_star_slash "*\/" ( a# b# c# -- scale-a#' | a b c -- scale-a' [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_star_slash ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_star_slash_mod 3
p4_star_slash_mod "*\/MOD" ( a# b# c# -- div-a# mod-a# | a b c -- div-a mod-a [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_star_slash_mod ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_plus 3
p4_plus + ( a* b# -- a*' | a# b* -- b*' | a# b# -- a#' | a b -- a' [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_plus ---

### Description

return the sum of the two args

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_plus_store 3
p4_plus_store +! ( value# some-cell* -- | value some* -- [?] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_plus_store ---

### Description

add val to the value found in addr

      simulate:
        : +! TUCK @ + SWAP ! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_plus_loop_execution 3
p4_plus_loop_execution "((+LOOP))" ( increment# -- ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_XE p4_plus_loop_execution ---

### Description

compiled by `+LOOP`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_plus_loop 3
p4_plus_loop +LOOP ( increment# R: some,loop -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_plus_loop ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_comma 3
p4_comma "," ( value* -- | value# -- | value -- [?] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_comma ---

### Description

store the value in the dictionary

      simulate:
        : , DP  1 CELLS DP +!  ! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_minus 3
p4_minus "-" ( a* b# -- a*' | a# b* -- b*' | a# b# -- a#' | a* b* -- diff-b#' | a b -- a' [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_minus ---

### Description

return the difference of the two arguments

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dot 3
p4_dot "." ( value# -- | value* -- [?] | value -- [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_dot ---

### Description

print the numerical value to stdout - uses `BASE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dot_quote_execution 3
p4_dot_quote_execution '((.\"))' ( -- ) [HIDDEN] skipstring

    #include <pfe/core-ext.h>

FCode_XE p4_dot_quote_execution ---

### Description

compiled by => ." string"

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dot_quote 3
p4_dot_quote '.\"' ( [string<">] -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_dot_quote ---

### Description

print the string to stdout

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_slash 3
p4_slash "/" ( a# b# -- a#' | a b -- a' [???] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_slash ---

### Description

return the quotient of the two arguments

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_slash_mod 3
p4_slash_mod "/MOD" ( a# b# -- div-a#' mod-a#' | a b -- div-a' mod-a' [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_slash_mod ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_zero_less 3
p4_zero_less 0< ( value -- test-flag ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_zero_less ---

### Description

return a flag that is true if val is lower than zero

      simulate:
       : 0&lt; 0 &lt; ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_zero_equal 3
p4_zero_equal 0= ( 0 -- test-flag! | value! -- 0 | value -- test-flag ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_zero_equal ---

### Description

return a flag that is true if val is just zero

      simulate:
       : 0= 0 = ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_one_plus 3
p4_one_plus 1+ ( value -- value' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_one_plus ---

### Description

return the value incremented by one

      simulate:
       : 1+ 1 + ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_one_minus 3
p4_one_minus 1- ( value -- value' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_one_minus ---

### Description

return the value decremented by one

      simulate:
        : 1- 1 - ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_store 3
p4_two_store 2! ( x,x variable* -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_two_store ---

### Description

double-cell store

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_star 3
p4_two_star 2* ( a# -- a#' | a -- a' [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_two_star ---

### Description

multiplies the value with two - but it does actually use a shift1 to be faster

      simulate:
       : 2* 2 * ; ( canonic) : 2* 1 LSHIFT ; ( usual)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_slash 3
p4_two_slash 2/ ( a# -- a#' | a -- a' [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_two_slash ---

### Description

divides the value by two - but it does actually use a shift1 to be faster

      simulate:
       : 2/ 2 / ; ( canonic) : 2/ 1 RSHIFT ; ( usual)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_fetch 3
p4_two_fetch 2@ ( variable* -- x,x ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_two_fetch ---

### Description

double-cell fetch

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_drop 3
p4_two_drop 2DROP ( a b -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_two_drop ---

### Description

double-cell drop, also used to drop two items

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_dup 3
p4_two_dup 2DUP ( a,a -- a,a a,a ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_two_dup ---

### Description

double-cell duplication, also used to duplicate two items

      simulate:
        : 2DUP OVER OVER ; ( wrong would be : 2DUP DUP DUP ; !!)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_over 3
p4_two_over 2OVER ( a,a b,b -- a,a b,b a,a ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_two_over ---

### Description

double-cell over, see `OVER` and `2DUP`

      simulate:
        : 2OVER SP@ 2 CELLS + 2@ ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_swap 3
p4_two_swap 2SWAP ( a,a b,b -- b,b a,a ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_two_swap ---

### Description

double-cell swap, see `SWAP` and `2DUP`

      simulate:
        : 2SWAP LOCALS| B1 B2 A1 A2 | B2 B1 A2 A1 ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_colon_RT 3
p4_colon_RT "(NEST)" ( -- ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_RT p4_colon_RT ---

### Description

compiled by `:` (see also `(NONAME)` compiled by `:NONAME` )

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_colon 3
p4_colon ":" ( 'name' -- ) [ANS] [NEW]

    #include <pfe/core-ext.h>

FCode p4_colon ---

### Description

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`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_semicolon_execution 3
p4_semicolon_execution "((;))" ( -- ) [HIDDEN] [EXIT]

    #include <pfe/core-ext.h>

FCode_XE p4_semicolon_execution ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_semicolon 3
p4_semicolon ";" ( -- ) [ANS] [EXIT] [END]

    #include <pfe/core-ext.h>

FCode p4_semicolon ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_less_than 3
p4_less_than < ( a* b* -- test-flag | a# b# -- test-flag | a b -- test-flag [?] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_less_than ---

### Description

return a flag telling if a is lower than b

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_less_sh 3
p4_less_sh <# ( -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_less_sh ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_equals 3
p4_equals = ( a* b* -- test-flag | a# b# -- test-flag | a b -- test-flag [?] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_equals ---

### Description

return a flag telling if a is equal to b

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_greater_than 3
p4_greater_than > ( a* b* -- test-flag | a# b# -- test-flag | a b -- test-flag [?] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_greater_than ---

### Description

return a flag telling if a is greater than b

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_to_body 3
p4_to_body >BODY ( some-xt* -- some-body* ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_to_body ---

### Description

adjust the execution-token (ie. the CFA) to point to the parameter field (ie. the PFA) of a word. this is not a constant operation - most words have their parameters at "1 CELLS +" but CREATE/DOES-words have the parameters at "2 CELLS +" and ROM/USER words go indirect with a rom'ed offset i.e. "CELL + @ UP +"

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_to_number 3
p4_to_number >NUMBER ( a,a str-ptr str-len -- a,a' str-ptr' str-len) [ANS]

    #include <pfe/core-ext.h>

FCode p4_to_number ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_to_r 3
p4_to_r >R ( value -- R: value ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_to_r ---

### Description

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`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Q_dup 3
p4_Q_dup ?DUP ( 0 -- 0 | value! -- value! value! | value -- 0 | value! value! ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_Q_dup ---

### Description

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 ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_fetch 3
p4_fetch @ ( value* -- value ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_fetch ---

### Description

fetch the value from the variables address

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_abs 3
p4_abs ABS ( value# -- value#' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_abs ---

### Description

return the absolute value

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_accept 3
p4_accept ACCEPT ( buffer-ptr buffer-max -- buffer-len ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_accept ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_align 3
p4_align ALIGN ( -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_align ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_aligned 3
p4_aligned ALIGNED ( addr -- addr' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_aligned ---

### Description

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`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_allot 3
p4_allot ALLOT ( allot-count -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_allot ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_and 3
p4_and AND ( value mask -- value' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_and ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_begin 3
p4_begin BEGIN ( -- ) [ANS] [LOOP]

    #include <pfe/core-ext.h>

FCode p4_begin ---

### Description

start a control-loop, see `WHILE` and `REPEAT`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_c_store 3
p4_c_store C! ( value# variable#* -- | value# variable* [?] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_c_store ---

### Description

store the byte-value at address, see => !

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_c_comma 3
p4_c_comma C, ( value# -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_c_comma ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_c_fetch 3
p4_c_fetch C@ ( value#* -- value# | value* -- value# [?] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_c_fetch ---

### Description

fetch a byte-value from the address, see `@`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_cell_plus 3
p4_cell_plus CELL+ ( value -- value' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_cell_plus ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_cells 3
p4_cells CELLS ( value# -- value#' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_cells ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_char 3
p4_char CHAR ( 'word' -- char# ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_char ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_char_plus 3
p4_char_plus CHAR+ ( value -- value' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_char_plus ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_chars 3
p4_chars CHARS ( value# -- value#' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_chars ---

### Description

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?)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_constant_RT 3
p4_constant_RT "((CONSTANT))" ( -- ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_RT p4_constant_RT ---

### Description

runtime compiled by `CONSTANT`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_constant 3
p4_constant CONSTANT ( value 'name' -- ) [ANS] [DOES: -- value ]

    #include <pfe/core-ext.h>

FCode p4_constant ---

### Description

`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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_count 3
p4_count COUNT ( string-bstr* -- string-ptr' string-len | some* -- some*' some-len [?] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_count ---

### Description

usually before calling `TYPE`

(as an unwarranted extension, this word does try to be idempotent).

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_cr 3
p4_cr CR ( -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_cr ---

### Description

print a carriage-return/new-line on stdout

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_decimal 3
p4_decimal DECIMAL ( -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_decimal ---

### Description

set the `BASE` to 10

      simulate:
        : DECIMAL 10 BASE ! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_depth 3
p4_depth DEPTH ( -- depth# ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_depth ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_do_execution 3
p4_do_execution "((DO))" ( end# start# -- ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_XE p4_do_execution ---

### Description

compiled by `DO`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_do 3
p4_do DO ( end# start# | end* start* -- R: some,loop ) [ANS] [LOOP]

    #include <pfe/core-ext.h>

FCode p4_do ---

### Description

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`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_variable_RT 3
p4_variable_RT "((VAR))" ( -- pfa ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_RT p4_variable_RT ---

### Description

the runtime compiled by `VARIABLE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_builds_RT 3
p4_builds_RT "((BUILDS))" ( -- pfa ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode p4_builds_RT ---

### Description

the runtime compiled by `CREATE` which is not much unlike a `VARIABLE` (in ANS Forth Mode we reserve an additional DOES-field)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_does_RT 3
p4_does_RT "((DOES>))" ( -- pfa ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_RT p4_does_RT ---

### Description

runtime compiled by DOES>

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_does_execution 3
p4_does_execution "(DOES>)" ( -- pfa ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_XE p4_does_execution ---

### Description

execution compiled by `DOES>`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_does 3
p4_does "DOES>" ( -- does* ) [ANS] [END] [NEW]

    #include <pfe/core-ext.h>

FCode p4_does ---

### Description

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. (note: FIG option will leave pfa+cell since does-rt is stored in pfa)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_builds 3
p4_builds <BUILDS ( 'name' -- ) [FTH]

    #include <pfe/core-ext.h>

FCode p4_builds ---

### Description

make a `HEADER` whose runtime will be changed later using `DOES>` <br /> note that ans'forth does not define `<BUILDS` and it suggests to use `CREATE` directly. <br /> ... if you want to write FIG-programs in pure pfe then you have to use `CREATE:` to get the FIG-like meaning of `CREATE` whereas the ans-forth `CREATE` is the same as `<BUILDS`

      : &lt;BUILDS BL WORD HEADER DOCREATE A, 0 A, ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_drop 3
p4_drop DROP ( a -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_drop ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dup 3
p4_dup DUP ( a -- a a ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_dup ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_branch_execution 3
p4_branch_execution "(BRANCH)" ( -- ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_XE p4_branch_execution ---

### Description

execution compiled by `ELSE` - just a simple `BRANCH`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_else_execution 3
p4_else_execution "((ELSE))" ( -- ) OBSOLETE (FIXME: to be removed in pfe-34)

    #include <pfe/core-ext.h>

FCode_XE p4_else_execution ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_else 3
p4_else ELSE ( -- ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode p4_else ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_emit 3
p4_emit EMIT ( char# -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_emit ---

### Description

print the char-value on stack to stdout

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_environment_Q_core 3
p4_environment_Q_core ENVIRONMENT? ( name-ptr name-len -- 0 | ?? name-flag! ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_environment_Q_core ---

### Description

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)

Here it implements the environment queries as a `SEARCH-WORDLIST` in a user-visible vocabulary called `ENVIRONMENT`

      : ENVIRONMENT?
        ['] ENVIRONMENT &gt;WORDLIST SEARCH-WORDLIST
        IF  EXECUTE TRUE ELSE  FALSE THEN ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_evaluate 3
p4_evaluate EVALUATE ( str-ptr str-len -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_evaluate ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_execute 3
p4_execute EXECUTE ( some-xt* -- ??? ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_execute ---

### Description

run the execution-token on stack - this will usually trap if it was null for some reason, see `>EXECUTE`

      simulate:
       : EXECUTE &gt;R EXIT ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_exit 3
p4_exit EXIT ( -- ) [ANS] [EXIT]

    #include <pfe/core-ext.h>

FCode p4_exit ---

### Description

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 `;`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_fill 3
p4_fill FILL ( mem-ptr mem-len char# -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_fill ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_find 3
p4_find FIND ( name-bstr* -- name-bstr* 0 | name-xt* -1|1 ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_find ---

### Description

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 (a positive value) if the word had been immediate, -1 otherwise (a negative value).

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_m_slash_mod 3
p4_f_m_slash_mod "FM/MOD" ( n1,n1# n2# -- div-n1# mod-n1# ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_f_m_slash_mod ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_here 3
p4_here HERE ( -- here* ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_here ---

### Description

used with `WORD` and many compiling words

      simulate:   : HERE DP @ ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_hold 3
p4_hold HOLD ( char# -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_hold ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_i 3
p4_i I ( R: some,loop -- S: i# ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_i ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_q_branch_execution 3
p4_q_branch_execution "(?BRANCH)" ( -- ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_XE p4_q_branch_execution ---

### Description

execution word compiled by `IF` - just some simple => ?BRANCH

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_if_execution 3
p4_if_execution "((IF))" ( -- ) OBSOLETE (FIXME: to be removed in pfe-34)

    #include <pfe/core-ext.h>

FCode_XE p4_if_execution ---

### Description

use `(?BRANCH)`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_if 3
p4_if IF ( value -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_if ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_immediate 3
p4_immediate IMMEDIATE ( -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_immediate ---

### Description

make the `LATEST` word immediate, see also `CREATE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_invert 3
p4_invert INVERT ( value# -- value#' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_invert ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_j 3
p4_j J ( R: some,loop -- S: j# ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_j ---

### Description

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`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_key 3
p4_key KEY ( -- char# ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_key ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_leave 3
p4_leave LEAVE ( R: some,loop -- R: some,loop ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_leave ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_literal_execution 3
p4_literal_execution "((LIT))" ( -- value ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_XE p4_literal_execution ---

### Description

execution compiled by `LITERAL`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_literal 3
p4_literal LITERAL ( C: value -- S: value ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_literal ---

### Description

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)

(in most configurations this word is statesmart and it will do nothing in interpret-mode. See `LITERAL,` for a non-immediate variant)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_loop_execution 3
p4_loop_execution "((LOOP))" ( -- ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_XE p4_loop_execution ---

### Description

execution compiled by `LOOP`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_loop 3
p4_loop LOOP ( R: some,loop -- ) [ANS] [REPEAT]

    #include <pfe/core-ext.h>

FCode p4_loop ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_l_shift 3
p4_l_shift LSHIFT ( value# shift-count -- value#' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_l_shift ---

### Description

does a bitwise left-shift on value

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_m_star 3
p4_m_star M* ( a# b# -- a,a#' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_m_star ---

### Description

multiply and return a double-cell result

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_max 3
p4_max MAX ( a# b# -- a#|b# | a* b* -- a*|b* | a b -- a|b [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_max ---

### Description

return the maximum of a and b

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_min 3
p4_min MIN ( a# b# -- a#|b# | a* b* -- a*|b* | a b -- a|b [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_min ---

### Description

return the minimum of a and b

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_mod 3
p4_mod MOD ( a# b# -- mod-a# | a b# -- mod-a# [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_mod ---

### Description

return the module of "a mod b"

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_move 3
p4_move MOVE ( from-ptr to-ptr move-len -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_move ---

### Description

p4_memcpy an area

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_negate 3
p4_negate NEGATE ( value# -- value#' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_negate ---

### Description

return the arithmetic negative of the (signed) cell

      simulate:   : NEGATE -1 * ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_or 3
p4_or OR ( a b# -- a' | a# b -- b' | a b -- a' [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_or ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_over 3
p4_over OVER ( a b -- a b a ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_over ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_postpone_execution 3
p4_postpone_execution "((POSTPONE))" ( -- ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_XE p4_postpone_execution ---

### Description

execution compiled by `POSTPONE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_postpone 3
p4_postpone POSTPONE ( [word] -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_postpone ---

### Description

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)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_quit 3
p4_quit QUIT ( -- ) [EXIT]

    #include <pfe/core-ext.h>

FCode p4_quit ---

### Description

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 it is defined as a `THROW` ,

      : QUIT -56 THROW ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_r_from 3
p4_r_from R> ( R: a -- a R: ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_r_from ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_r_fetch 3
p4_r_fetch R@ ( R: a -- a R: a ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_r_fetch ---

### Description

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>` . Without LOCALS-EXT there are useful words like `2R@` `R'@` `R"@` `R!`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_recurse 3
p4_recurse RECURSE ( ? -- ? ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_recurse ---

### Description

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 ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_repeat 3
p4_repeat REPEAT ( -- ) [ANS] [REPEAT]

    #include <pfe/core-ext.h>

FCode p4_repeat ---

### Description

ends an unconditional loop, see `BEGIN`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_rot 3
p4_rot ROT ( a b c -- b c a ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_rot ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_r_shift 3
p4_r_shift RSHIFT ( value# shift-count# -- value#' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_r_shift ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_s_quote_execution 3
p4_s_quote_execution '((S"))' ( -- string-ptr string-len ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_XE p4_s_quote_execution ---

### Description

execution compiled by `S"`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_s_quote 3
p4_s_quote 'S"' ( [string<">] -- string-ptr string-len) [ANS]

    #include <pfe/core-ext.h>

FCode p4_s_quote ---

### Description

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 `"`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_s_to_d 3
p4_s_to_d S>D ( a# -- a,a#' | a -- a,a#' [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_s_to_d ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sign 3
p4_sign SIGN ( a# -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_sign ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_s_m_slash_rem 3
p4_s_m_slash_rem SM/REM ( a,a# b# -- div-a# rem-a# ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_s_m_slash_rem ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_source 3
p4_source SOURCE ( -- buffer* IN-offset# ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_source ---

### Description

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`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_space 3
p4_space SPACE ( -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_space ---

### Description

print a single space to stdout, see `SPACES`

      simulate:    : SPACE  BL EMIT ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_spaces 3
p4_spaces SPACES ( space-count -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_spaces ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_swap 3
p4_swap SWAP ( a b -- b a ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_swap ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_then 3
p4_then THEN ( -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_then ---

### Description

does resolve a branch coming from either `IF` or `ELSE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_type 3
p4_type TYPE ( string-ptr string-len -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_type ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_u_dot 3
p4_u_dot U. ( value# -- | value -- [?] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_u_dot ---

### Description

print unsigned number to stdout

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_u_less_than 3
p4_u_less_than U< ( a b -- test-flag ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_u_less_than ---

### Description

unsigned comparison, see `<`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_u_m_star 3
p4_u_m_star UM* ( a# b# -- a,a#' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_u_m_star ---

### Description

unsigned multiply returning double-cell value

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_u_m_slash_mod 3
p4_u_m_slash_mod "UM/MOD" ( a,a# b# -- div-a#' mod-a#' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_u_m_slash_mod ---

### Description

see `/MOD` and `SM/REM`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_unloop 3
p4_unloop UNLOOP ( R: some,loop -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_unloop ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_until 3
p4_until UNTIL ( test-flag -- ) [ANS] [REPEAT]

    #include <pfe/core-ext.h>

FCode p4_until ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_variable 3
p4_variable VARIABLE ( 'name' -- ) [ANS] [DOES: -- name* ]

    #include <pfe/core-ext.h>

FCode p4_variable ---

### Description

`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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_while 3
p4_while WHILE ( test-flag -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_while ---

### Description

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)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_word 3
p4_word WORD ( delimiter-char# -- here* ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_word ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_xor 3
p4_xor XOR ( a# b# -- a#' ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_xor ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_left_bracket 3
p4_left_bracket [ ( -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_left_bracket ---

### Description

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 `]`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bracket_tick 3
p4_bracket_tick ['] ( [name] -- name-xt* ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_bracket_tick ---

### Description

will place the execution token of the following word into the dictionary. See `'` for non-compiling variant.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bracket_char 3
p4_bracket_char [CHAR] ( [word] -- char# ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_bracket_char ---

### Description

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 forth-83 `ASCII`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_right_bracket 3
p4_right_bracket ] ( -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_right_bracket ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dot_paren 3
p4_dot_paren ".(" ( [message<closeparen;>] -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_dot_paren ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dot_r 3
p4_dot_r .R ( value# precision# -- | value precision# -- [??] ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_dot_r ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_zero_not_equals 3
p4_zero_not_equals "0<>" ( 0 -- 0 | value! -- value-flag! | value -- value-flag ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_zero_not_equals ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_zero_greater 3
p4_zero_greater 0> ( 0 -- 0 | value! -- value-flag! | value -- value-flag ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_zero_greater ---

### Description

return value greater than zero

      simulate:    : 0&gt; 0 &gt; ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_to_r 3
p4_two_to_r 2>R ( a,a -- R: a,a ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_two_to_r ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_r_from 3
p4_two_r_from 2R> ( R: a,a -- a,a R: ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_two_r_from ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_r_fetch 3
p4_two_r_fetch 2R@ ( R: a,a -- a,a R: a,a ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_two_r_fetch ---

### Description

fetch a double-cell value from the return-stack, that had been previously been put there with `2>R` - see `R@` for single value. This can partly be a two-cell `LOCALS|` value, without LOCALS-EXT there are alos other useful words like `2R!` `R'@` `R"@`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_colon_noname_RT 3
p4_colon_noname_RT "(NONAME)" ( -- ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_RT p4_colon_noname_RT ---

### Description

compiled by `:NONAME` (see also `(NEST)` compiled by `:` (execution is identical))

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_colon_noname 3
p4_colon_noname :NONAME ( -- C: noname,word ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_colon_noname ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_not_equals 3
p4_not_equals "<>" ( a b -- a-flag ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_not_equals ---

### Description

return true if a and b are not equal, see `=`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Q_do_execution 3
p4_Q_do_execution "((?DO))" ( a b -- ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_XE p4_Q_do_execution ---

### Description

execution compiled by => ?DO

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Q_do 3
p4_Q_do ?DO ( end# start# | end* start* -- R: some,loop ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_Q_do ---

### Description

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.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_again 3
p4_again AGAIN ( -- ) [ANS] [REPEAT]

    #include <pfe/core-ext.h>

FCode p4_again ---

### Description

ends an infinite loop, see `BEGIN` and compare with `WHILE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_c_quote_execution 3
p4_c_quote_execution '((C"))' ( -- string-bstr* ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_XE p4_c_quote_execution ---

### Description

execution compiled by `C"` string"

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_c_quote 3
p4_c_quote 'C"' ( [string<">] -- string-bstr* ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_c_quote ---

### Description

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"

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_case 3
p4_case CASE ( value -- value ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_case ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_compile_comma 3
p4_compile_comma "COMPILE," ( some-xt* -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_compile_comma ---

### Description

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`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_convert 3
p4_convert CONVERT ( a,a# string-bstr* -- a,a# a-len# ) [ANS] [OLD]

    #include <pfe/core-ext.h>

FCode p4_convert ---

### Description

digit conversion, obsolete, superseded by `>NUMBER`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_endcase 3
p4_endcase ENDCASE ( value -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_endcase ---

### Description

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`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_endof 3
p4_endof ENDOF ( -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_endof ---

### Description

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` )

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_erase 3
p4_erase ERASE ( buffer-ptr buffer-len -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_erase ---

### Description

fill an area will zeros.

      2000 CREATE DUP ALLOT ERASE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_expect 3
p4_expect EXPECT ( str-ptr str-len -- ) [ANS] [OLD]

    #include <pfe/core-ext.h>

FCode p4_expect ---

### Description

input handling, see `WORD` and `PARSE` and `QUERY` the input string is placed at str-adr and its length

      in =&gt; SPAN - this word is superceded by =&gt; ACCEPT

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_hex 3
p4_hex HEX ( -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_hex ---

### Description

set the input/output `BASE` to hexadecimal

      simulate:        : HEX 16 BASE ! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_marker 3
p4_marker MARKER ( 'name' -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_marker ---

### Description

create a named marker that you can use to `FORGET` , running the created word will reset the dict/order variables to the state at the creation of this name.

      : MARKER PARSE-WORD (MARKER) ;

see also `ANEW` which is not defined in ans-forth but which uses the `MARKER` functionality in the way it should have been defined.

      : MARKER PARSE-WORD (MARKER) ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_nip 3
p4_nip NIP ( a b -- b ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_nip ---

### Description

drop the value under the top of stack, inverse of `TUCK`

      simulate:        : NIP SWAP DROP ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_of_execution 3
p4_of_execution "((OF))" ( check val -- check ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_XE p4_of_execution ---

### Description

execution compiled by `OF`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_of 3
p4_of OF ( value test -- value ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_of ---

### Description

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`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_pad 3
p4_pad PAD ( -- pad* ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_pad ---

### Description

transient buffer region

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_parse 3
p4_parse PARSE ( delim-char# -- buffer-ptr buffer-len ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_parse ---

### Description

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. In a newer version, `PARSE` will not copy but just return the word-span being seen in the input-buffer - therefore a transient space.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_parse_word 3
p4_parse_word PARSE-WORD ( "chars" -- buffer-ptr buffer-len ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_parse_word ---

### Description

the ANS'94 standard describes this word in a comment under `PARSE`, section A.6.2.2008 - quote:

Skip leading spaces and parse name delimited by a space. c-addr is the address within the input buffer and u is the length of the selected string. If the parse area is empty, the resulting string has a zero length.

If both `PARSE` and `PARSE-WORD` are present, the need for `WORD` is largely eliminated. Note that Forth200x calls it `PARSE-NAME` and clarifies that non-empty whitespace-only input is returned as a zero length string as well.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_pick 3
p4_pick PICK ( value ...[n-1] n -- value ...[n-1] value ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_pick ---

### Description

pick the nth value from under the top of stack and push it note that

        0 PICK -&gt; DUP         1 PICK -&gt; OVER

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_refill 3
p4_refill REFILL ( -- refill-flag ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_refill ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_restore_input 3
p4_restore_input RESTORE-INPUT ( input...[input-len] input-len -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_restore_input ---

### Description

inverse of `SAVE-INPUT`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_roll 3
p4_roll ROLL ( value ...[n-1] n -- ...[n-1] value ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_roll ---

### Description

the extended form of `ROT`

         2 ROLL -&gt; ROT

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_save_input 3
p4_save_input SAVE-INPUT ( -- input...[input-len] input-len ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_save_input ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_to_execution 3
p4_to_execution "((TO))" ( value -- ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_XE p4_to_execution ---

### Description

execution compiled by `TO`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_to 3
p4_to TO ( value [name] -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_to ---

### Description

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|`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_tuck 3
p4_tuck TUCK ( a b -- b a b ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_tuck ---

### Description

shove the top-value under the value beneath. See `OVER` and `NIP`

      simulate:    : TUCK  SWAP OVER ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_u_dot_r 3
p4_u_dot_r U.R ( value# precision# -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_u_dot_r ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_u_greater_than 3
p4_u_greater_than U> ( a b -- a-flag ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_u_greater_than ---

### Description

unsigned comparison of a and b, see `>`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_unused 3
p4_unused UNUSED ( -- unused-len ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_unused ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_value_RT 3
p4_value_RT "((VALUE))" ( -- value ) [HIDDEN]

    #include <pfe/core-ext.h>

FCode_RT p4_value_RT ---

### Description

runtime compiled by `VALUE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_value 3
p4_value VALUE ( value 'name' -- ) [HIDDEN] [DOES: -- value ]

    #include <pfe/core-ext.h>

FCode p4_value ---

### Description

`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`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_within 3
p4_within WITHIN ( a# b# c# -- a-flag | a* b* c* -- a-flag ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_within ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bracket_compile 3
p4_bracket_compile [COMPILE] ( [word] -- ) [ANS]

    #include <pfe/core-ext.h>

FCode p4_bracket_compile ---

### Description

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`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_quote 3
p4_quote '"' ( [string<">] -- string-bstr* ) [FTH]

    #include <pfe/core-ext.h>

FCode p4_quote ---

### Description

         or perhaps ( [string&lt;"&gt;] -- string-ptr string-len )

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_zero_less_equal 3
p4_zero_less_equal 0<= ( a -- flag )

    #include <pfe/core-mix.h>

FCode p4_zero_less_equal ---

### Description

      simulate    : 0&lt;= 0&gt; 0= ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_zero_greater_equal 3
p4_zero_greater_equal 0>= ( a -- flag )

    #include <pfe/core-mix.h>

FCode p4_zero_greater_equal ---

### Description

      simulate    : 0&gt;= 0&lt; 0= ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_less_equal 3
p4_less_equal <= ( a b -- flag )

    #include <pfe/core-mix.h>

FCode p4_less_equal ---

### Description

      simulate    : &lt;= &gt; 0= ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_greater_equal 3
p4_greater_equal >= ( a b -- flag )

    #include <pfe/core-mix.h>

FCode p4_greater_equal ---

### Description

      simulate    : &gt;= &lt; 0= ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_u_less_equal 3
p4_u_less_equal U<= ( a b -- flag )

    #include <pfe/core-mix.h>

FCode p4_u_less_equal ---

### Description

      simulate    : U&lt;= U&gt; 0= ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_u_greater_equal 3
p4_u_greater_equal U>= ( a b -- flag )

    #include <pfe/core-mix.h>

FCode p4_u_greater_equal ---

### Description

      simulate    : U&gt;= U&lt; 0= ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_u_max 3
p4_u_max UMAX ( a b -- max )

    #include <pfe/core-mix.h>

FCode p4_u_max ---

### Description

see `MAX`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_u_min 3
p4_u_min UMIN ( a b -- min )

    #include <pfe/core-mix.h>

FCode p4_u_min ---

### Description

see `MIN` , `MAX` and `UMAX`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_license 3
p4_license LICENSE ( -- )

    #include <pfe/core-mix.h>

FCode p4_license ---

### Description

show a lisence info - the basic PFE system is licensed under the terms of the LGPL (Lesser GNU Public License) - binary modules loaded into the system and hooking into the system may carry another `LICENSE`

      : LICENSE [ ENVIRONMENT ] FORTH-LICENSE TYPE ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_warranty 3
p4_warranty WARRANTY ( -- )

    #include <pfe/core-mix.h>

FCode p4_warranty ---

### Description

show a warranty info - the basic PFE system is licensed under the terms of the LGPL (Lesser GNU Public License) - which exludes almost any liabilities whatsoever - however loadable binary modules may hook into the system and their functionality may have different WARRANTY infos.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dot_version 3
p4_dot_version .VERSION ( -- )

    #include <pfe/core-mix.h>

FCode p4_dot_version ---

### Description

show the version of the current PFE system

      : .VERSION [ ENVIRONMENT ] FORTH-NAME TYPE FORTH-VERSION TYPE ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dot_date 3
p4_dot_date .CVERSION ( -- )

    #include <pfe/core-mix.h>

FCode p4_dot_date ---

### Description

show the compile date of the current PFE system

      : .CVERSION [ ENVIRONMENT ] FORTH-NAME TYPE FORTH-DATE TYPE ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_string_comma 3
p4_string_comma STRING, ( str len -- )

    #include <pfe/core-mix.h>

FCode p4_string_comma ---

### Description

Store a string in data space as a counted string.

      : STRING, HERE  OVER 1+  ALLOT  PLACE ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_parse_comma 3
p4_parse_comma PARSE, ( "chars<">" -- )

    #include <pfe/core-mix.h>

FCode p4_parse_comma ---

### Description

Store a char-delimited string in data space as a counted string. As seen in Bawd's

      : ," [CHAR] " PARSE  STRING, ; IMMEDIATE

this implementation is much different from Bawd's

      : PARSE, PARSE STRING, ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_parse_comma_quote 3
p4_parse_comma_quote "PARSE,\"" ( "chars<">" -- )

    #include <pfe/core-mix.h>

FCode p4_parse_comma_quote ---

### Description

Store a quote-delimited string in data space as a counted string.

      : ," [CHAR] " PARSE  STRING, ; IMMEDIATE

implemented here as

      : PARSE," [CHAR] " PARSE, ; IMMEDIATE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren_marker 3
p4_paren_marker "(MARKER)" ( str-ptr str-len -- )

    #include <pfe/core-mix.h>

FCode p4_paren_marker ---

### Description

create a named marker that you can use to `FORGET` , running the created word will reset the dict/order variables to the state at the creation of this name.

      : (MARKER) (CREATE) HERE ,
              GET-ORDER DUP , 0 DO ?DUP IF , THEN LOOP 0 ,
              ...
        DOES&gt; DUP @ (FORGET)
              ...
      ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_anew 3
p4_anew ANEW ( 'name' -- )

    #include <pfe/core-mix.h>

FCode p4_anew ---

### Description

creates a `MARKER` if it doesn't exist, or forgets everything after it if it does. (it just gets executed).

Note: in PFE the `ANEW` will always work on the `ENVIRONMENT-WORDLIST` which has a reason: it is never quite sure whether the same `DEFINITIONS` wordlist is in the search `ORDER` that the original `ANEW` `MARKER` was defined in. Therefore, `ANEW` would be only safe on systems that do always stick to `FORTH` `DEFINITIONS`. Instead we will `CREATE` the `ANEW` `MARKER` in the `ENVIRONMENT` and use a simple `SEARCH-WORDLIST` on the `ENVIRONMENT-WORDLIST` upon re-run.

      \ old
      : ANEW BL WORD   DUP FIND NIP IF EXECUTE THEN   (MARKER) ;
      \ new
      : ANEW
        PARSE-WORD  2DUP ENVIRONMENT-WORDLIST SEARCH-WORDLIST IF  EXECUTE  THEN
        GET-CURRENT &gt;R ENVIRONMENT-WORDLIST SET-CURRENT  (MARKER)  R&gt; SET-CURRENT ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_marker_RT 3
p4_marker_RT "((MARKER))" ( -- )

    #include <pfe/core-mix.h>

FCode_RT p4_marker_RT ---

### Description

runtime compiled by `MARKER`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_strpush 3
p4_strpush _strpush_ ( zstr* -- S: str* str# )

    #include <pfe/double-sub.h>

_export void p4_strpush(const char *s)

### Description

push a C-string onto the SP runtime-stack, as if `S"` string" was used

      : _strpush_ s! _strlen_ s! ;

0.33.71
0.33.71 pfe
p4_pocket 3
p4_pocket _pocket_ ( -- str* )

    #include <pfe/double-sub.h>

_export P4_GCC_MALLOC void* p4_pocket(void)

### Description

return the next pocket for interactive string input.

      : _pocket_ _pockets@_ _pocket@_ th  _pocket@_ 1+ _pockets#_ mod to _pocket@_ ;

0.33.71
0.33.71 pfe
p4_dash_trailing 3
p4_dash_trailing _-trailing_ ( str* str# -- str#' )

    #include <pfe/double-sub.h>

_export P4_GCC_WARN_UNUSED_RESULT int p4_dash_trailing(p4_char_t *s, int n)

### Description

chop off trailing spaces for the stringbuffer. returns the new length, so for an internal counted string, use

        &lt;x&gt; dup count _-trailing_ c!
        : _-trailing_ begin dup while
           2dup + c@ bl &lt;&gt; if nip exit then
           1- repeat nip ;

0.33.71
0.33.71 pfe
p4_lower 3
p4_lower _lower_ ( str* str# -- )

    #include <pfe/double-sub.h>

_export void p4_lower(p4_char_t *p, int n)

### Description

_tolower_ applied to a stringbuffer

      : _lower_ 0 do dup c@ _tolower_ over c! 1+ loop drop ;

0.33.71
0.33.71 pfe
p4_upper 3
p4_upper _upper_ ( str* str# -- )

    #include <pfe/double-sub.h>

_export void p4_upper(p4_char_t *p, int n)

### Description

_toupper_ applied to a stringbuffer

      : _upper_ 0 do dup c@ _toupper_ over c! 1+ loop drop ;

0.33.71
0.33.71 pfe
p4_store_c_string 3
p4_store_c_string _zplaced_ ( str* str# dst* max# -- dst* ) [alias] _store_c_string_

    #include <pfe/double-sub.h>

_export char* p4_store_c_string(const p4_char_t *src, int n, char *dst, int max)

### Description

copy stringbuffer into a field as a zero-terminated string.

      : _zsplaced_ rot 2dup &gt; if drop 1- else nip then _zplace_ ;

0.33.71
0.33.71 pfe
p4_pocket_c_string 3
p4_pocket_c_string _pocket_zplaced ( str* str# -- pocket* ) [alias] _pocket_c_string_

    #include <pfe/double-sub.h>

_export P4_GCC_MALLOC char* p4_pocket_c_string(const p4_char_t* src, int n)

### Description

store a string-span as a zero-terminated string into another pocket-pad

      : _pocket_zplaced _pocket_ _/pocket_ _zplaced_ ;

0.33.71
0.33.71 pfe
p4_store_filename 3
p4_store_filename _zplaced_filename_ ( str* str# dst* max# -- dst* ) [alias] _store_filename_

    #include <pfe/double-sub.h>

_export char* p4_store_filename(const p4_char_t* str, int n, char* dst, int max)

### Description

copy stringbuffer into a field as a zero-terminated filename-string, a shell-homedir like "~username" will be expanded, and the platform-specific dir-delimiter is converted in on the fly ('/' vs. '\\')

0.33.71
0.33.71 pfe
p4_pocket_filename 3
p4_pocket_filename _pocket_fileame_ ( str* str# -- dst* )

    #include <pfe/double-sub.h>

_export P4_GCC_MALLOC char* p4_pocket_filename(const p4_char_t* src, int n)

### Description

a new pocket with the given filename as asciiz

      : _pocket_filename_ _pocket_ /pocket _zplaced_filename_

0.33.71
0.33.71 pfe
p4_search 3
p4_search _search_ ( str* str# key* key# -- 0 | key-in-str* )

    #include <pfe/double-sub.h>

_export char * p4_search(const char *p1, int u1, const char *p2, int u2)

### Description

search for substring p2/u2 in string p1/u1, returns null if not found or a pointer into str*,str# that has lenght of key#

0.33.71
0.33.71 pfe
p4_match 3
p4_match _match_ ( zpattern* zstring* ignorecase? -- yes? )

    #include <pfe/double-sub.h>

_export int p4_match(const p4char *pattern, const p4char *str, int len, int ic)

### Description

Match string against pattern. Pattern knows wildcards `*' and `?' and `\' to escape a wildcard.

0.33.71
0.33.71 pfe
p4_udiv 3
p4_udiv _U/_

    #include <pfe/double-sub.h>

_export P4_GCC_CONST udiv_t p4_udiv(p4ucell num, p4ucell denom)

### Description

unsigned divide procedure, single prec

0.33.71
0.33.71 pfe
p4_fdiv 3
p4_fdiv _/_

    #include <pfe/double-sub.h>

_export P4_GCC_CONST fdiv_t p4_fdiv(p4cell num, p4cell denom)

### Description

floored divide procedure, single prec

0.33.71
0.33.71 pfe
p4_u_d_div 3
p4_u_d_div _ud/_

    #include <pfe/double-sub.h>

_export p4ucell p4_u_d_div(p4udcell *ud, p4ucell denom)

### Description

Divides *ud by denom, leaves result in *ud, returns remainder. For number output conversion: dividing by BASE.

0.33.71
0.33.71 pfe
p4_u_d_mul 3
p4_u_d_mul _ud*_

    #include <pfe/double-sub.h>

_export void p4_u_d_mul(p4udcell *ud, p4ucell w, p4ucell c)

### Description

Computes *ud * w + c, where w is actually only half of a cell in size. Leaves result in *ud. For number input conversion: multiply by BASE and add digit.

0.33.71
0.33.71 pfe
p4_dig2num 3
p4_dig2num _dig>num_ ( c n* base -- ?ok )

    #include <pfe/double-sub.h>

_export int p4_dig2num(p4_char_t c, p4ucell *n, p4ucell base)

### Description

Get value of digit c into *n, return flag: valid digit.

0.33.71
0.33.71 pfe
p4_num2dig 3
p4_num2dig _num2dig_ ( val -- c )

    #include <pfe/double-sub.h>

_export P4_GCC_CONST char p4_num2dig(p4ucell n)

### Description

make digit

0.33.71
0.33.71 pfe
p4_number_question 3
p4_number_question _?number_ ( str* str# dcell* -- ?ok )

    #include <pfe/double-sub.h>

_export int p4_number_question(const p4_char_t *p, p4ucell n, p4dcell *d)

### Description

try to convert into number, see => ?NUMBER

0.33.71
0.33.71 pfe
p4_str_ud_dot_r 3
p4_str_ud_dot_r _ud.r_ ( d,d str* str# base -- str* )

    #include <pfe/double-sub.h>

_export char * p4_str_ud_dot_r(p4udcell ud, char *p, int w, int base)

### Description

This is for internal use only (SEE and debugger), The real `UD`.R etc. words uses `HOLD` and the memory area below `PAD`

0.33.71
0.33.71 pfe
p4_str_d_dot_r 3
p4_str_d_dot_r _d.r_ ( d,d str* str# base -- str* )

    #include <pfe/double-sub.h>

_export char * p4_str_d_dot_r(p4dcell d, char *p, int w, int base)

### Description

This is for internal use only (SEE and debugger), The real `UD`.R etc. words use `HOLD` and the memory area below `PAD`

0.33.71
0.33.71 pfe
p4_str_dot 3
p4_str_dot _._ ( i str* str# base -- str* )

    #include <pfe/double-sub.h>

_export char * p4_str_dot(p4cell n, char *p, int base)

### Description

This is for internal use only (SEE and debugger), The real => . etc. words use `HOLD` and the memory area below `PAD`

0.33.71
0.33.71 pfe
p4_outc 3
p4_outc _outc_ ( char -- ) [alias] _outc

    #include <pfe/double-sub.h>

_export void p4_outc(char c)

### Description

emit single character, (output adjusting the `OUT` variable, see `_putc_` to do without)

      : _emit_ _putc_ _?xy_ drop out ! ;

0.33.71
0.33.71 pfe
p4_outf 3
p4_outf _outf_ ( ... zstr* -- n# )

    #include <pfe/double-sub.h>

int p4_outf(const char *s,...)

### Description

type a string with formatting (output adjusting the `OUT` variable, see `_puts_` and `_outs_` )

      : _outf_ 0x200 lbuffer: buf[]  buf[] _vsprintf_  buf[] _outs_ ;

0.33.71
0.33.71 pfe
p4_type_on_line 3
p4_type_on_line _typeline_ ( str* str# -- )

    #include <pfe/double-sub.h>

_export void p4_type_on_line(const p4_char_t *str, p4cell len)

### Description

type counted string to terminal, if it does not fit in full on the current line, emit a `CR` before (output adjusting the OUT variable, see `_type_` and `_outs_` )

      : _typeline_ out @ over + cols @ &gt; if cr then _type_ ;

0.33.71
0.33.71 pfe
p4_emits 3
p4_emits _emits_ ( n# ch -- )

    #include <pfe/double-sub.h>

_export void p4_emits(int n, const char c)

### Description

type a string of chars by repeating a single character which is usually a space, see `SPACES` (output adjusting the OUT variable, see `_type_` and `_outs_` )

      : _emits_ swap 0 do dup _putc_ loop drop _flush_ _?xy_ drop out ! ;

0.33.71
0.33.71 pfe
p4_tab 3
p4_tab _tab_ ( n# -- )

    #include <pfe/double-sub.h>

_export void p4_tab(int n)

### Description

type a string of space up to the next tabulator column (output adjusting the OUT variable, see `_emits` and `_typeonline` )

      : _tab_ dup out @ - swap mod bl _emits_ ;

0.33.71
0.33.71 pfe
p4_dot_line 3
p4_dot_line _.line_ ( file* block# line# -- )

    #include <pfe/double-sub.h>

_export void p4_dot_line(p4_File *fid, p4cell n, p4cell l)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_query 3
p4_query QUERY ( -- )

    #include <pfe/double-sub.h>

FCode p4_query ---

### Description

source input: read from terminal using `_accept_` with the returned string to show up in `TIB` of `/TIB` size.

0.33.71
0.33.71 pfe
p4_next_line 3
p4_next_line ...

    #include <pfe/double-sub.h>

_export p4_bool_t p4_next_line(void)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_size_saved_input 3
p4_size_saved_input _size_saved_input_ ( -- iframe-size )

    #include <pfe/double-sub.h>

_export p4ucell p4_size_saved_input(void)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_link_saved_input 3
p4_link_saved_input _link_saved_input_ ( iframe* -- )

    #include <pfe/double-sub.h>

_export void p4_link_saved_input(void *p)

### Description

see `SAVE-INPUT`

0.33.71
0.33.71 pfe
p4_unlink_saved_input 3
p4_unlink_saved_input _unlink_saved_input_ ( iframe* -- )

    #include <pfe/double-sub.h>

_export void p4_unlink_saved_input(void *p)

### Description

see `RESTORE-INPUT`

0.33.71
0.33.71 pfe
p4_skip_delimiter 3
p4_skip_delimiter _skip_delimiter_ ( del -- )

    #include <pfe/double-sub.h>

_export void p4_skip_delimiter(char del)

### Description

`SKIP-DELIMITER`

0.33.71
0.33.71 pfe
p4_word_parse 3
p4_word_parse _word:parse_ ( delim -- <end?> )

    #include <pfe/double-sub.h>

_export p4_cell_t p4_word_parse(char del)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_word_to_here 3
p4_word_to_here _word>here_ ( -- here* )

    #include <pfe/double-sub.h>

_export char* p4_word_to_here(void)

### Description

complement `_word:parse_` to arrive at the normal `WORD` implementation will also ensure the string is zero-terminated - this makes a lot of operations easier since most forth function can receive a string-span directly but some need a string-copy and that is usually because it has to be passed down into a C-defined function with zerotermined string. Just use p4_HERE+1 (which is also the returnvalue of the `p4_word_to_here` function!) to have the start of the zero-terminated string. Note that the `p4_word_to_here` function may throw with P4_ON_PARSE_OVER if the string is too long (it has set *DP=0 to ensure again that `THROW` will report PFE.word. as the offending string)

0.33.71
0.33.71 pfe
p4_debug 3
p4_debug DEBUG ( "word" -- ) [FTH]

    #include <pfe/debug-ext.h>

FCode p4_debug ---

### Description

this word will place an debug-runtime into the `CFA` of the following word. If the word gets executed later, the user will be prompted and can decide to single-step the given word. The debug-stepper is interactive and should be self-explanatory. (use `NO-DEBUG` to turn it off again)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_no_debug 3
p4_no_debug NO-DEBUG ( "word" -- ) [FTH]

    #include <pfe/debug-ext.h>

FCode p4_no_debug ---

### Description

the inverse of " `DEBUG` word "

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren_see 3
p4_paren_see (SEE) ( some-xt* -- ) [FTH]

    #include <pfe/debug-ext.h>

FCode p4_paren_see ---

### Description

decompile the token-sequence - used by `SEE` name

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_addr_to_name 3
p4_addr_to_name ADDR>NAME ( word-addr* -- word-nfa*!' | 0 ) [FTH]

    #include <pfe/debug-ext.h>

_export p4_namebuf_t const * p4_addr_to_name(const p4_byte_t* addr)

### Description

search the next corresponding namefield that address is next too. If it is not in the base-dictionary, then just return 0 as not-found.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_come_back 3
p4_come_back COME_BACK ( -- ) [FTH]

    #include <pfe/debug-ext.h>

FCode p4_come_back ---

### Description

show the return stack before last exception along with the best names as given by `ADDR>NAME`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_make_wordlist 3
p4_make_wordlist

    #include <pfe/dict-sub.h>

_export p4_Wordl * p4_make_wordlist(p4char* nfa)

### Description

create a word list in the dictionary

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_forget_dp 3
p4_forget_dp ((FORGET))

    #include <pfe/dict-sub.h>

FCode p4_forget_dp ---

### Description

remove words from dictionary, free dictionary space, this is the runtime helper of `(FORGET)`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_forget 3
p4_forget (FORGET)

    #include <pfe/dict-sub.h>

_export void p4_forget(p4_byte_t* above)

### Description

forget anything above address

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_forget_word 3
p4_forget_word ...

    #include <pfe/dict-sub.h>

_export p4_namebuf_t* p4_forget_word(const char *name, p4cell id, p4code ccode, p4cell what)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_tick_nfa 3
p4_tick_nfa ...

    #include <pfe/dict-sub.h>

_export p4char * p4_tick_nfa(void)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_tick_cfa 3
p4_tick_cfa ...

    #include <pfe/dict-sub.h>

_export p4xt p4_tick_cfa(void)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_only_RT 3
p4_only_RT ONLY ( -- )

    #include <pfe/dict-sub.h>

FCode p4_only_RT ---

### Description

the only-vocabulary is special. Calling it will erase the search `ORDER` of vocabularies and only allows to name some very basic vocabularies. Even `ALSO` is not available.

      example:
        ONLY FORTH ALSO EXTENSIONS ALSO DEFINITIONS

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_forth_RT 3
p4_forth_RT FORTH ( -- )

    #include <pfe/dict-sub.h>

FCode p4_forth_RT ---

### Description

      : FORTH FORTH-WORDLIST CONTEXT ! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dlinit 3
p4_dlinit dlfcn: init dl symbol table, dl error
_export int p4_dlinit(void)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dlerror 3
p4_dlerror dlfcn: describe last dl-error
_export const char* p4_dlerror(void)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dlopenext 3
p4_dlopenext dlfcn: load shared-object into program codespace
_export void* p4_dlopenext(const char* name)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dlclose 3
p4_dlclose dlfcn: remove shared-object from program codespace
_export int p4_dlclose(const void* lib)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dlsym 3
p4_dlsym dlfcn: find symbol in loaded object
_export void* p4_dlsym(const void* lib, const char* symbol)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dladdr 3
p4_dladdr dlfcn: find name for address
_export char* p4_dladdr(void* addr, int* offset)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_slot_use 3
p4_slot_use
int p4_slot_use(int* var)

### Description

request a slot index. The index is written to the variable arg-address. if the arg-address contains a value != 0, we check if that specific slot index is free for assignment - or already assigned to this variable. a slot_use can be done for the same slot-variable multiple times, which will increase a use-counter. Call slot_unuse correspondingly.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_slot_unuse 3
p4_slot_unuse ...
int p4_slot_unuse(int* var)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren_loadm 3
p4_paren_loadm (LOADM) ( module-bstr* -- module-sucess# ) [FTH]
FCode p4_paren_loadm ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_loadm 3
p4_loadm LOADM ( "filename" -- ) [FTH]
FCode p4_loadm ---

### Description

dlmap the shared object (or share an already mapped object) and run the per-thread initialization code. This is the user-convenient function, otherwise use `(LOADM)`

      simulate:
        : LOADM  BL WORD
          ((IS_MODULE_LOADED)) IF EXIT THEN
          HERE (LOADM)  0= IF ." -- load failed: " HERE COUNT TYPE CR THEN ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_local_dlsym 3
p4_local_dlsym LOCAL-DLSYM ( [symbol] -- symbol-addr ) [FTH] [EXEC]
FCode p4_local_dlsym ---

### Description

lookup the symbol that follows and leave the address (or null)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_local_dlcall 3
p4_local_dlcall LOCAL_DLCALL ( x...[8] [symbol] -- x...[8] ) [FTH] [EXEC]
FCode p4_local_dlcall ---

### Description

does not do any stack changes, the caller must clean up the stack himself. You don't even get the return value (sigh)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_lt_dlinit 3
p4_lt_dlinit lt_dlinit ( -- dlinit-ior# ) [FTH]
FCode p4_lt_dlinit ---

### Description

initialiize library, usually open the program itself so that its handles can be found under "0"

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_lt_dlopenext 3
p4_lt_dlopenext lt_dlopenext ( module-ptr module-len -- module-dl-handle*! | 0 ) [FTH]
FCode p4_lt_dlopenext ---

### Description

walk the searchpath for dlopen and try to open a binary module under the given name with the usual file extension for the current system.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_lt_dlsym 3
p4_lt_dlsym lt_dlsym ( symbol-ptr symbol-len module-dl-handle* -- symbol*! | 0 ) [FTH]
FCode p4_lt_dlsym ---

### Description

try to find the name in the binary module denoted by its handle .. if handle is null, use the main body of the program

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_lt_dlcose 3
p4_lt_dlcose lt_dlclose ( module-dl-handle* -- module-ior# ) [FTH]
FCode p4_lt_dlcose ---

### Description

close handle that was returned by `lt_dlopenext`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_lt_dlerror 3
p4_lt_dlerror lt_dlerror ( -- dlerror-zstr* )
FCode p4_lt_dlerror ---

### Description

returns string describing the last dlerror as for `lt_dlopenext` and `lt_dlsym`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_constant_RT 3
p4_two_constant_RT (2CONSTANT) ( -- x1 x2 )

    #include <pfe/double-ext.h>

FCode_RT p4_two_constant_RT ---

### Description

runtime portion of `2CONSTANT`

0.33.71
0.33.71 pfe
p4_two_constant 3
p4_two_constant 2CONSTANT ( x1 x2 "name" -- )

    #include <pfe/double-ext.h>

FCode p4_two_constant ---

### Description

create a word that contains the specified twocell number in its body. when the name is executed, these numbers are left on the stack

        12. 2CONSTANT X .s
        &lt;emtpy stack&gt; ok
        X .s
        0 12 ok

0.33.71
0.33.71 pfe
p4_two_literal_execution 3
p4_two_literal_execution (2LITERAL) ( -- x1 x2 )

    #include <pfe/double-ext.h>

FCode_XE p4_two_literal_execution ---

### Description

runtime portion of `2LITERAL`

0.33.71
0.33.71 pfe
p4_two_literal 3
p4_two_literal 2LITERAL ( x1 x2 -- ) immediate

    #include <pfe/double-ext.h>

FCode p4_two_literal ---

### Description

compile a double-cell number to the current definition. When run, the doubele-cell is left on the stack for execution.

        ( -- x1 x2 )

(in most configurations this word is statesmart and it will do nothing in interpret-mode. See `2LITERAL,` for a non-immediate variant)

0.33.71
0.33.71 pfe
p4_two_variable 3
p4_two_variable 2VARIABLE ( -- )

    #include <pfe/double-ext.h>

FCode p4_two_variable ---

### Description

`CREATE` a new variable definition. When executed leave the `>BODY` address on stack. In pfe, the data area of a `2VARIABLE` is `ERASE`d initially.

0.33.71
0.33.71 pfe
p4_d_plus 3
p4_d_plus D+ ( d1.ud1 d2.ud2 -- d3.ud3 )

    #include <pfe/double-ext.h>

FCode p4_d_plus ---

### Description

the double-cell sum operation ( `+` )

0.33.71
0.33.71 pfe
p4_d_minus 3
p4_d_minus D-( d1.ud1 d2.ud2 -- d3.ud3 )

    #include <pfe/double-ext.h>

FCode p4_d_minus ---

### Description

the double-cell diff operation ( `-` )

0.33.71
0.33.71 pfe
p4_d_dot_r 3
p4_d_dot_r D.R ( d1.d1 n -- )

    #include <pfe/double-ext.h>

FCode p4_d_dot_r ---

### Description

aligned output for a double-cell number ( => .R )

0.33.71
0.33.71 pfe
p4_d_dot 3
p4_d_dot D. ( d1.d1 -- )

    #include <pfe/double-ext.h>

FCode p4_d_dot ---

### Description

freefield output for a double-cell number ( => . )

0.33.71
0.33.71 pfe
p4_d_zero_less 3
p4_d_zero_less D0< ( d1.d1 -- flag )

    #include <pfe/double-ext.h>

FCode p4_d_zero_less ---

### Description

the double-cell less-than-zero operation ( `0<` )

0.33.71
0.33.71 pfe
p4_d_zero_equals 3
p4_d_zero_equals D0= ( d1.d1 -- flag )

    #include <pfe/double-ext.h>

FCode p4_d_zero_equals ---

### Description

the double-cell equal-to-zero operation ( `0=` )

0.33.71
0.33.71 pfe
p4_d_two_star 3
p4_d_two_star D2* ( d1.d1 -- d1.d1' )

    #include <pfe/double-ext.h>

FCode p4_d_two_star ---

### Description

the double-cell arithmetic shiftleft-by-1 operation ( `2*` )

0.33.71
0.33.71 pfe
p4_d_two_slash 3
p4_d_two_slash D2/ ( d1.d1 -- d1.d1' )

    #include <pfe/double-ext.h>

FCode p4_d_two_slash ---

### Description

the double-cell arithmetic shiftright-by-1 operation ( `2/` )

0.33.71
0.33.71 pfe
p4_d_less 3
p4_d_less D< ( d1.d1 d2.d2 -- flag )

    #include <pfe/double-ext.h>

FCode p4_d_less ---

### Description

the double-cell is-less operation ( `<` )

0.33.71
0.33.71 pfe
p4_d_to_s 3
p4_d_to_s D>S ( d.d -- n )

    #include <pfe/double-ext.h>

FCode p4_d_to_s ---

### Description

result is the numeric equivalent of d. If the double number was greater than what could fit into a single cell number, the modulo cellsize will be left since the higher-significant bits are just `DROP`ed

0.33.71
0.33.71 pfe
p4_d_equals 3
p4_d_equals D= ( d1.d1 d2.d2 -- flag )

    #include <pfe/double-ext.h>

FCode p4_d_equals ---

### Description

the double-cell is-equal operation ( `=` )

0.33.71
0.33.71 pfe
p4_d_abs 3
p4_d_abs DABS ( d1.d1 -- d1.d1' )

    #include <pfe/double-ext.h>

FCode p4_d_abs ---

### Description

the double-cell abs operation ( `ABS` )

0.33.71
0.33.71 pfe
p4_d_max 3
p4_d_max DMAX ( d1.d1 d2.d2 -- d1.d1|d2.d2 )

    #include <pfe/double-ext.h>

FCode p4_d_max ---

### Description

the double-cell max operation ( `MAX` )

0.33.71
0.33.71 pfe
p4_d_min 3
p4_d_min DMIN ( d1.d1 d2.d2 -- d1.d1|d2.d2 )

    #include <pfe/double-ext.h>

FCode p4_d_min ---

### Description

the double-cell max operation ( `MIN` )

0.33.71
0.33.71 pfe
p4_d_negate 3
p4_d_negate DNEGATE ( d1.d1 -- d1.d1' )

    #include <pfe/double-ext.h>

FCode p4_d_negate ---

### Description

the double-cell arithmetic negate operation ( `NEGATE` )

0.33.71
0.33.71 pfe
p4_m_star_slash 3
p4_m_star_slash "M*\/" ( d1.d1 n1 +n2 -- d2.d2 )

    #include <pfe/double-ext.h>

FCode p4_m_star_slash ---

### Description

the double-cell multiply-divide operation using a triple-cell intermediate result for `*` ( `*\/` )

0.33.71
0.33.71 pfe
p4_m_plus 3
p4_m_plus "M+" ( d1.d1 n1 -- d2.d2 )

    #include <pfe/double-ext.h>

FCode p4_m_plus ---

### Description

the double-cell mixed-operand sum operation ( `+` / `D+` )

0.33.71
0.33.71 pfe
p4_two_rot 3
p4_two_rot 2ROT ( d1,d1 d2,d2 d3,d3 -- d2,d2 d3,d3 d1,d1 )

    #include <pfe/double-mix.h>

FCode p4_two_rot ---

### Description

the double-cell `ROT` operation. actively moves six cells, i.e.

        ( x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2 )

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_d_u_less 3
p4_d_u_less DU< ( d1,d1 d2,d2 -- flag )

    #include <pfe/double-mix.h>

FCode p4_d_u_less ---

### Description

the double-cell unsigned-is-less operation ( `U<` )

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_literal_comma 3
p4_literal_comma LITERAL, ( value -- )

    #include <pfe/double-mix.h>

FCode p4_literal_comma ---

### Description

take the value from stack (or cs-stack) and compile a runtime-code and the value as for `LITERAL` ... this word is never state-smart, it is not immediate, and has therefore no complications with `POSTPONE` (compare also with `COMPILE,` to make a call-stub with an exectoken)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_literal_comma 3
p4_two_literal_comma 2LITERAL, ( x1,x2 -- )

    #include <pfe/double-mix.h>

FCode p4_two_literal_comma ---

### Description

take the double-value from stack (or cs-stack) and compile a runtime-code and the value as for `2LITERAL` ... this word is never state-smart, it is not immediate, and has therefore no complications with `POSTPONE` (compare also with `COMPILE,` to make a call-stub with an exectoken)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dcells 3
p4_dcells DCELLS ( x -- x' )

    #include <pfe/double-mix.h>

FCode p4_dcells ---

### Description

computes the number of address units for the specified number of double-cells

      : DCELLS CELLS 2* ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_d_shiftleft 3
p4_d_shiftleft DLSHIFT ( x1,x2 y -- z1,z2 )

    #include <pfe/double-mix.h>

FCode p4_d_shiftleft ---

### Description

shift-left a double-cell value. The shift-count is given as a single-cell.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_d_shiftright 3
p4_d_shiftright DRSHIFT ( x1,x2 y -- z1,z2 )

    #include <pfe/double-mix.h>

FCode p4_d_shiftright ---

### Description

shift-right a double-cell value. The shift-count is given as a single-cell. This is an arithmetic shift as for a signed double-cell value.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_um_plus 3
p4_um_plus add b to a

    #include <pfe/double-sub.h>

_export void p4_um_plus(p4dcell * a, p4ucell b)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_d_ummul 3
p4_d_ummul unsigned multiply, mixed precision

    #include <pfe/double-sub.h>

_export p4udcell p4_d_ummul(p4ucell a, p4ucell b)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_d_mmul 3
p4_d_mmul signed multiply, mixed precision

    #include <pfe/double-sub.h>

_export p4dcell p4_d_mmul(p4cell a, p4cell b)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_d_umdiv 3
p4_d_umdiv unsigned divide procedure, mixed precision

    #include <pfe/double-sub.h>

_export udiv_t p4_d_umdiv(p4udcell num, p4ucell denom)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_d_smdiv 3
p4_d_smdiv symmetric divide procedure, mixed precision

    #include <pfe/double-sub.h>

_export fdiv_t p4_d_smdiv(p4dcell num, p4cell denom)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_d_fmdiv 3
p4_d_fmdiv floored divide procedure, mixed precision

    #include <pfe/double-sub.h>

_export fdiv_t p4_d_fmdiv(p4dcell num, p4cell denom)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_empty_str 3
p4_empty_str EMPTY$ ( $: -- empty$ )

    #include <pfe/def-config.h>

FCode p4_empty_str ---

### Description

Push the MSA of a fixed, external representation of the empty string onto the string stack. "empty-string"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_newline_str 3
p4_newline_str \n$ ( $: -- newline$ )

    #include <pfe/def-config.h>

FCode p4_newline_str ---

### Description

Push the MSA of a fixed, external string whose body is the Unix newline character onto the string stack. "newline-string"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_parens_m_store 3
p4_parens_m_store (M!) ( a.s msa -- )

    #include <pfe/def-config.h>

FCode p4_parens_m_store ---

### Description

(M!) is the same as Wil Baden's PLACE, except it assumes the buffer address msa to be aligned, and stores the ANS Forth string a.s as a measured string, zero-filled to trailing alignment. As with PLACE, it is assumed that the mstring copy does not clobber the old string, and there is no check for room starting at msa. "parens-m-store"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_parse_to_s 3
p4_parse_to_s PARSE>S ( [ccc<char;>] char -- addr len )

    #include <pfe/def-config.h>

FCode p4_parse_to_s ---

### Description

Parse the input stream up to the first occurrence of char, which is parsed away. If executing in compilation mode, append run-time semantics to the current definition that leaves the ANS Forth string representation on the stack. In interpretation mode, leave the ANS Forth string representation for a stored copy, which may be transient in the style of `S`". In either mode, the format of the stored string is implementation dependent. "parse-to-s"

NOTE: The interpreted copy is a nontransient in this implementation, and both copies are mstrings.

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_s_back_tick 3
p4_s_back_tick S` ( [ccc<`>] -- addr len )

    #include <pfe/def-config.h>

FCode p4_s_back_tick ---

### Description

An immediate version of parse>s where the delimiter is `. In particular, the stored string in interpret mode is not transient. "s-back-tick"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_m_comma_s 3
p4_m_comma_s M,S ( addr len -- addr' len )

    #include <pfe/def-config.h>

FCode p4_m_comma_s ---

### Description

ALLOT room and store the ANS Forth string into aligned data space as an mstring, leaving data space zero-filled to alignment; and leave the length and new body address. It is assumed that len is unsigned. An error is thrown if len is larger than the system parameter `MAX_DATA_STR`. "m-comma-s"

NOTE: `MAX_DATA_STR` is returned by

        S" /SCOPY" ENVIRONMENT?

NOTE: `M,S` differs from `STRING,` in Wil Baden's Tool Belt in that it stores an aligned, measured string with zero-filled alignment instead of a counted string, and it leaves the ANS Forth string representation of the stored string.

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_m_count_fetch 3
p4_m_count_fetch MCOUNT@ ( msa -- count )

    #include <pfe/def-config.h>

FCode p4_m_count_fetch ---

### Description

Fetch the count of the mstring at msa. "m-count-fetch"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_m_count_store 3
p4_m_count_store MCOUNT! ( count msa -- )

    #include <pfe/def-config.h>

FCode p4_m_count_store ---

### Description

Store the count in the measured string count field at msa, without checking that it fits. "m-count-store"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_m_count 3
p4_m_count MCOUNT ( msa -- body.addr count )

    #include <pfe/def-config.h>

FCode p4_m_count ---

### Description

Convert the mstring MSA to its ANS Forth string representation. "m-count"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_minus_m_count 3
p4_minus_m_count -MCOUNT ( addr len -- msa )

    #include <pfe/def-config.h>

FCode p4_minus_m_count ---

### Description

Convert the ANS Forth representation of an mstring to its MSA. "minus-m-count"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_zero_strings 3
p4_zero_strings 0STRINGS ( -- )

    #include <pfe/def-config.h>

FCode p4_zero_strings ---

### Description

Set all string variables holding bound string values in string space to the empty string, and clear string space, including the string buffer, string stack, and string stack frames. "zero-strings"

NOTE: If used for under the hood development, this word must be executed only when string space is in a valid state.

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_garbage_Q 3
p4_str_garbage_Q $GARBAGE? ( -- flag )

    #include <pfe/def-config.h>

FCode p4_str_garbage_Q ---

### Description

Leave true if there is garbage in the current string space. Not normally used, since garbage collection is transparent. "string-garbage-question"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_gc_off 3
p4_str_gc_off $GC-OFF ( -- )

    #include <pfe/def-config.h>

FCode p4_str_gc_off ---

### Description

Disable garbage collection in the current string space. An error will be thrown if garbage collection is attempted. "string-g-c-off"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_gc_on 3
p4_str_gc_on $GC-ON ( -- )

    #include <pfe/def-config.h>

FCode p4_str_gc_on ---

### Description

Enable garbage collection in the current string space. This is the default. "string-g-c-on"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_gc_lock_fetch 3
p4_str_gc_lock_fetch $GC-LOCK@ ( -- flag )

    #include <pfe/def-config.h>

FCode p4_str_gc_lock_fetch ---

### Description

Fetch the dstring garbage collection "off" state. Intended for saving the off state for later restoration after a usage of `$GC-ON` or `$GC-OFF`. "string-g-c-lock-fetch"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_gc_lock_store 3
p4_str_gc_lock_store $GC-LOCK! ( flag -- )

    #include <pfe/def-config.h>

FCode p4_str_gc_lock_store ---

### Description

Set the dstring garbage collection "off" state according to flag. Intended for restoring the off state previously fetched by `$GC-LOCK@`. "string-g-c-lock-fetch"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_unused 3
p4_str_unused $UNUSED ( -- u )

    #include <pfe/def-config.h>

FCode p4_str_unused ---

### Description

Leave the number of bytes available for dynamic strings and string stack entries in the string buffer. "string-unused"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_collect_str_garbage 3
p4_collect_str_garbage COLLECT-$GARBAGE ( -- collected-flag )

    #include <pfe/def-config.h>

FCode p4_collect_str_garbage ---

### Description

If string space is not marked as containing garbage, return false. If there is garbage, throw an error when garbage collection is disabled. Otherwise remove the garbage and return true. Garbage collection is "transparent", so the user would not normally use this word. "collect-string-garbage"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_make_str_space 3
p4_make_str_space MAKE-$SPACE ( size #frames -- addr )

    #include <pfe/def-config.h>

FCode p4_make_str_space ---

### Description

Allocate and initialize a string space with size bytes available for the string buffer including the string stack, and with a string frame stack for frame description entries holding up to #frames. The size is rounded up to cell alignment, and the buffer begins and ends with cell alignment. Return addr, the address of the string space. The standard word `FREE` with addr as input can be used to release the space. "make-string-space"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_slash_str_buf 3
p4_slash_str_buf /$BUF ( -- u )

    #include <pfe/def-config.h>

FCode p4_slash_str_buf ---

### Description

Leave the size in address units allocated for the current string buffer. "slash-string-buf"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_max_num_str_frames 3
p4_max_num_str_frames MAX-#$FRAMES ( -- u )

    #include <pfe/def-config.h>

FCode p4_max_num_str_frames ---

### Description

Leave the number of string frames allowed on the string frame stack for the current string space. "max-number-string-frames"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_store 3
p4_str_store $! ( $var.dfa $: a$ -- )

    #include <pfe/def-config.h>

FCode p4_str_store ---

### Description

Store the string MSA on the string stack in the variable whose DFA is on the parameter stack. "string-store"

NOTES: The only situation in which `$!` copies the string value is when it is a bound string already stored in another variable. In that case, the new copy is the one that is stored in the variable. In particular, external strings are not copied.

If the string value held by the string variable on entry is a bound string that is also referenced deeper on the string stack, its back link is reset to point to the deepest string stack reference. If it is a bound string not deeper on the string stack and not identical to the input string, its back link is set to zero, making it garbage. If it is an external string, its MSA in the variable is simply written over by that popped from the string stack.

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_fetch 3
p4_str_fetch $@ ( $var.pfa -- $: a$ )

    #include <pfe/def-config.h>

FCode p4_str_fetch ---

### Description

Leave the MSA of the string held by the string variable. "string-fetch"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_quote 3
p4_str_quote $" ( [ccc<">] -- $: str )

    #include <pfe/def-config.h>

FCode p4_str_quote ---

### Description

Parse ccc delimited by " (double quote) and store it in data space as an mstring. If interpreting, leave the MSA on the string stack. If compiling, append run-time semantics to the current definition that leaves the MSA on the string stack. A program should not alter the stored string. An error is thrown if the quoted string length is larger than the system parameter `MAX_DATA_STR` (see `SM,`). "string-quote"

NOTE: In contrast to `S"`, the string stored by `$"` when interpreting is not transient.

The implementation is based on PFE code for `S"`.

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_back_tick 3
p4_str_back_tick $` ( [ccc<`>] -- $: str )

    #include <pfe/def-config.h>

FCode p4_str_back_tick ---

### Description

Parse ccc delimited by ` (back-tick). This is `"$""` with back tick instead of double quote as the delimiter. "string-back-tick"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_constant 3
p4_str_constant $CONSTANT ( "name" $: a$ -- )

    #include <pfe/def-config.h>

FCode p4_str_constant ---

### Description

Create a definition for "name" with the execution semantics "name" execution: ($: -- a$ )

It is assumed that the input string resides as a measured, unchanging string outside of string space. "string-constant"

For example:

        $" This is a sample string." $constant sample$

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_variable 3
p4_str_variable $VARIABLE ( "name" -- )

    #include <pfe/def-config.h>

FCode p4_str_variable ---

### Description

        "name" execution:	( -- dfa )

Create an ordinary Forth variable and initialize it to the address of a fixed, external, measured representation of the empty string, such as that pushed onto the string stack by `EMPTY\$`. "string-variable""

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_parse_to_str 3
p4_parse_to_str PARSE>$ ( [ccc<char;>] char -- $: ccc$ )

    #include <pfe/def-config.h>

FCode p4_parse_to_str ---

### Description

Parse the input stream up to the first occurrence of char, which is parsed away, and store the string as an external measured string. If executing in compilation mode, append run-time semantics to the current definition that leaves the MSA on the string stack. In interpretation mode, leave the MSA on the string stack, where the stored copy, unlike `PARSE>S`, is required to be nontransient.

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_two_drop 3
p4_str_two_drop $2DROP ( $: a$ b$ -- )

    #include <pfe/def-config.h>

FCode p4_str_two_drop ---

### Description

Drop the two topmost string stack entries, marking them as garbage if appropriate. "string-two-drop"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_two_dup 3
p4_str_two_dup $2DUP ( $: a$ b$ -- a$ b$ a$ b$ )

    #include <pfe/def-config.h>

FCode p4_str_two_dup ---

### Description

Leave copies of the two topmost string stack entries. The string values are not copied. "string-two-dupe"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_depth 3
p4_str_depth $DEPTH ( -- n )

    #include <pfe/def-config.h>

FCode p4_str_depth ---

### Description

Leave the number of items on the string stack. "string-depth"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_drop 3
p4_str_drop $DROP ( $: a$ -- )

    #include <pfe/def-config.h>

FCodep4_str_drop ---

### Description

Drop the topmost string stack entry, marking it as garbage if it is initially bound to the top of the string stack. "string-drop"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_dup 3
p4_str_dup $DUP ( $: a$ -- a$ a$ )

    #include <pfe/def-config.h>

FCode p4_str_dup ---

### Description

Leave a copy of the topmost string stack entry. The string value is not copied. "string-dupe"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_nip 3
p4_str_nip $NIP ($: a$ b$ -- b$ )

    #include <pfe/def-config.h>

FCode p4_str_nip ---

### Description

Drop the next to top item from the string stack. "string-nip"

NOTE: Because of essential string space bookkeeping, the system level implementation can be little more efficient than the high-level definition:

        : $NIP  $SWAP $DROP ;

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_over 3
p4_str_over $OVER ( $: a$ b$ -- a$ b$ a$ )

    #include <pfe/def-config.h>

FCode p4_str_over ---

### Description

Leave a copy of the next most accessible string stack entry on top of the string stack. The string value is not copied. "string-over"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_pick 3
p4_str_pick $PICK ( u $: au$ ... a0$ -- au$ ... a0$ au$ )

    #include <pfe/def-config.h>

FCode p4_str_pick ---

### Description

Copy the u-th string stack entry to the top of the string stack. The string value is not copied. Throw an error if the input string stack does not have at least u+1 items. "string-pick"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_swap 3
p4_str_swap $SWAP ( $: a$ b$ -- b$ a$ )

    #include <pfe/def-config.h>

FCode p4_str_swap ---

### Description

Exchange the two most accessible strings on the string stack. Throw an error if there are less than two strings on the stack. Neither string value is copied. "string-swap"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_exchange 3
p4_str_exchange $EXCHANGE ( i j -- )

    #include <pfe/def-config.h>

FCode p4_str_exchange ---

### Description

($: maxth$ ... minth$ ... -- minth$ ... maxth$ ... ) Exchange the ith and jth strings on the string stack, where the top is the 0th. Throw an error if there are not at least max[i,j] + 1 strings on the stack. Neither string value is copied. "string-exchange"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_s_from 3
p4_str_s_from $S> ( $: a$ -- S: a.s )

    #include <pfe/def-config.h>

FCode p4_str_s_from ---

### Description

Drop a$ from the string stack and leave it as a ANS Forth string a.s, without copying. "string-s-from"

WARNING: If a$ is a bound string, it may move or disappear at the next garbage collection, making a.s invalid. This can be avoided by sandwiching sections of code where this could occur between $GC-OFF and $GC-ON.

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_comma_s 3
p4_str_comma_s $,S ( $: a$ -- S: a.s )

    #include <pfe/def-config.h>

FCode p4_str_comma_s ---

### Description

Drop a$ from the string stack, copy it into data space as a measured string, and leave it as an ANS Forth string a.s. An error is thrown if the string length is larger than the system parameter `MAX_DATA_STR` (see `M,S`). "string-comma-s"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_s_fetch 3
p4_str_s_fetch $S@ ( $: a$ -- a$ S: a.s )

    #include <pfe/def-config.h>

FCode p4_str_s_fetch ---

### Description

Leave the string stack unchanged, and leave the string body address and length on the data stack. "string-s-fetch"

WARNING: If a$ is a bound string, it may move at the next garbage collection, making a.s invalid. This can be avoided by sandwiching sections of code where this could occur between $GC-OFF and $GC-ON.

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_tuck 3
p4_str_tuck $TUCK ($: a$ b$ -- b$ a$ b$ )

    #include <pfe/def-config.h>

FCode p4_str_tuck ---

### Description

Copy the top string stack item just below the second item. The string value is not copied. "string-tuck"

NOTE: Because of essential string space bookkeeping, the system level implementation can be little more efficient than the high-level definition:

        : $TUCK  $SWAP $OVER ;

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_to_str_s 3
p4_to_str_s >$S ( a.s -- $: a$ )

    #include <pfe/def-config.h>

FCode p4_to_str_s ---

### Description

Push the external ANS Forth string a.s onto the string stack, without copying the string value into the string buffer. It is an unchecked error if the Forth string a.s is not stored as an external measured string. "to-string-s"

WARNING: If the string value of a.s is actually in the string buffer and not external, the push operation may generate a garbage collection that invalidates its MSA.

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_to_str_s_copy 3
p4_to_str_s_copy >$S-COPY ( a.s -- $: a$ )

    #include <pfe/def-config.h>

FCode p4_to_str_s_copy ---

### Description

Copy the external string value whose body address and count are on the parameter stack into the string buffer and push it onto the string stack. Errors are thrown if the count is larger than `MAX_MCOUNT`, if there is not enough room in string space, even after garbage collection, or if there is an unterminated string concatenation. The input external string need not exist as a measured string. "to-string-s-copy"

NOTE: `MAX_MCOUNT` is the largest size the count field of a measured string can hold, e.g., 255, 64K-1, or 4,096M-1. It is returned by:

        S" /DYNAMIC-STRING" ENVIRONMENT?

WARNING: This word should not be used when the input string is a bound string because the copy operation may generate a garbage collection which invalidates its MSA.

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_plus 3
p4_str_plus $+ ($: a$ -- )

    #include <pfe/def-config.h>

FCode p4_str_plus ---

### Description

If a$ is the empty string, drop it and do nothing else.

In particular, do not start a new concatenation, which would lock string space against new nonconcatenating copies.

Otherwise append the string body to the end of the string currently being concatenated as the last string in the string buffer, and update its count field. If there is no concatenating string, start one. An error is thrown if the size of the combined string would be larger than `MAX_MCOUNT` or if there is not enough room in string space even after a garbage collection.

If garbage collection occurs, a$ remains valid even when it is in the string buffer.

When there is a concatenating string, concatenation is the only basic string operation that can copy a string into the string buffer. "string-plus"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_parse_s_plus 3
p4_parse_s_plus PARSE-S+ ( [ccc<char;>] char -- )

    #include <pfe/def-config.h>

FCode p4_parse_s_plus ---

### Description

Parse the input stream up to the first occurrence of char, which is parsed away. If executing in compilation mode, append run-time semantics to the current definition that concatenates the characters parsed from the string. Otherwise concatenate the characters. "parse-s-plus"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_endcat 3
p4_endcat ENDCAT ( -- $: cat$ | empty$ )

    #include <pfe/def-config.h>

FCode p4_endcat ---

### Description

If there is no concatenating string, do nothing but leave the empty string. If there is, leave it as a string bound to the top of the string stack, and terminate concatenation, permitting normal copies into the string buffer. "end-cat"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_plus_quote 3
p4_str_plus_quote $+" ( [ccc<quote;>] -- )

    #include <pfe/def-config.h>

FCode p4_str_plus_quote ---

### Description

This word is immediate. In compilation mode it appends run-time semantics to the current definition that concatenates the quoted string according to the specification for `$+`. In interpretation mode it concatenates the string. An error is thrown if the length of the quoted string is longer than the system parameter `MAX_DATA_STR` (see `M,S`). "string-plus-quote"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_plus_back_tick 3
p4_str_plus_back_tick $+` ( [ccc<backtick;>] -- )

    #include <pfe/def-config.h>

FCode p4_str_plus_back_tick ---

### Description

The same as `$+"` but with back tick instead of double quote as delimiter. "string-plus-back-tick"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_num_str_args 3
p4_num_str_args #$ARGS ( -- u )

    #include <pfe/def-config.h>

FCode p4_num_str_args ---

### Description

Leave the number of entries in the topmost string frame. Throw an error if the frame stack is empty. "number-string-args"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_args_brace 3
p4_str_args_brace $ARGS{ ( arg1'$ ... argN'$ "arg1 ... argN <}>" -- )

    #include <pfe/def-config.h>

FCode p4_str_args_brace ---

### Description

         compilation: ( -- $: arg1$ ... argN$ )

Immediate and compilation-only.

Copy the argument strings across lines to the string buffer, push them onto the string stack with "argN" the most accessible, and make them into the top compile-time string stack frame. Compile the run-time code to make an argument frame out of the N most accessible run-time string stack entries. Inform the system text interpreter that it should compile run-time code for any white-space delimited argument encountered in the text of the definition, that concatenates the corresponding string in the run-time frame. At the semicolon terminating the definition, drop the compile-time argument frame and compile code to drop the run-time argument frame.

The code between `$ARGS{` ... `}` and the terminating semicolon is not allowed to make a net change in the string stack depth, because that would interfere with the automatic dropping of the string argument frame at the semicolon. "string-args-brace"

Syntax for defining a string macro GEORGE:

          : george  ($: a$ b$ c$ -- cat$ )
            $ARGS{ arg1 arg2 arg3 }
            cat" This is arg1:  " arg1 cat" ." ENDCAT $. ;

The blank following the last argument is required. For a macro with no arguments, `$ARGS{ }` does nothing but add useless overhead and should be omitted. Two of the arguments in this example are ignored and could have been left out. Note that `ENDCAT` would not be legal in this word without something like `$.` to remove the concatenated string from the string stack before the terminating semicolon. It is normal to use an `$ARGS{ }` word as a step in a concatenation that is terminated elsewhere.

Sample syntax using the string macro `george`:

          $" bill"  $" sue"  $" marie"  george $.

The resulting display is:

          This is arg1:  bill.

NOTE: Macro argument labels must be distinct from each other and from any local labels that appear in the same definition, and there is no check for that.

NOTE: At the moment the semantics of `$ARGS{` is undefined before `DOES>`.

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_frame 3
p4_str_frame $FRAME ( u -- )

    #include <pfe/def-config.h>

FCode p4_str_frame ---

### Description

Push the description of a string stack frame starting at the top of the string stack and containing u entries onto the string frame stack. Errors are thrown if the frame stack would overflow or if the depth of the string stack above the top frame, if there is one, is less than u. The value u = 0 is allowed. "string-frame"

NOTE: This implementation pushes u and the string stack pointer onto the frame stack.

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_frame_depth 3
p4_str_frame_depth $FRAME-DEPTH ( -- u )

    #include <pfe/def-config.h>

FCode p4_str_frame_depth ---

### Description

Leave the number of string frames currently on the string frame stack. "string-frame-depth"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_drop_str_frame 3
p4_drop_str_frame DROP-$FRAME ($: frame*$ i*$ -- i*s )

    #include <pfe/def-config.h>

FCode p4_drop_str_frame ---

### Description

Drop the topmost string frame from the string frame stack, and the corresponding strings, frame*$, from the string stack. An error is thrown if either stack would underflow. The cases where the frame has zero entries on the string stack and/or there are zero or more items on the string stack above the top frame item are handled properly. "drop-string-frame"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_find_str_arg 3
p4_find_str_arg FIND-$ARG ( s -- u true | false )

    #include <pfe/def-config.h>

FCode p4_find_str_arg ---

### Description

Leave true and its index u in the top string frame if the ANS Forth string matches an element of the frame, else leave false. The index of the top frame element is zero. "find-string-arg"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_th_str_arg 3
p4_th_str_arg TH-$ARG ( u -- $: arg$ )

    #include <pfe/def-config.h>

FCode p4_th_str_arg ---

### Description

Leave the u-th string in the topmost string frame, where the index u of the top element is zero. Throw an error if the frame stack is empty or if the top frame contains less than u+1 strings. "th-string-arg"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_do_drop_str_frame 3
p4_do_drop_str_frame (DROP-$FRAME) ( -- )

    #include <pfe/def-config.h>

FCode p4_do_drop_str_frame ---

### Description

Cleanup code for the end of a definition that uses `$ARGS{`. `;`-semicolon should be overloaded to compile it automatically if dynamic string arguments were in use. "paren-drop-string-frame-paren"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_pop 3
p4_str_pop $POP ( $: a$ -- s: a$)

    #include <pfe/def-config.h>

FCode p4_str_pop ---

### Description

Abort if the string stack would underflow when popped.

Otherwise pop the top of the string stack and push it onto the data stack.

If the string is in the current string space and initially bound to the top of the string stack, mark it as garbage by setting its back link to `NULL` and set the garbage flag.

This word violates the rule that only ANS Forth strings should appear on the data stack, and so is under the hood. "string-pop"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_push_ext 3
p4_str_push_ext $PUSH-EXT ( a$ -- $: a$ )

    #include <pfe/def-config.h>

FCode p4_str_push_ext ---

### Description

Pop an external mstring address from the data stack and push it onto the string stack after checking for room, invoking garbage collection if necessary. Not to be used with a dynamic string because a garbage collection can invalidate its address.

This word violates the normal rule that only ANS Forth strings should appear on the data stack, and so is under the hood. "string-push-ext"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_breakp_fetch 3
p4_str_breakp_fetch $BREAKP@ ( -- $stack.break.addr )

    #include <pfe/def-config.h>

FCode p4_str_breakp_fetch ---

### Description

"string-break-p-fetch"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_bufp_fetch 3
p4_str_bufp_fetch $BUFP@ ( -- $buffer.addr )

    #include <pfe/def-config.h>

FCode p4_str_bufp_fetch ---

### Description

"string-buf-p-fetch"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_fbreakp_fetch 3
p4_str_fbreakp_fetch $FBREAKP@ ( -- frame.stack.break.addr )

    #include <pfe/def-config.h>

FCode p4_str_fbreakp_fetch ---

### Description

"string-f-break-p-fetch"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_fsp0_fetch 3
p4_str_fsp0_fetch $FSP0@ ( -- initial.frame.stack.top.addr )

    #include <pfe/def-config.h>

FCode p4_str_fsp0_fetch ---

### Description

"string-f-s-p-zero-fetch"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_fsp_fetch 3
p4_str_fsp_fetch $FSP@ ( -- frame.stack.top.addr )

    #include <pfe/def-config.h>

FCode p4_str_fsp_fetch ---

### Description

"string-f-s-p-fetch"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_sp0_fetch 3
p4_str_sp0_fetch $SP0@ ( -- initial.string.stack.top.addr )

    #include <pfe/def-config.h>

FCode p4_str_sp0_fetch ---

### Description

"string-s-p-zero-fetch"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_str_sp_fetch 3
p4_str_sp_fetch $SP@ ( -- string.stack.top.addr )

    #include <pfe/def-config.h>

FCode p4_str_sp_fetch ---

### Description

"string-s-p-fetch"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_slash_str_frame_item 3
p4_slash_str_frame_item /$SFRAME-ITEM ( -- frame.stack.item.size )

    #include <pfe/def-config.h>

FCode p4_slash_str_frame_item ---

### Description

"slash-string-frame-item"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_slash_str_frame_stack 3
p4_slash_str_frame_stack /$SFRAME-STACK ( -- max.frame.stack.size )

    #include <pfe/def-config.h>

FCode p4_slash_str_frame_stack ---

### Description

"slash-string-frame-stack"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_slash_str_space_header 3
p4_slash_str_space_header /$SPACE-HEADER ( -- $space.header.size )

    #include <pfe/def-config.h>

FCode p4_slash_str_space_header ---

### Description

"slash-string-space-header"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_zero_str_space 3
p4_zero_str_space 0$SPACE ( $space.addr -- )

    #include <pfe/def-config.h>

FCode p4_zero_str_space ---

### Description

Clear the string buffer, string stack, and string frame stack in the string space starting at space.addr. Any string variables holding strings in the string buffer are left pointing into limbo. This may be executed with the string space in an invalid state, as long as the `/$BUF` and `MAX-#$FRAMES` fields of its string space structure are intact. "zero-string-space"

NOTE: This word does not zero fill the string buffer.

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_cat_str_p_fetch 3
p4_cat_str_p_fetch CAT$P@ ( -- cat$.msa | 0 )

    #include <pfe/def-config.h>

FCode p4_cat_str_p_fetch ---

### Description

"cat-string-fetch"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_in_str_buffer_Q 3
p4_in_str_buffer_Q IN-$BUFFER? ( msa -- flag )

    #include <pfe/def-config.h>

FCode p4_in_str_buffer_Q ---

### Description

Leave true if the mstring is in the string buffer. "in-string-buffer-question"

### Author

- David N.Williams (modified by $Author: guidod $)

### Copyright

Copyright (C) 2001-2004, 2006, 2008 David N. Williams

0.33.71
0.33.71 pfe
p4_edit_block 3
p4_edit_block EDIT-BLOCK ( blk -- )

    #include <pfe/edit-ext.h>

FCode p4_edit_block ---

### Description

start the internal block-editor on the assigned block

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2000. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_edit_text 3
p4_edit_text EDIT-TEXT name ( -- )

    #include <pfe/edit-ext.h>

FCode p4_edit_text ---

### Description

start an external `EDITOR` with the specified filename

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2000. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_edit_error 3
p4_edit_error EDIT-ERROR ( -- )

    #include <pfe/edit-ext.h>

FCode p4_edit_error ---

### Description

if an error occured, this routine can be called to invoke an appropriate `EDITOR` (see also `EDIT-BLOCK`)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2000. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Exec 3
p4_Exec ...

    #include <pfe/engine-set.h>

_export int p4_Exec(p4_threadP th)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_call_stop 3
p4_call_stop ...

    #include <pfe/engine-sub.h>

FCode_XE p4_call_stop ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_call_loop 3
p4_call_loop ...

    #include <pfe/engine-sub.h>

_export void p4_call_loop(p4xt xt)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_call 3
p4_call ...

    #include <pfe/engine-sub.h>

_export void p4_call(p4xt xt)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_normal_execute 3
p4_normal_execute ...

    #include <pfe/engine-sub.h>

_export void p4_normal_execute(p4xt xt)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_simple_execute 3
p4_simple_execute ...

    #include <pfe/engine-sub.h>

_export void p4_simple_execute(p4xt xt)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_interpret 3
p4_interpret ...

    #include <pfe/engine-sub.h>

FCode p4_interpret ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_include_file 3
p4_include_file ...

    #include <pfe/engine-sub.h>

_export void p4_include_file(p4_File *fid)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_included1 3
p4_included1 ...

    #include <pfe/engine-sub.h>

_export int p4_included1(const p4_char_t *name, int len, int throws)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_included 3
p4_included ...

    #include <pfe/engine-sub.h>

_export void p4_included(const p4_char_t* name, int len)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_closeall_files 3
p4_closeall_files ...

    #include <pfe/engine-sub.h>

FCode p4_closeall_files ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ok 3
p4_ok ...

    #include <pfe/engine-sub.h>

FCode p4_ok ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_interpret_loop 3
p4_interpret_loop ...

    #include <pfe/engine-sub.h>

_export int p4_interpret_loop(P4_VOID)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_cold_system 3
p4_cold_system ...

    #include <pfe/engine-sub.h>

FCode p4_cold_system ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_boot_system 3
p4_boot_system ...

    #include <pfe/engine-sub.h>

FCode p4_boot_system ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_include_required 3
p4_include_required REQUIRED ( ... str-ptr str-len -- ??? )

    #include <pfe/environ-ext.h>

FCode p4_include_required ---

### Description

the filename argument is loaded via `INCLUDED` as an extension package to the current system. The filename is registered in the current `ENVIRONMENT` so that it is only `INCLUDED` once (!!) if called multiple times via `REQUIRED` or `REQUIRES`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_include_require 3
p4_include_require REQUIRE ( ... "file-name" -- ... )

    #include <pfe/environ-ext.h>

FCode p4_include_require ---

### Description

parses the next `WORD` and passes it to `REQUIRED` this is the self-parsing version of `REQUIRED` and it does parrallel `INCLUDE` w.r.t. `INCLUDED`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_environment 3
p4_environment ENVIRONMENT ( -- )

    #include <pfe/environ-ext.h>

FCode p4_environment ---

### Description

execute the `VOCABULARY` runtime for the `ENVIRONMENT-WORDLIST`

      : ENVIRONMENT  ENVIRONMENT-WORDLIST CONTEXT ! ;
      ' ENVIRONMENT  ALIAS [ENV] IMMEDIATE

see newstyle `ENVIRONMENT?`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_environment_Q 3
p4_environment_Q ENVIRONMENT? ( a1 n1 -- false | ?? true )

    #include <pfe/environ-ext.h>

_export p4_char_t* p4_environment_Q(const p4_char_t* str, p4cell l)

### Description

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)

Here it implements the environment queries as a `SEARCH-WORDLIST` in a user-visible vocabulary called `ENVIRONMENT`

      : ENVIRONMENT?
        ['] ENVIRONMENT &gt;WORDLIST SEARCH-WORDLIST
        IF  EXECUTE TRUE ELSE  FALSE THEN ;

special extension: a search for CORE will also find a definition of CORE-EXT or CORE-EXT-EXT or CORE-EXT-EXT-EXT - it just has to be below the ansi-standard maximum length of 31 chars.

if a name like "dstrings-ext" is given, and no such entry can be found, then envQ will try to trigger a `(LOADM)` of that module, in the hope that this implicit-load does in fact define the answer. Use with care, it's a very new feature.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_needs_environment 3
p4_needs_environment NEEDS ( name -- )

    #include <pfe/environ-ext.h>

FCode p4_needs_environment ---

### Description

A self-parsing variant of an environment-query check. It is similar to a simulation like

      : NEEDS PARSE-WORD 2DUP ENVIRONMENT?
        IF DROP ( extra value ) 2DROP ( success - be silent )
        ELSE TYPE ." not available " CR THEN ;

however that would only match those worset-envqueries which return a single extra item under the uppermost TRUE flag in the success case. Instead it works more like

      : NEEDS PARSE-WORD 2DUP ENVIRONMENT-WORDLIST SEARCH-WORDLIST
        IF 2DROP ( success - be silent and just drop the parsed word )
        ELSE TYPE ." not available " CR THEN ;

however we add the same extension as in `ENVIRONMENT`? as that it can automatically load a wordset module to fullfil a query that looks like "[wordsetname]-ext". Therefore, the following two lines are pretty much identical:

      LOADM floating
      NEEDS floating-ext

the difference between the two: if somebody did provide a forth level implementation of floating-ext then that implementation might have registered a hint "floating-ext" in the environment-wordlist. This extra-hint will inhibit loading of the binary module even if it exists and not been loaded so far. The `LOADM` however will not check the `ENVIRONMENT-WORDLIST` and only check its loadlist of binary wordset modules in the system.

It is therefore recommended to use `NEEDS` instead of `LOADM` unless you know you want the binary module, quickly and uncondtionally.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_catch 3
p4_catch CATCH ( catch-xt* -- 0 | throw#! ) [ANS]

    #include <pfe/exception-ext.h>

FCode p4_catch ---

### Description

execute the given execution-token and catch any exception that can be caught therein. software can arbitrarily raise an exception using `THROW` - the value 0 means there was no exception, other denote implementation dependent exception-codes.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_throw 3
p4_throw THROW ( throw#! -- [THROW] | throw# -- ) [ANS]

    #include <pfe/exception-ext.h>

FCode p4_throw ---

### Description

raise an exception - it will adjust the depth of all stacks and start interpreting at the point of the latest `CATCH` if n is null nothing happens, the -1 (ie. `FALSE` ) is the raise-code of `ABORT` - the other codes are implementation dependent and will result in something quite like `ABORT`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_abort 3
p4_abort ABORT ( -- [THROW] ) [ANS]

    #include <pfe/exception-ext.h>

FCode p4_abort ---

### Description

throw - cleanup some things and go back to the QUIT routine

      : ABORT -1 THROW ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_abort_quote_execution 3
p4_abort_quote_execution ((ABORT")) ( -- ) [HIDDEN]

    #include <pfe/exception-ext.h>

FCode_XE p4_abort_quote_execution ---

### Description

compiled by `ABORT"` what"

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_abort_quote 3
p4_abort_quote 'ABORT"' ( [string<">] -- [THROW] ) [ANS]

    #include <pfe/exception-ext.h>

FCode p4_abort_quote ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_exception_string 3
p4_exception_string (EXCEPTION-STRING: ( exception# [description<closeparen;>] -- )

    #include <pfe/exception-ext.h>

FCode p4_exception_string ---

### Description

append a node with the given id and a pointer to an extern zstring to the `NEXT-EXCEPTION` chain-list.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_longjmp_loop 3
p4_longjmp_loop ...

    #include <pfe/exception-sub.h>

_export void p4_longjmp_loop(int arg)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_throws 3
p4_throws ...

    #include <pfe/exception-sub.h>

_export void p4_throws(int id, const p4_char_t* description, int len)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_at_x_y 3
p4_at_x_y AT-XY ( col# row# -- ) [ANS]

    #include <pfe/facility-ext.h>

FCode p4_at_x_y ---

### Description

move the cursor position to the given row and column of the screen. If the output device is not a terminal this will have no effect but can still send an escape sequence.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_key_question 3
p4_key_question KEY? ( -- key-flag ) [ANS]

    #include <pfe/facility-ext.h>

FCode p4_key_question ---

### Description

if a character is available from the keyboard, return true. The `KEY` word will retrieve the actual character.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ekey 3
p4_ekey EKEY ( -- key-code# ) [ANS]

    #include <pfe/facility-ext.h>

FCode p4_ekey ---

### Description

return a keyboard event, the encoding may differ, esp. that it can contain special keys.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ekey_to_char 3
p4_ekey_to_char EKEY>CHAR ( key-code# -- key-code# 0 | char# true! ) [ANS]

    #include <pfe/facility-ext.h>

FCode p4_ekey_to_char ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ekey_question 3
p4_ekey_question EKEY? ( -- ekey-flag ) [ANS]

    #include <pfe/facility-ext.h>

FCode p4_ekey_question ---

### Description

check if a character is available from the keyboard to be received - unlike `KEY`? it will not discard non-visible codes.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_emit_question 3
p4_emit_question EMIT? ( -- emit-flag ) [ANS]

    #include <pfe/facility-ext.h>

FCode p4_emit_question ---

### Description

if `EMIT` can safely output characters without blocking the forth by waiting for an indefinite time.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ms 3
p4_ms MS ( milliseconds# -- ) [ANS]

    #include <pfe/facility-ext.h>

FCode p4_ms ---

### Description

wait at least the specified milliseconds (suspend the forth tasklet)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_time_and_date 3
p4_time_and_date TIME&amp;DATE ( -- sec# min# hrs# day# month# year# ) [ANS]

    #include <pfe/facility-ext.h>

FCode p4_time_and_date ---

### Description

return the broken down current time

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dot_clrscr 3
p4_dot_clrscr PAGE ( -- ) [ANS]

    #include <pfe/facility-ext.h>

extern FCodep4_dot_clrscr ---

### Description

`CLRSCR`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ignore_line 3
p4_ignore_line #! ( "...<eol;>" -- )

    #include <pfe/facility-mix.h>

FCode p4_ignore_line ---

### Description

ignores the rest of the line, defining `#!' is used to support forth scripts executed by the unix kernel

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_clock_fetch 3
p4_clock_fetch CLOCK@ ( --- clock-ticks# ) [EXT]

    #include <pfe/facility-mix.h>

FCode p4_clock_fetch ---

### Description

return clock(2) - the number of clocks of this process. To get the number of seconds, divide by `CLOCKS_PER_SEC` as represented in the `ENVIROMENT` for a hosted forth system. A similar scheme is used by `MS@` to compute the clock time rounded to milliseconds (named in similarity with `MS` sleep).

Remember that the process clock will wrap around at some point, therefore only use difference values between two clock reads.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bin 3
p4_bin BIN ( access-mode# -- access-mode#' ) [ANS]

    #include <pfe/file-ext.h>

FCode p4_bin ---

### Description

modify the give file access-mode to be a binary-mode

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_delete_file 3
p4_delete_file DELETE-FILE ( name-ptr name-len -- name-errno# ) [ANS]

    #include <pfe/file-ext.h>

FCode p4_delete_file ---

### Description

delete the named file and return a status code

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_position 3
p4_file_position FILE-POSITION ( some-file* -- p,pos# some-errno# ) [ANS]

    #include <pfe/file-ext.h>

FCode p4_file_position ---

### Description

return the current position in the file and return a status code. A code of zero means success.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_size 3
p4_file_size FILE-SIZE ( some-file* -- s,size# some-errno# ) [ANS]

    #include <pfe/file-ext.h>

FCode p4_file_size ---

### Description

return the current size of the file and return a status code. A code of zero means success.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_write_line 3
p4_write_line WRITE-LINE ( buf-ptr buf-len some-file* -- some-errno# ) [ANS]

    #include <pfe/file-ext.h>

FCode p4_write_line ---

### Description

write characters from the string buffer to a file, and add the line-terminator to the end of it. returns a status code.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_status 3
p4_file_status FILE-STATUS ( file-ptr file-len -- file-subcode# file-errno# ) [ANS]

    #include <pfe/file-ext.h>

FCode p4_file_status ---

### Description

check the named file - if it exists the status errno code is zero. The status subcode is implementation-specific and usually matches the file access permission bits of the filesystem.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_flush_file 3
p4_flush_file FLUSH-FILE ( some-file* -- some-errno# ) [ANS]

    #include <pfe/file-ext.h>

FCode p4_flush_file ---

### Description

flush all unsaved buffers of the file to disk. A status code of zero means success.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_rename_file 3
p4_rename_file RENAME-FILE ( oldname-ptr oldname-len newname-ptr newname-len -- newname-errno# ) [ANS]

    #include <pfe/file-ext.h>

FCode p4_rename_file ---

### Description

rename the file named by "oldname" to the name of "newname" returns a status-code where zero means success.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_include 3
p4_include INCLUDE ( "filename" -- ??? ) [FTH]

    #include <pfe/file-mix.h>

FCode p4_include ---

### Description

load the specified file, see also `LOAD"` filename"

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_copy_file 3
p4_copy_file COPY-FILE ( src-ptr src-len dst-ptr dst-len -- copy-errno# ) [FTH]

    #include <pfe/file-mix.h>

FCode p4_copy_file ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_move_file 3
p4_move_file MOVE-FILE ( src-ptr src-len dst-ptr dst-len -- move-errno# ) [FTH]

    #include <pfe/file-mix.h>

FCode p4_move_file ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_rw 3
p4_file_rw FILE-R/W ( buffer* use-block# flag? some-file* -- ) [FTH]

    #include <pfe/file-mix.h>

FCode p4_file_rw ---

### Description

like FIG-Forth `R/W`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_block 3
p4_file_block FILE-BLOCK ( use-block# some-file* -- buffer* ) [FTH]

    #include <pfe/file-mix.h>

FCode p4_file_block ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_buffer 3
p4_file_buffer FILE-BUFFER ( use-block# some-file* -- buffer* ) [FTH]

    #include <pfe/file-mix.h>

FCode p4_file_buffer ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_empty_buffers 3
p4_file_empty_buffers FILE-EMPTY-BUFFERS ( some-file* -- ) [FTH]

    #include <pfe/file-mix.h>

FCode p4_file_empty_buffers ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_flush 3
p4_file_flush FILE-FLUSH ( some-file* -- ) [FTH]

    #include <pfe/file-mix.h>

FCode p4_file_flush ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_list 3
p4_file_list FILE-LIST ( use-block# some-file* -- ) [FTH]

    #include <pfe/file-mix.h>

FCode p4_file_list ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_load 3
p4_file_load FILE-LOAD ( use-block# some-file* -- ) [FTH]

    #include <pfe/file-mix.h>

FCode p4_file_load ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_save_buffers 3
p4_file_save_buffers FILE-SAVE-BUFFERS ( some-file* -- ) [FTH]

    #include <pfe/file-mix.h>

FCode p4_file_save_buffers ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_thru 3
p4_file_thru FILE-THRU ( lo-block# hi-block# some-file* -- ) [FTH]

    #include <pfe/file-mix.h>

FCode p4_file_thru ---

### Description

see `THRU`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_update 3
p4_file_update FILE-UPDATE ( some-file* -- ) [FTH]

    #include <pfe/file-mix.h>

FCode p4_file_update ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dfaligned 3
p4_dfaligned ...

    #include <math.h>

_export p4cell p4_dfaligned(p4cell n)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_to_float 3
p4_to_float ...

    #include <math.h>

_export int p4_to_float(const p4_char_t *p, p4cell n, double *r)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_f_to_d 3
p4_f_to_d ( f: a -- n,n )

    #include <math.h>

FCode p4_f_to_d ---

### Description

b is the integer representation of a

we use truncation towards zero. compare with `F>S` and its `"FROUND>S"` / `"FTRUNC>S"`

0.33.71
0.33.71 pfe
p4_f_p_fetch 3
p4_f_p_fetch FP@ ( -- addr )

    #include <pfe/floating-mix.h>

FCode p4_f_p_fetch ---

### Description

returns the floating point stack pointer

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_p_store 3
p4_f_p_store FP! ( addr -- )

    #include <pfe/floating-mix.h>

FCode p4_f_p_store ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_equal 3
p4_f_equal F? ( f: a b -- s: a==b )

    #include <pfe/floating-mix.h>

FCode p4_f_equal ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_not_equal 3
p4_f_not_equal F<> ( f: a b -- s: a!=b )

    #include <pfe/floating-mix.h>

FCode p4_f_not_equal ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_s_to_f 3
p4_s_to_f S>F ( n -- f: x )

    #include <pfe/floating-mix.h>

FCode p4_s_to_f ---

### Description

it's inverse is `F>S` - convert a cell parameter to floating-point.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_trunc_to_s 3
p4_f_trunc_to_s FTRUNC>S (f: x -- s: n )

    #include <pfe/floating-mix.h>

FCode p4_f_trunc_to_s ---

### Description

The word `F>S` was sometimes defined with a different behavior than `FTRUNC>S` which is the type-cast behaviour of C according to C99 section 6.3.1.4 - truncation would also match the ANS-Forth specification for `F>D`.

Some systems used `F>S` defined to `FROUND>S` instead. The pfe provides explicit words for both conversions, the word `FROUND>S` and `FTRUNC>S` which return single-cell parameters for a floating point number with the conversion method of `FTRUNC` or `FROUND`.

In PFE, `F>S` is a synonym pointing to `FTRUNC>S` in analogy of the behavior of `F>D` where no explicit word exists. The inverse of `F>S` is the cast conversion of `S>F`.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_round_to_s 3
p4_f_round_to_s FROUND>S (f: x -- s: n)

    #include <pfe/floating-mix.h>

FCode p4_f_round_to_s ---

### Description

complements `FTRUNC>S` for applications that expect `F>S` to be defined with a rounding behavior like

      : FROUND&gt;S FROUND FTRUNC&gt;S ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_trunc 3
p4_f_trunc FTRUNC (f: x -- x' )

    #include <pfe/floating-mix.h>

FCode p4_f_trunc ---

### Description

truncate towards zero, discard a fractional part. See also `FTRUNC>S` conversion and the `FROUND` and `FLOOR` adaptors.

      : FTRUNC FDUP F0&lt; IF FCEIL ELSE FLOOR THEN ;

(When available, uses a single call to C99 trunc() internally)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_minus_f_rot 3
p4_minus_f_rot -FROT (f: x1 x2 x3 -- x3 x1 x2 )

    #include <pfe/floating-mix.h>

FCode p4_minus_f_rot ---

### Description

F-stack equivalent of `-ROT`

note, some systems call this work F-ROT, here it is the inverse of `FROT`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_nip 3
p4_f_nip FNIP (f: x1 x2 -- x2 )

    #include <pfe/floating-mix.h>

FCode p4_f_nip ---

### Description

F-stack equivalent of `NIP`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_tuck 3
p4_f_tuck FTUCK (f: x1 x2 -- x2 x1 x2 )

    #include <pfe/floating-mix.h>

FCode p4_f_tuck ---

### Description

F-stack equivalent of `TUCK`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_one_over_f 3
p4_one_over_f 1/F (f: x -- 1/x )

    #include <pfe/floating-mix.h>

FCode p4_one_over_f ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_square 3
p4_f_square F^2 (f: x -- x^2 )

    #include <pfe/floating-mix.h>

FCode p4_f_square ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_power_n 3
p4_f_power_n F^N ( u f: x -- x^u )

    #include <pfe/floating-mix.h>

FCode p4_f_power_n ---

### Description

For large exponents, use F** instead. Of course u=-1 is large.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_two_slash 3
p4_f_two_slash F2/ (f: x -- x/2 )

    #include <pfe/floating-mix.h>

FCode p4_f_two_slash ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_two_star 3
p4_f_two_star F2* (f: x -- x*2 )

    #include <pfe/floating-mix.h>

FCode p4_f_two_star ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_zero_greater 3
p4_f_zero_greater F0> (f: x -- s: flag )

    #include <pfe/floating-mix.h>

FCode p4_f_zero_greater ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_f_zero_not_equal 3
p4_f_zero_not_equal F0<> (f: x -- s: flag )

    #include <pfe/floating-mix.h>

FCode p4_f_zero_not_equal ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_plus 3
p4_two_plus 2+ ( a# -- a#' | a* -- a*' | a -- a' [??] ) [FTH]

    #include <pfe/forth-83-ext.h>

FCode p4_two_plus ---

### Description

add 2 to the value on stack (and leave the result there)

      simulate:
        : 2+ 2 + ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_minus 3
p4_two_minus 2- ( a# -- a#' | a* -- a*' | a -- a' [??] ) [FTH]

    #include <pfe/forth-83-ext.h>

FCode p4_two_minus ---

### Description

substract 2 from the value on stack (and leave the result there)

      simulate:
        : 2- 2 - ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_compile 3
p4_compile COMPILE ( "word" -- ) [FTH]

    #include <pfe/forth-83-ext.h>

FCode p4_compile ---

### Description

compile the next word. The next word should not be immediate, in which case you would have to use `[COMPILE]`. For this reason, you should use the word `POSTPONE`, which takes care it.

      simulate:
        : COMPILE  R&gt; DUP @ , CELL+ &gt;R ;  ( not immediate !!! )

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_vocabulary_RT 3
p4_vocabulary_RT ((VOCABULARY)) ( -- ) [HIDDEN]

    #include <pfe/forth-83-ext.h>

FCode_RT p4_vocabulary_RT ---

### Description

runtime of a `VOCABULARY`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_vocabulary 3
p4_vocabulary VOCABULARY ( "name" -- ) [FTH]

    #include <pfe/forth-83-ext.h>

FCode p4_vocabulary ---

### Description

create a vocabulary of that name. If the named vocabulary is called later, it will run `((VOCABULARY))` , thereby putting it into the current search order. Special pfe-extensions are accessible via `CASE-SENSITIVE-VOC` and `SEARCH-ALSO-VOC`

      simulate:
        : VOCABULARY  CREATE ALLOT-WORDLIST
             DOES&gt; ( the ((VOCABULARY)) runtime )
               CONTEXT !
        ; IMMEDIATE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_next_block 3
p4_next_block --> ( -- ) [FTH]

    #include <pfe/forth-83-ext.h>

FCode p4_next_block ---

### Description

does increase `BLK` and refills the input-buffer from there. Does hence break interpretation of the current BLK and starts with the next. Old-style forth mechanism. You should use `INCLUDE`

      : --&gt; ?LOADING REFILL ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_k 3
p4_k K ( -- k# ) [FTH]

    #include <pfe/forth-83-ext.h>

FCode p4_k ---

### Description

the 3rd loop index just like `I` and `J`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_octal 3
p4_octal OCTAL ( -- ) [FTH]

    #include <pfe/forth-83-ext.h>

FCode p4_octal ---

### Description

sets `BASE` to 8. Compare with `HEX` and `DECIMAL`

      simulate:
        : OCTAL  8 BASE ! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_s_p_fetch 3
p4_s_p_fetch SP@ ( -- sp-cell* ) [FTH]

    #include <pfe/forth-83-ext.h>

FCode p4_s_p_fetch ---

### Description

the address of the top of stack. Does save it onto the stack. You could do

        : DUP  SP@ @ ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_store_bits 3
p4_store_bits !BITS ( x-bits# x-addr mask# -- ) [FTH]

    #include <pfe/forth-83-ext.h>

FCode p4_store_bits ---

### Description

at the cell pointed to by addr, change only the bits that are enabled in mask

      simulate:
        : !BITS  &gt;R 2DUP @ R NOT AND SWAP R&gt; AND OR SWAP ! DROP ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_power 3
p4_power ** ( a# b# -- power-a# ) [FTH]

    #include <pfe/forth-83-ext.h>

FCode p4_power ---

### Description

raise second to top power

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_byte_swap 3
p4_byte_swap >< ( a -- a' ) [FTH] [OLD]

    #include <pfe/forth-83-ext.h>

FCode p4_byte_swap ---

### Description

byte-swap a word

depracated: use `NTOHS` which does the same as this word when the local byte-order seems to have no match, and be otherwise a no-op. Note that only the two lower bytes of the top-of-cell are swapped.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_byte_swap_move 3
p4_byte_swap_move >MOVE< ( from-addr* to-addr* count# -- ) [FTH] [OLD]

    #include <pfe/forth-83-ext.h>

FCode p4_byte_swap_move ---

### Description

see `MOVE` , does byte-swap for each word underway.

depracated: this word has not been very useful lately. It does still stem from times of 16bit forth systems that wanted to interchange data blocks. It is better to use functionality based on `NTOHS` or `NTOHL`. Note that this word `>MOVE<` does swap each 2byte. It is not useful for byte-swapping `WCHAR` strings as the count is given in bytes, not wchar items.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_fetch_bits 3
p4_fetch_bits @BITS ( x-addr mask# -- x-value# ) [FTH]

    #include <pfe/forth-83-ext.h>

FCode p4_fetch_bits ---

### Description

see the companion word => !BITS

      simulate:
        : @BITS  SWAP @ AND ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_seal 3
p4_seal SEAL ( -- ) [FTH]

    #include <pfe/forth-83-ext.h>

FCode p4_seal ---

### Description

looks through the search-order and kills the ONLY wordset - hence you can't access the primary vocabularies from there.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_c_plus_store 3
p4_c_plus_store C+! ( n addr -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_c_plus_store ---

### Description

Add the low-order byte of _n_ to the byte at _addr_, removing both from the stack.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_to_wordlist 3
p4_to_wordlist ">WORDLIST" ( xt -- wordl* )

    #include <pfe/forth-usual-ext.h>

FCode p4_to_wordlist ---

### Description

convert a `VOCABULARY`-xt into its wordlist reference (as in win32forth)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bounds 3
p4_bounds BOUNDS ( str len -- str+len str )

    #include <pfe/forth-usual-ext.h>

FCode p4_bounds ---

### Description

Convert _str len_ to range for DO-loop.

      : BOUNDS  ( str len -- str+len str )  OVER + SWAP ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_off_store 3
p4_off_store OFF ( addr -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_off_store ---

### Description

Store 0 at _addr_. Defined in f84 as `OFF`. See antonym `ON!`.

       : OFF  ( addr -- )  0 SWAP ! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_on_store 3
p4_on_store ON! ( addr -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_on_store ---

### Description

Store -1 at _addr_. Defined in f83 as `ON`. See antonym `OFF!`.

       : ON!  ( addr -- )  -1 SWAP ! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_append 3
p4_append +PLACE ( str len add2 -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_append ---

### Description

Append string _str len_ to the counted string at _addr_. a.k.a. `APPEND` (being a `SYNONYM` now)

      : +PLACE   2DUP 2&gt;R  COUNT +  SWAP MOVE ( ) 2R&gt; C+! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_append_char 3
p4_append_char C+PLACE ( char addr -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_append_char ---

### Description

Append _char_ to the counted string at _addr_. a.k.a. `APPEND-CHAR` (being a `SYNONYM` now)

      : C+PLACE   DUP &gt;R  COUNT  DUP 1+ R&gt; C!  +  C! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_place 3
p4_place PLACE ( str len addr -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_place ---

### Description

Place the string _str len_ at _addr_, formatting it as a counted string.

      : PLACE  2DUP 2&gt;R  1+ SWAP  MOVE  2R&gt; C! ;
      : PLACE  2DUP C!   1+ SWAP CMOVE ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_question_leave 3
p4_question_leave ?LEAVE ( cond -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_question_leave ---

### Description

leave a (innermost) loop if condition is true

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_noop 3
p4_noop NOOP ( -- )

    #include <pfe/forth-usual-ext.h>

extern FCode p4_noop ---

### Description

do nothing, used as a place-holder where an execution word is needed

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_r_p_fetch 3
p4_r_p_fetch RP@ ( -- addr )

    #include <pfe/forth-usual-ext.h>

FCode p4_r_p_fetch ---

### Description

returns the return stack pointer

      example:
        : R@ RP@ @ ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_r_p_store 3
p4_r_p_store RP! ( addr -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_r_p_store ---

### Description

sets the return stack pointer, reverse of `RP@`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_s_p_store 3
p4_s_p_store SP! ( ... addr -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_s_p_store ---

### Description

sets the stack pointer, reverse of `SP@`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dash_rot 3
p4_dash_rot -ROT ( a b c -- c a b )

    #include <pfe/forth-usual-ext.h>

FCode p4_dash_rot ---

### Description

inverse of `ROT`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_c_set 3
p4_c_set CSET ( n addr -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_c_set ---

### Description

set bits in byte at given address

      simulate:
        : CSET  TUCK @ SWAP OR SWAP ! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_c_reset 3
p4_c_reset CRESET ( n addr -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_c_reset ---

### Description

reset bits in byte at given address

      simulate:
        : CRESET  TUCK @ SWAP NOT AND SWAP ! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_c_toggle 3
p4_c_toggle CTOGGLE ( n addr -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_c_toggle ---

### Description

toggle bits in byte at given address

      simulate:
        : CTOGGLE  TUCK @ SWAP XOR SWAP ! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_toggle 3
p4_toggle TOGGLE ( c-addr charmask -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_toggle ---

### Description

toggle the bits given in charmask, see also `SMUDGE` and = UNSMUDGE

      example: the fig-style SMUDGE had been defined such
        : FIG-SMUDGE LATEST &gt;FFA (SMUDGE#) TOGGLE ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_three_dup 3
p4_three_dup 3DUP ( x y z -- x y z x y z )

    #include <pfe/forth-usual-ext.h>

FCode p4_three_dup ---

### Description

Copy top three elements on the stack onto top of stack.

      : 3DUP   THIRD THIRD THIRD ;

or

      : 3DUP  3 PICK 3 PICK 3 PICK ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_three_drop 3
p4_three_drop 3DROP ( x y z -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_three_drop ---

### Description

Drop the top three elements from the stack.

      : 3DROP   DROP 2DROP ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_four_dup 3
p4_four_dup 4DUP ( a b c d -- a b c d a b c d )

    #include <pfe/forth-usual-ext.h>

FCode p4_four_dup ---

### Description

      simulate:
       : 4DUP  4 PICK 4 PICK 4 PICK 4 PICK ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_four_drop 3
p4_four_drop 4DROP ( x y z -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_four_drop ---

### Description

Drop the top three elements from the stack.

      : 4DROP   2DROP 2DROP ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_toupper 3
p4_toupper TOUPPER ( c1 -- c2 )

    #include <pfe/forth-usual-ext.h>

FCode p4_toupper ---

### Description

convert a single character to upper case

        : TOUPPER  &gt;R _toupper ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ascii 3
p4_ascii ASCII ( [word] -- val )

    #include <pfe/forth-usual-ext.h>

FCode p4_ascii ---

### Description

state smart version of `CHAR` or `[CHAR]` resp.

      simulate:
        : ASCII  [COMPILE] [CHAR]
                 STATE @ IF [COMPILE] LITERAL THEN ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_control 3
p4_control CONTROL ( [word] -- val )

    #include <pfe/forth-usual-ext.h>

FCode p4_control ---

### Description

see `ASCII`, but returns char - '@'

      simulate:
        : CONTROL  [COMPILE] [CHAR]  [CHAR] @ -
                   STATE @ IF [COMPILE] LITERAL THEN ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_vocs 3
p4_vocs VOCS ( -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_vocs ---

### Description

list all vocabularies in the system

      simulate:
        : VOCS VOC-LINK @ BEGIN DUP WHILE
                                DUP -&gt;WORDLIST.NAME @ ID.
                                -&gt;WORDLIST.LINK @
                          REPEAT DROP ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_fetch_execute 3
p4_fetch_execute @EXECUTE ( xt -- ? )

    #include <pfe/forth-usual-ext.h>

FCode p4_fetch_execute ---

### Description

same as `@` `EXECUTE` , but checks for null as xt and silently ignores it. Same as in most forths where defined.

      simulate:
        : @EXECUTE  @ ?DUP IF EXECUTE THEN ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_file_check 3
p4_file_check FILE-CHECK ( n -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_file_check ---

### Description

Check for file access error.

      \ : FILE-CHECK    ( n -- )  THROW ;
      : FILE-CHECK      ( n -- )  ABORT" File Access Error " ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_memory_check 3
p4_memory_check MEMORY-CHECK ( n -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_memory_check ---

### Description

Check for memory allocation error.

      \ : MEMORY-CHECK  ( n -- )  THROW ;
      : MEMORY-CHECK    ( n -- )  ABORT" Memory Allocation Error " ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_plus_plus 3
p4_plus_plus ++ ( addr -- )

    #include <pfe/forth-usual-ext.h>

FCode p4_plus_plus ---

### Description

Increment the value at _addr_.

      : ++  ( addr -- )  1 SWAP +! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_fetch_plus_plus 3
p4_fetch_plus_plus @++ ( addr -- addr' x )

    #include <pfe/forth-usual-ext.h>

FCode p4_fetch_plus_plus ---

### Description

Fetch the value _x_ from _addr_, and increment the address by one cell.

      : @++  ( addr -- addr' x )  DUP CELL+ SWAP  @ ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_store_plus_plus 3
p4_store_plus_plus !++ ( addr x -- addr' )

    #include <pfe/forth-usual-ext.h>

FCode p4_store_plus_plus ---

### Description

Store the value _x_ into _addr_, and increment the address by one cell.

      : !++  ( addr x -- addr' )  OVER !  CELL+ ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_nofp_dfaligned 3
p4_nofp_dfaligned ...

    #include <math.h>

_export p4cell p4_nofp_dfaligned(p4cell n)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_to_float 3
p4_nofp_to_float ...

    #include <math.h>

_export int p4_nofp_to_float(const p4_char_t *p, p4cell n, double *r)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_s_to_f 3
p4_nofp_s_to_f S>F ( n -- x )

    #include <math.h>

FCode p4_nofp_s_to_f ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_f_trunc_to_s 3
p4_nofp_f_trunc_to_s FTRUNC>S ( x -- n )

    #include <math.h>

FCode p4_nofp_f_trunc_to_s ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_f_round_to_s 3
p4_nofp_f_round_to_s FROUND>S ( x -- n )

    #include <math.h>

FCode p4_nofp_f_round_to_s ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_f_trunc 3
p4_nofp_f_trunc FTRUNC ( x -- x' )

    #include <math.h>

FCode p4_nofp_f_trunc ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_minus_f_rot 3
p4_nofp_minus_f_rot -FROT ( x1 x2 x3 -- x3 x1 x2 )

    #include <math.h>

FCode p4_nofp_minus_f_rot ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_f_nip 3
p4_nofp_f_nip FNIP ( x1 x2 -- x2 )

    #include <math.h>

FCode p4_nofp_f_nip ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_f_tuck 3
p4_nofp_f_tuck FTUCK ( x1 x2 -- x2 x1 x2 )

    #include <math.h>

FCode p4_nofp_f_tuck ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_one_over_f 3
p4_nofp_one_over_f 1/F ( x -- 1/x )

    #include <math.h>

FCode p4_nofp_one_over_f ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_f_square 3
p4_nofp_f_square F^2 ( x -- x^2 )

    #include <math.h>

FCode p4_nofp_f_square ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_f_power_n 3
p4_nofp_f_power_n F^N ( x u -- x^u )

    #include <math.h>

FCode p4_nofp_f_power_n ---

### Description

For large exponents, use F** instead. Of course u=-1 is large.

0.33.71
0.33.71 pfe
p4_nofp_f_two_slash 3
p4_nofp_f_two_slash F2/ ( x -- x/2 )

    #include <math.h>

FCode p4_nofp_f_two_slash ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_f_two_star 3
p4_nofp_f_two_star F2* ( x -- x*2 )

    #include <math.h>

FCode p4_nofp_f_two_star ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_f_zero_greater 3
p4_nofp_f_zero_greater F0> ( x -- flag )

    #include <math.h>

FCode p4_nofp_f_zero_greater ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_nofp_f_zero_not_equal 3
p4_nofp_f_zero_not_equal F0<> ( x -- flag )

    #include <math.h>

FCode p4_nofp_f_zero_not_equal ---

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_gforth_open_dir 3
p4_gforth_open_dir open-dir ( c_addr u -- wdirid wior ) gforth open_dir

    #include <pfe/pfe-base.h>

FCodep4_gforth_open_dir ---

### Description

will vanish without warning. see gforth documentation.

0.33.71
0.33.71 pfe
p4_gforth_read_dir 3
p4_gforth_read_dir read-dir ( c_addr u1 wdirid -- u2 flag wior ) gforth read_dir

    #include <pfe/pfe-base.h>

FCodep4_gforth_read_dir ---

### Description

will vanish without warning. see gforth documentation.

0.33.71
0.33.71 pfe
p4_gforth_close_dir 3
p4_gforth_close_dir close-dir ( wdirid -- wior ) gforth close_dir

    #include <pfe/pfe-base.h>

FCodep4_gforth_close_dir ---

### Description

will vanish without warning. see gforth documentation.

0.33.71
0.33.71 pfe
p4_gforth_linked 3
p4_gforth_linked linked ( list -- ) \ gforth

    #include <pfe/pfe-base.h>

FCode p4_gforth_linked ---

### Description

      : linked        here over @ a, swap ! ;

(note: win32forth calls it "link," )

0.33.71
0.33.71 pfe
p4_gforth_chained 3
p4_gforth_chained chained ( xt list -- ) \ gforth

    #include <pfe/pfe-base.h>

FCodep4_gforth_chained ---

### Description

generic chains

      : chained  linked , ;

0.33.71
0.33.71 pfe
p4_gforth_chainperform 3
p4_gforth_chainperform chainperform ( list -- ) \ gforth

    #include <pfe/pfe-base.h>

FCode p4_gforth_chainperform ---

### Description

      : chainperform  BEGIN @ dup WHILE dup cell+ perform REPEAT drop ;

0.33.71
0.33.71 pfe
p4_to_name 3
p4_to_name >NAME ( cfa -- nfa )

    #include <pfe/header-ext.h>

FCode p4_to_name ---

### Description

converts a pointer to the code-field (CFA) to point then to the corresponding name-field (NFA)

      implementation-specific simulation:
        : &gt;NAME  &gt;LINK L&gt;NAME ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_to_link 3
p4_to_link >LINK ( cfa -- lfa )

    #include <pfe/header-ext.h>

FCode p4_to_link ---

### Description

converts a pointer to the code-field (CFA) to point then to the corresponding link-field (LFA) - in some configurations this can be a very slow operation since the system might need to walk through all header-words in the system, looking for a `>NAME` that has the cfa and *then* returning the "N>LINK" result here - which might be none at all if the word is a `:NONAME`. Use always `>NAME` and treat this word as non-portable just like any assumption about the contents of the `>LINK`-field. Only in fig-mode and for traditional fig-mode programs, this word may possibly have enough extra assertions to be somewhat reliable. (and fig-mode did not know about `SYNONYM`s - see note at `LINK>`).

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_body_from 3
p4_body_from BODY> ( pfa -- cfa )

    #include <pfe/header-ext.h>

FCode p4_body_from ---

### Description

trying to convert a pointer to the parameter-field (PFA) to point then to the corresponding code-field (CFA) - note that this is not necessarily the inverse of `>BODY` instead it is a fast implementation assuming a `VARIABLE` thing had been used. Every use of "BODY>" is warned in the logfile.

      implementation-specific simulation:
        : BODY&gt; CELL - ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_name_from 3
p4_name_from NAME> ( nfa -- cfa )

    #include <pfe/header-ext.h>

FCode p4_name_from ---

### Description

converts a pointer to the name-field (NFA) to point then to the corresponding code-field (CFA)

In all cases but a `SYNONYM` the pfe will behave not unlike the original fig-forth did - being identical to `N>LINK` `LINK>` .

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_link_from 3
p4_link_from LINK> ( lfa -- cfa )

    #include <pfe/header-ext.h>

FCode p4_link_from ---

### Description

converts a pointer to the link-field (LFA) to point then to the corresponding code-field (CFA)

BEWARE: this one does not care about `SYNONYM`s and it is the only way to get at the data of a `SYNONYM`. Therefore, if you have a synonym called A for an old word B then there is a different result using "NAME>" on an A-nfa or using "N>LINK LINK>" since the first "NAME>" will return the xt of B while the latter will return the xt of A - but executing an xt of A is an error and it will `THROW`

this difference is intentional to allow knowledgable persons to do weird things looking around in the dictionary. The forth standard words will not give you much of a chance to get hold of the nfa of a `SYNONYM` word anyway - asking `FIND` for a word A will return the execution token of B immediatly and "NAME>" on that one lead to the nfa of B and not that of A.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_l_to_name 3
p4_l_to_name L>NAME ( lfa -- nfa )

    #include <pfe/header-ext.h>

FCode p4_l_to_name ---

### Description

converts a pointer to the link-field (LFA) to point then to the corresponding name-field (CFA) - this one is one of the slowest operation available. One should always use the inverse operation `N>LINK` and cache an older value if that is needed. Some words might be linked but they do not have a name-field (just the other fields) but this word can not detect that and will try to look into the bits of the dictionary anway in the assumption that there is something - and if done in the wrong place it might even segfault. Only in fig-mode and for traditional fig-mode programs, this word may possibly have enough extra assertions to be somewhat reliable. (and fig-mode did not know about `SYNONYM`s - see note at `LINK>`).

      implementation-specific configure-dependent fig-only simulation:
      : L&gt;NAME BEGIN DUP C@ 128 AND 0= WHILE 1- REPEAT ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_n_to_link 3
p4_n_to_link N>LINK ( nfa -- lfa )

    #include <pfe/header-ext.h>

FCode p4_n_to_link ---

### Description

converts a pointer to the name-field (NFA) to point then to the corresponding link-field (LFA) - this operation is quicker than the inverse `L>NAME`. This word is a specific implementation detail and should not be used by normal users - instead use always `NAME>` which is much more portable. Many systems may possibly not even have a `>LINK`-field in the sense that a `@` on this adress will lead to another `>NAME`. Any operation on the resulting `>LINK`-adress is even dependent on the current configuration of PFE - only in fig-mode you are asserted to have the classic detail. (and fig-mode did not know about `SYNONYM`s - see note at `LINK>`).

      implementation-specific configure-dependent fig-only simulation:
        : N&gt;LINK  C@ + ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_to_ffa 3
p4_to_ffa >FFA ( nfa -- ffa ) obsolete

    #include <pfe/header-ext.h>

FCode p4_to_ffa ---

### Description

converts a pointer to the name-field (NFA) to point then to the corresponding flag-field (FFA) - in traditinal Forth this is the same address. pfe _can_ do different.

      implementation-specific configure-dependent simulation:
        : FFA  1- ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ffa_from 3
p4_ffa_from FFA> ( ffa -- nfa ) obsolete

    #include <pfe/header-ext.h>

FCode p4_ffa_from ---

### Description

converts a pointer to the flag-field (FFA) to point then to the corresponding name-field (NFA) - in traditinal Forth this is the same address. pfe _can_ do different.

      implementation-specific configure-dependent simulation:
        : FFA  1+ ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_name_to_string 3
p4_name_to_string NAME>STRING ( name-token -- str-ptr str-len )

    #include <pfe/header-ext.h>

FCode p4_name_to_string ---

### Description

convert a name-token into a string-span, used to detect the name for a word and print it. The word `ID.` can be defined as

      : ID. NAME&gt;STRING TYPE ;

the implementation of `NAME>STRING` depends on the header layout that is defined during the configuration of the forth system.

      : NAME&gt;STRING COUNT 31 AND ; ( for fig-like names )
      : NAME&gt;STRING COUNT ;        ( default, name is a simple counted string )
      : NAME&gt;STRING @ ZCOUNT ;     ( name-token is a pointer to a C-level string )
      : NAME&gt;STRING COUNT 31 AND   ( hybrid of fig-like and zero-terminated )
           DUP 31 = IF DROP 1+ ZCOUNT THEN
      ;
      : NAME&gt;STRING HEAD:: COUNT CODE:: PAD PLACE PAD ; ( different i86 segments )

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_header_comma 3
p4_header_comma HEADER, ( str-ptr str-len -- )

    #include <pfe/header-ext.h>

FCode p4_header_comma ---

### Description

`CREATE` a new header in the dictionary from the given string, without CFA

      usage: : VARIABLE  BL WORD COUNT HEADER, DOVAR , ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_str_header 3
p4_str_header $HEADER ( bstring -- )

    #include <pfe/header-ext.h>

FCode p4_str_header ---

### Description

`CREATE` a new header in the dictionary from the given string with the variable runtime (see `HEADER,` and `CREATE:`)

      usage: : VARIABLE  BL WORD $HEADER ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_latest 3
p4_latest LATEST ( -- nfa )

    #include <pfe/header-ext.h>

FCode p4_latest ---

### Description

return the NFA of the lateset definition in the `CURRENT` vocabulary

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_smudge 3
p4_smudge SMUGDE ( -- )

    #include <pfe/header-ext.h>

FCode p4_smudge ---

### Description

the FIG definition toggles the `SMUDGE` bit, and not all systems have a smudge bit - instead one should use `REVEAL` or `HIDE`

      : SMUDGE LAST @ &gt;FFA SMUDGE-MASK TOGGLE ;
      : SMUDGE LAST @ NAME-FLAGS@ SMUDGE-MASK XOR LAST @ NAME-FLAGS! ;
      : HIDE   LAST @ NAME-FLAGS@ SMUDGE-MASK  OR LAST @ NAME-FLAGS! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_hide 3
p4_hide HIDE ( -- )

    #include <pfe/header-ext.h>

FCode p4_hide ---

### Description

the FIG definition toggles the `SMUDGE` bit, and not all systems have a smudge bit - instead one should use `REVEAL` or `HIDE`

      : HIDE LAST @ FLAGS@ SMUDGE-MASK XOR LAST @ FLAGS! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_reveal 3
p4_reveal REVEAL ( -- )

    #include <pfe/header-ext.h>

FCode p4_reveal ---

### Description

the FIG definition toggles the `SMUDGE` bit, and not all systems have a smudge bit - instead one should use `REVEAL` or `HIDE`

      : REVEAL LAST @ FLAGS@ SMUDGE-MASK INVERT AND LAST @ FLAGS! ;
      : REVEAL LAST @ CHAIN-INTO-CURRENT ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_name_flags_fetch 3
p4_name_flags_fetch NAME-FLAGS@ ( nfa -- nfa-flags )

    #include <pfe/header-ext.h>

FCode p4_name_flags_fetch ---

### Description

get the nfa-flags that corresponds to the nfa given. Note that in the fig-style would include the nfa-count in the lower bits. (see `NAME-FLAGS!`)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_name_flags_store 3
p4_name_flags_store NAME-FLAGS! ( nfa-flags nfa -- )

    #include <pfe/header-ext.h>

FCode p4_name_flags_store ---

### Description

set the nfa-flags of nfa given. Note that in the fig-style the nfa-flags would include the nfa-count in the lower bits - therefore this should only set bits that had been previously retrieved with `NAME-FLAGS@`

      : IMMEDIATE LAST @ NAME-FLAGS@ IMMEDIATE-MASK OR LAST @ NAME-FLAGS! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_defer_RT 3
p4_defer_RT ((DEFER)) ( -- )

    #include <pfe/header-ext.h>

FCode p4_defer_RT ---

### Description

runtime of `DEFER` words

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_defer 3
p4_defer DEFER ( 'word' -- )

    #include <pfe/header-ext.h>

FCode p4_defer ---

### Description

create a new word with ((DEFER))-semantics

      simulate:
        : DEFER  CREATE 0, DOES&gt; ( the ((DEFER)) runtime )
           @ ?DUP IF EXECUTE THEN ;
        : DEFER  DEFER-RT HEADER 0 , ;

declare as `"DEFER deferword"` and set as `"['] executionword IS deferword"` (in pfe, you can also use `TO deferword` to set the execution)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_is 3
p4_is IS ( xt-value [word] -- )

    #include <pfe/header-ext.h>

FCode p4_is ---

### Description

set a `DEFER` word (in pfe: set the DOES-field - which is the BODY-field in ans-mode and therefore the same as `TO` / in fig-mode the DOES-field is one cell higher up than for a `CREATE:` `VARIABLE` Use `IS` freely on each DOES-words in both modes).

      : IS '
        STATE @ IF LITERAL, POSTPONE &gt;DOES-BODY POSTPONE !
        ELSE &gt;DOES-BODY ! THEN
      ; IMMEDIATE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_action_of 3
p4_action_of ACTION-OF ( [word] -- xt-value )

    #include <pfe/header-ext.h>

FCode p4_action_of ---

### Description

get the `BEHAVIOR` of a `DEFER` word when executed. If being compiled then the ACTION-OF will be the value of [word] at the time of execution and not that of compilation time (non-constant).

In PFE it does actually pick whatever is stored in the DOES-field of a word and therefore ACTION-OF may applied to all DOES-words.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_defer_store 3
p4_defer_store DEFER! ( xt-value xt-defer -- )

    #include <pfe/header-ext.h>

FCode p4_defer_store ---

### Description

A Forth200x definition that is not very useful.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_defer_fetch 3
p4_defer_fetch DEFER@ ( xt1 -- xt2 )

    #include <pfe/header-ext.h>

FCode p4_defer_fetch ---

### Description

get the execution token xt2 that would be executed by the `DEFER` identified by xt1.

This command is used to obtain the execution contents of a deferred word. A typical use would be to retrieve and save the execution behavior of the deferred word, set the deferred word to a new behavior, and then later restore the old behavior.

If the deferred word identified by _xt1_ is associated with some other deferred word, _xt2_ is the execution token of that other deferred word. To retrieve the execution token of the word currently associated with that other deferred word, use the phrase DEFER@ DEFER@ .

Experience: BEHAVIOR was used many years in OpenBoot and OpenFirmware systems.

In PFE it is the inverse of an `IS` operation and it will never fail if applied to a word with atleast a body. That's just like `IS` can be applied to almost every `DOES>` word where `DEFER@` will get the value back.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_alias 3
p4_alias ALIAS ( some-xt* "name" -- ) [EXT]

    #include <pfe/header-ext.h>

FCode p4_alias ---

### Description

create a defer word that is initialized with the given x-token. `DO-ALIAS`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_synonym_RT 3
p4_synonym_RT ((SYNONYM))

    #include <pfe/header-ext.h>

FCode_RT p4_synonym_RT ---

### Description

should not actually be called ever.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_obsoleted_RT 3
p4_obsoleted_RT ((OBSOLETED))

    #include <pfe/header-ext.h>

FCode_RT p4_obsoleted_RT ---

### Description

should not actually be called ever.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_synonym 3
p4_synonym SYNONYM ( "newname" "oldname" -- )

    #include <pfe/header-ext.h>

FCode p4_synonym ---

### Description

make an name-alias for a word - this is very different from a `DEFER` since a `DEFER` will resolve at runtime. Changing the target of a `DEFER` via `IS` will result in changing the `BEHAVIOR` of all words defined earlier and containing the name of the `DEFER`.

A `SYNONYM` however does not have any data field (theoretically not even an execution token), instead it gets resolved at compile time. In theory, you can try to `FIND` the name of the `SYNONYM` but as soon as you apply `NAME>` the execution token of the end-point is returned. This has also the effect that using the inverse `>NAME` operation will result in the name-token of the other name.

        SYNONYM CREATE &lt;BUILDS ( like it is in ANS Forth )
        : FOO CREATE DOES&gt; @ ;
        SEE FOO
        : foo &lt;builds
          does&gt; @ ;
        SYNONYM CREATE CREATE:
        : BAR CREATE 10 ALLOT ;
        SEE BAR
        : bar create: 10 allot ;

(only `LINK>` does not care about `SYNONYM`s)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_obsoleted 3
p4_obsoleted "SYNONYM-OBSOLETED ( "newname" "oldname" -- )

    #include <pfe/header-ext.h>

FCode p4_obsoleted ---

### Description

same as `SYNONYM` but on the first use an error message will be displayed on both the screen and the sys-log.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_deprecated 3
p4_deprecated (DEPRECATED: ( "newname" [message<closeparen;>] -- )

    #include <pfe/header-ext.h>

FCode p4_deprecated ---

### Description

add a message for the following word "newname" that should be shown once upon using the following word. Use it like

        (DEPRECATED: myword is obsoleted in Forth200X)
        : myword ." hello world" ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_check_deprecated 3
p4_check_deprecated (CHECK-DEPRECATED) ( nfa* -- nfa* )

    #include <pfe/header-ext.h>

FCode p4_check_deprecated ---

### Description

an internal function that will check a word name to have any deprecation attribution - some words have a (one time) message to be shown to the user, while `OBSOLETED-SYNONYM` will show a message and rebuild itself as a normal SYNONYM. - Note that most deprecations are only shown once and that they are not emitted when having REDEFINED-MSG OFF.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_extern_deprecated 3
p4_extern_deprecated EXTERN,-DEPRECATED: ( "newname" zstring* -- )

    #include <pfe/header-ext.h>

FCode p4_extern_deprecated ---

### Description

compile a pointer to an extern (loader) z-string to the dictionary and on execution show a deprecation message once. Note: the new name is smudged+immediate, so it you can not `FIND` it right after compilation.

see also `(DEPRECATED:` name message) for the real thing

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_logmessage 3
p4_logmessage EXTERN,-LOGMESSAGE: ( "newname" zstring* -- )

    #include <pfe/header-ext.h>

FCode p4_logmessage ---

### Description

compile a pointer to an extern (loader) z-string to the dictionary and on execution show a logging message once. Note: this name is NOT smudged+immediate.

see also `(DEPRECATED:` name message) for deprecation messages

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dictvar_RT 3
p4_dictvar_RT ...

    #include <pfe/header-sub.h>

FCode_RT p4_dictvar_RT ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dictget_RT 3
p4_dictget_RT ...

    #include <pfe/header-sub.h>

FCode_RT p4_dictget_RT ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren_help 3
p4_paren_help (HELP) ( str-ptr str-len -- )

    #include <pfe/help-ext.h>

FCode p4_paren_help ---

### Description

display help for the specified word (not functional yet)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_open_terminal_logfile 3
p4_open_terminal_logfile OPEN-TERMINAL-LOGFILE ( s-buf s-len -- )

    #include <pfe/main-k12.h>

FCode p4_open_terminal_logfile ---

### Description

open terminal logfile named by the string-buffer all further output to the terminal window is also logged into this file. This is especially useful in embedded environments where the terminal connection is often not used or it is directed to a different location that does not easily allow to redirect the forth output to a file for further examination.

0.33.71
0.33.71 pfe
p4_close_terminal_logfile 3
p4_close_terminal_logfile CLOSE-TERMINAL-LOGFILE ( -- )

    #include <pfe/main-k12.h>

FCode p4_close_terminal_logfile ---

### Description

close terminal logfile opened with `OPEN-TERMINAL-LOGFILE`

0.33.71
0.33.71 pfe
p4_terminal_answer_link 3
p4_terminal_answer_link TERMINAL-ANSWER-LINK ( -- sap#* )

    #include <pfe/main-k12.h>

FCode p4_terminal_answer_link ---

### Description

send terminal-output as a data-message to the specified link sap. Unlike `TERMINAL-OUTPUT-LINK` the data-messages are in line-mode. The flushed characters are buffered until a non-printable character is seen. This is somewhat more useful when treating pfe as a print service and testing machine, but can not provide for interactivity.

      60 TERMINAL-ANSWER-LINK !
      ...
      TERMINAL-ANSWER-LINK OFF

0.33.71
0.33.71 pfe
p4_terminal_output_link 3
p4_terminal_output_link TERMINAL-OUTPUT-LINK ( -- sap#* )

    #include <pfe/main-k12.h>

FCode p4_terminal_output_link ---

### Description

send terminal-output as a data-message to the specified link sap. This can be used in an embedded systems for a terminal session simulation. setting zero-sap will disable sending message-frames (the zero sap is therefore not usable for output-to-link). The startup default is zero.

      60 TERMINAL-OUTPUT-LINK !
      ...
      TERMINAL-OUTPUT-LINK OFF

0.33.71
0.33.71 pfe
p4_terminal_input_link 3
p4_terminal_input_link TERMINAL-INPUT-LINK ( -- sap#* )

    #include <pfe/main-k12.h>

FCode p4_terminal_input_link ---

### Description

let the forth stdin-handling look for data-messages on this link too. These will be interpreted like messages that come from the interactive forth terminal. This can be used in an embedded systems for a terminal session simulation. setting zero-sap will disable interpreting these incoming data-frames as keyboard-strings (so that the zero sap is therefore not usable for an input-link!). The startup default is zero.

      60 TERMINAL-INPUT-LINK !
      ...
      TERMINAL-INPUT-LINK OFF

0.33.71
0.33.71 pfe
p4_terminal_emulation_state 3
p4_terminal_emulation_state TERMINAL-EMULATION-STATE ( -- state* )

    #include <pfe/main-k12.h>

FCodep4_terminal_emulation_state ---

### Description

returns the address of the emulations state variable so it can be read and explicitly changed to another value from forth text. This is a very questionable thing to do as the emulation-state is actually an enumerated value, the ESE will just show question-marks setting this variable to something not understood.

0.33.71
0.33.71 pfe
p4_paren_local 3
p4_paren_local (LOCAL) ( strptr strcnt -- )

    #include <pfe/locals-ext.h>

FCode p4_paren_local ---

### Description

this word is used to create compiling words that can declare `LOCALS|` - it shall not be used directly to declare a local, the pfe provides `LVALUE` for that a purpose beyond `LOCALS|`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_locals_bar 3
p4_locals_bar LOCALS| ( xN ... x2 x1 [name1 .. nameN <|>] -- )

    #include <pfe/locals-ext.h>

FCode p4_locals_bar ---

### Description

create local identifiers to be used in the current definition. At runtime, each identifier will be assigned a value from the parameter stack. The identifiers may be treated as if being a `VALUE` , it does also implement the ansi `TO` extensions for locals. Note that the identifiers are only valid inside the currently compiled word, the `SEE` decompiled word will show them as `<A>` `<B>` ... `<N>` a.s.o. see also `LVALUE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_local_value 3
p4_local_value LVALUE ( value [name] -- )

    #include <pfe/locals-ext.h>

FCode p4_local_value ---

### Description

declares a single local `VALUE` using `(LOCAL)` - a sequence of `LVALUE` declarations can replace a `LOCALS|` argument, ie. `LOCALS| a b c |` is the same as `LVALUE a LVALUE b LVALUE c` . This should also clarify the runtime stack behaviour of `LOCALS|` where the stack parameters seem to be assigned in reverse order as opposed to their textual identifier declarations. compare with `VALUE` and the pfe's convenience word `VAR`.

      : LVALUE
        STATE @ IF
          VALUE
        ELSE
          BL WORD COUNT DUP (LOCAL) (TO)
        THEN
      ; IMMEDIATE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_local_buffer_var 3
p4_local_buffer_var LBUFFER: ( size [name] -- )

    #include <pfe/locals-ext.h>

FCode p4_local_buffer_var ---

### Description

declares a single local `VALUE` using `(LOCAL)` - which will hold the address of an area like `BUFFER:` but carved from the return-stack (as in C with alloca). This local buffer will be automatically given up at the end of the word. The return-stack-pointer will be increased only at the time of the `p4_local_buffer_var` function (and the address assigned to the `LVALUE`) so that the provided size gets determined at runtime. Note that in some configurations the forth-return-stack area is quite small - for large string operations you should consider to use a `POCKET-PAD` in pfe.

      : LBUFFER:
        STATE @ IF
          BUFFER:
        ELSE
          :NONAME ( size -- rp* ) R&gt; RP@ - DUP RP! SWAP &gt;R ;NONAME
          COMPILE, POSTPONE LVALUE
        THEN
      ; IMMEDIATE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_emu_sendme_command 3
p4_emu_sendme_command BEWARE: helper function, make sure to save LEM context and setup the

    #include <pfe/main-k12.h>

status_t p4_emu_sendme_command(k12_emu_type_t* emul_id, const u8_t* str, int len)

### Description

forth's REGTH (if it uses a cpu register for that). the `p4_emu_sendme_command` function will create an eventbuffer that will land in the term-k12 getevent loop - it will work as if the the string has been magically typed on the terminal. It can be used to send a string from LEM-context (during a config-request) to the PFE-context (in its getevent loop). The string will be implicitly terminated with a CR to start execution in the engine's interpret_loop.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_allocate 3
p4_allocate ALLOCATE ( size# -- alloc*! 0 | 0 errno#! ) [ANS]

    #include <pfe/memory-alloc-ext.h>

FCode p4_allocate ---

### Description

Allocate a chunk of memory from the system heap. use `FREE` to release the memory area back to the system. A code of zero means success.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_free 3
p4_free FREE ( alloc* -- errno# ) [ANS]

    #include <pfe/memory-alloc-ext.h>

FCode p4_free ---

### Description

Free the memory from `ALLOCATE` A code of zero means success.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_resize 3
p4_resize RESIZE ( alloc* newsize# -- alloc*' errno# ) [ANS]

    #include <pfe/memory-alloc-ext.h>

FCode p4_resize ---

### Description

Resize the system memory chunk. A code of zero means success. Our implementation returns the old pointer on failure.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dict_allocate 3
p4_dict_allocate ...

    #include <pfe/os-string.h>

_export void* p4_dict_allocate(int items, int size, int align, void** lower, void** upper)

### Description

(missing description)

0.33.71
0.33.71 pfe
p4_cold 3
p4_cold COLD ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_cold ---

### Description

cold abort - reinitialize everything and go to `QUIT` routine ... this routine is implemented as a warm-boot in pfe.

      : COLD [ ALSO ENVIRONMENT ] EMPTY SCRIPT-FILE INCLUDED QUIT ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_u_d_dot_r 3
p4_u_d_dot_r UD.R ( x,x# r# -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_u_d_dot_r ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_u_d_dot 3
p4_u_d_dot UD. ( x,x# -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_u_d_dot ---

### Description

see also `UD`.R

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_id_dot 3
p4_id_dot ID. ( some-nfa* -- ) [FTH]

    #include <pfe/misc-ext.h>

FCodep4_id_dot ---

### Description

print the name-field pointed to by the nfa-argument. a synonym for .NAME - but this word is more portable due its heritage from fig-forth.

in fig-forth the name-field is effectivly a bstring with some flags, so the nfa's count has to be masked out, e.g.

      : .NAME COUNT 32 AND TYPE ;

in other pfe configurations, the name might not contain the flags it it just a counted string - and there may be even more possibilities.

      : .NAME COUNT TYPE ;

you should more and more convert your code to use the sequence `NAME>STRING` `TYPE` which is widely regarded as the better variant.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dash_roll 3
p4_dash_roll -ROLL ( x...[n-1] y n# -- y x...[n-1] | num# -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_dash_roll ---

### Description

the inverse of `ROLL`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_random 3
p4_random RANDOM ( n# -- random# ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_random ---

### Description

returns random number with 0 <= n2 < n1)

      : RANDOM ?DUP IF _random SWAP MOD ELSE _random THEN ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_srand 3
p4_srand SRAND ( seed# -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_srand ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_plus_under 3
p4_plus_under +UNDER ( n1 x n2 -- n1+n2 x ) [EXT]

    #include <pfe/misc-ext.h>

FCode p4_plus_under ---

### Description

quicker than

      : UNDER+  ROT + SWAP ;

Note: the old pfe version of UNDER+ is obsolete as it is in conflict with a comus word of the same name. The behavior of this word will continue to exist under the name of `(UNDER+)`. Users are encouraged to use the comus behavior of UNDER+ which does already exist under the name of `+UNDER`. In the future pfe will be changed to pick up the comus behavior making UNDER+ and +UNDER to be synonyms. In the current version there will be load-time warning on usages of "UNDER+".

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_under_plus 3
p4_under_plus "(UNDER+)" ( n1 n2 -- n1+n2 n2 ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_under_plus ---

### Description

quicker than

      : (UNDER+) TUCK + SWAP ; or : (UNDER+) DUP UNDER+ ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_plus_to_execution 3
p4_plus_to_execution ((+TO)) ( val -- ) [HIDDEN]

    #include <pfe/misc-ext.h>

FCode_XE p4_plus_to_execution ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_plus_to_local_execution 3
p4_plus_to_local_execution ((+TO.local)) ( val -- ) [HIDDEN]

    #include <pfe/misc-ext.h>

FCode_XE p4_plus_to_local_execution ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_plus_to 3
p4_plus_to +TO ( val [name] -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_plus_to ---

### Description

add the val to the named `VALUE` or `LOCALS|` value

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_build_array 3
p4_build_array BUILD-ARRAY ( x#...[dim] dim# -- memsize# ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_build_array ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_access_array 3
p4_access_array ACCESS-ARRAY ( x#...[dim#] array* --- array* value# ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_access_array ---

### Description

see `BUILD-ARRAY`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_source_line 3
p4_source_line SOURCE-LINE ( -- source-line# ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_source_line ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_source_name 3
p4_source_name SOURCE-NAME ( -- source-name-ptr source-name-len ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_source_name ---

### Description

if `SOURCE` is from `INCLUDE` then the result is the filename, otherwise a generic name for the SOURCE-ID is given.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_th_pocket 3
p4_th_pocket TH'POCKET ( pocket# -- pocket-ptr pocket-len ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_th_pocket ---

### Description

returns the specified pocket as a `S"` string reference

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_pocket_pad 3
p4_pocket_pad POCKET-PAD ( -- pocket-ptr ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_pocket_pad ---

### Description

The `p4_pocket_pad` function Returns the next pocket. A pocket has usually the size of a maxstring, see `ENVIRONMENT /STRING` (but can be configured to be different, mostly when MAXPATH > /STRING ) Note that a pocket is a temporary and forth internal functions do sometimes call `POCKET-PAD` too, especially when building filenames and getting a literal (but temporary) string from the keyboard. Functions are not expected to hold references to this transient area any longer than building a name and calling another word with it.

Usage of a pocket pad is a good way to make local temporary buffers superfluous that are only used to construct a temporary string that usually gets swallowed by another function.

      depracated code:
        create temp-buffer 255 allot
        : make-temp ( str buf )
               temp-buffer place  " .tmp" count temp-buffer append
               temp-buffer count make-file ;
      replace with this:
        : make-temp ( str buf )
             pocket-pad &gt;r
             r place  " .tmp" count r append
             r&gt; count make-file
        ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_wl_hash 3
p4_wl_hash WL-HASH ( buf-ptr buf-len -- buf-hash# ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_wl_hash ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_topmost 3
p4_topmost TOPMOST ( some-wordlist* -- some-topmost-nfa* ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_topmost ---

### Description

that last valid word in the specified vocabulary

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ls_words 3
p4_ls_words LS.WORDS ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_ls_words ---

### Description

see `WORDS`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ls_primitives 3
p4_ls_primitives LS.PRIMITIVES ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_ls_primitives ---

### Description

see `WORDS`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ls_cdefs 3
p4_ls_cdefs LS.COLON-DEFS ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_ls_cdefs ---

### Description

see `WORDS`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ls_ddefs 3
p4_ls_ddefs LS.DOES-DEFS ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_ls_ddefs ---

### Description

see `WORDS`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ls_constants 3
p4_ls_constants LS.CONSTANTS ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_ls_constants ---

### Description

see `WORDS`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ls_variables 3
p4_ls_variables LS.VARIABLES ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_ls_variables ---

### Description

see `WORDS`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ls_vocabularies 3
p4_ls_vocabularies LS.VOCABULARIES ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_ls_vocabularies ---

### Description

see `WORDS`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ls_markers 3
p4_ls_markers LS.MARKERS ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_ls_markers ---

### Description

see `WORDS`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_w_fetch 3
p4_w_fetch W@ ( some-wchar* -- some-wchar# | some* -- some# [?] ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_w_fetch ---

### Description

fetch a 2byte-val from address

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_w_store 3
p4_w_store W! ( value# some-wchar* -- | value# wchar* -- [?] ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_w_store ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_w_plus_store 3
p4_w_plus_store W+! ( value# some-wchar* -- | value# wchar* -- [?] ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_w_plus_store ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_backspace 3
p4_backspace BACKSPACE ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_backspace ---

### Description

reverse of `SPACE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Q_stop 3
p4_Q_stop ?STOP ( -- stop-flag ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_Q_stop ---

### Description

check for 'q' pressed - see => ?CR

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_start_Q_cr 3
p4_start_Q_cr START?CR ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_start_Q_cr ---

### Description

initialized for more-like effect - see => ?CR

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Q_cr 3
p4_Q_cr ?CR ( -- cr-flag ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_Q_cr ---

### Description

like `CR` , stop 25 lines past `START`?CR

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_close_all_files 3
p4_close_all_files CLOSE-ALL-FILES ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_close_all_files ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dot_memory 3
p4_dot_memory .MEMORY ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_dot_memory ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dot_status 3
p4_dot_status .STATUS ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_dot_status ---

### Description

display internal variables

      : .STATUS .VERSION .CVERSION .MEMORY .SEARCHPATHS .DICTVARS .REGSUSED ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren_emit 3
p4_paren_emit (EMIT) ( char# -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_paren_emit ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren_expect 3
p4_paren_expect (EXPECT) ( a b -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_paren_expect ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren_key 3
p4_paren_key (KEY) ( -- key# ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_paren_key ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren_type 3
p4_paren_type (TYPE) ( str* len# -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_paren_type ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_standard_io 3
p4_standard_io STANDARD-I/O ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_standard_io ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_executes_execution 3
p4_executes_execution ((EXECUTES)) ( fkey# -- ) [HIDDEN]

    #include <pfe/misc-ext.h>

FCode_XE p4_executes_execution ---

### Description

compiled by `EXECUTES`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_executes 3
p4_executes EXECUTES ( fkey# [word] -- ) [EXT]

    #include <pfe/misc-ext.h>

FCode p4_executes ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_help 3
p4_help HELP ( "name" -- ) [FTH] [EXEC]

    #include <pfe/misc-ext.h>

FCode p4_help ---

### Description

will load the help module in the background and hand over the parsed name to `(HELP)` to be resolved. If no `(HELP)` word can be loaded, nothing will happen.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_edit_blockfile 3
p4_edit_blockfile EDIT-BLOCKFILE ( "name" -- ) [FTH] [EXEC]

    #include <pfe/misc-ext.h>

FCode p4_edit_blockfile ---

### Description

will load the edit module in the background and look for a word called `EDIT-BLOCK` that could be used to edit the blockfile. If no `EDIT-BLOCKFILE` word can be loaded, nothing will happen. Otherwise, `OPEN-BLOCKFILE` is called followed by `0` `EDIT-BLOCK` to start editing the file at the first block.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_argc 3
p4_argc ARGC ( -- arg-count ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_argc ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_argv 3
p4_argv ARGV ( arg-n# -- arg-ptr arg-len ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_argv ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_expand_fn 3
p4_expand_fn EXPAND-FN ( name-ptr name-len buf-ptr -- buf-ptr buf-len ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_expand_fn ---

### Description

      : e.g. s" includefile" POCKET-PAD EXPAND-FN ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_load_quote_execution 3
p4_load_quote_execution ((LOAD")) ( -- ? ) [HIDDEN]

    #include <pfe/misc-ext.h>

FCode_XE p4_load_quote_execution ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_load_quote 3
p4_load_quote LOAD" ( [filename<">] -- ??? ) [FTH] [OLD]

    #include <pfe/misc-ext.h>

FCode p4_load_quote ---

### Description

load the specified file - this word can be compiled into a word-definition obsolete! use `OPEN-BLOCKFILE` name `LOAD`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_system 3
p4_system SYSTEM ( command-ptr command-len -- command-exitcode# ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_system ---

### Description

run a shell command (note: embedded systems have no shell)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_system_quote_execution 3
p4_system_quote_execution ((SYSTEM")) ( ... -- exitcode# ) [HIDDEN]

    #include <pfe/misc-ext.h>

FCode_XE p4_system_quote_execution ---

### Description

compiled by `SYSTEM"` commandline"

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_system_quote 3
p4_system_quote SYSTEM" ( [command-line<">] -- command-exitcode# ) [FTH] [OLD]

    #include <pfe/misc-ext.h>

FCode p4_system_quote ---

### Description

run a shell command (note:embedded systems have no shell) obsolete! use `S"` string" `SYSTEM`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_create_var 3
p4_create_var CREATE: ( "name" -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_create_var ---

### Description

this creates a name with the `VARIABLE` runtime. Note that this is the FIG-implemenation of `CREATE` whereas in ANS-Forth mode we have a `CREATE` identical to FIG-style `<BUILDS`

      : CREATE: BL WORD $HEADER DOVAR A, ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_buffer_var 3
p4_buffer_var BUFFER: ( size# "name" -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_buffer_var ---

### Description

this creates a name with the `VARIABLE` runtime and `ALLOT`s memory

      : BUFFER: BL WORD $HEADER DOVAR A, ALLOT ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_r_tick_fetch 3
p4_r_tick_fetch R'@ ( R: a b -- a R: a b ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_r_tick_fetch ---

### Description

fetch the next-under value from the returnstack. used to interpret the returnstack to hold two `LOCALS|` values. ( `R@` / `2R@` / `R>DROP` / `R"@`)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_r_tick_store 3
p4_r_tick_store R'! ( x R: a b -- R: x b ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_r_tick_store ---

### Description

store the value into the next-under value in the returnstack. used to interpret the returnstack to hold two `LOCALS|` values. see `R'@` for inverse operation

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_r_quote_fetch 3
p4_r_quote_fetch R"@ ( R: a b c -- a R: a b c ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_r_quote_fetch ---

### Description

fetch the second-under value from the returnstack. used to interpret the returnstack to hold three `LOCALS|` values. see `R"!` for inverse operation ( `R'@` `R@` / `2R@` / `R>DROP` )

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_r_quote_store 3
p4_r_quote_store R"! ( x R: a b c -- R: x b c ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_r_quote_store ---

### Description

store the value into the second-under value in the returnstack. used to interpret the returnstack to hold three `LOCALS|` values. see `R"@` for inverse operation

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_r_store 3
p4_r_store R! ( x R: a -- R: x ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_r_store ---

### Description

store the value as the topmost value in the returnstack. see `R@` for inverse operation ( `R'@` / `R"@` / `2R@` / `2R!`)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_r_store 3
p4_two_r_store 2R! ( x y R: a b -- R: x y ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_two_r_store ---

### Description

store the value as the topmost value in the returnstack. see `2R@` for inverse operation ( `R'@` / `R"@` / `2R@` / `2R!`)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dup_to_r 3
p4_dup_to_r DUP>R ( val -- val R: val ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_dup_to_r ---

### Description

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

      : DUP&gt;R DUP &gt;R ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_r_from_drop 3
p4_r_from_drop R>DROP ( R: val -- R: ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_r_from_drop ---

### Description

shortcut (e.g. in CSI-Forth) note that the access to R is configuration dependent - only in a traditional fig-forth each NEST will be one cell wide - in case that there are no `LOCALS|` of course. And remember, the word above reads like the sequence `R>` and `DROP` but that is not quite true.

      : R&gt;DROP R&gt; DROP ; ( is bad - correct might be )  : R&gt;DROP R&gt; R&gt; DROP &gt;R ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_r_from_drop 3
p4_two_r_from_drop 2R>2DROP ( R: a b -- R: ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_two_r_from_drop ---

### Description

this is two times `R>DROP` but a bit quicker. it is however really quick compared to the sequence `2R>` and `2DROP`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_clearstack 3
p4_clearstack CLEARSTACK ( -- ) [FTH]

    #include <pfe/misc-ext.h>

FCode p4_clearstack ---

### Description

reset the parameter stack to be empty

      : CLEARSTACK  S0 SP! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_module 3
p4_module MODULE ( "name" -- old-current )

    #include <pfe/pfe-base.h>

FCode p4_module ---

### Description

create a new `WORDLIST` with the given name. It will also have an implicit hidden vocabulary just as well and all `DEFINITIONS` will go into that hidden wordlist. Therefore the old `CURRENT` is memorized on the cs-stack.

effectivly, CONTEXT[1] will have the wordlist-id of the public wordlist "name" and CONTEXT[0] will have the hidden wordlist contained in "name" - the hidden wordlist will always be known as HIDDEN' so that it can be re-referenced without need to use `ALSO` just to access a single definition from just another vocabulary. Note that HIDDEN' is defined immediate (a `VOCABULARY'` ) to modify the `ORDER` inside a colon definition.

      : MODULE
        CURRENT @ ( -- old-current )
        VOCABULARY
        ALSO LATEST NAME&gt; EXECUTE ALSO DEFINITIONS
        C" HIDDEN'" $CREATE WORDLIST CONTEXT !
      ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_end_module 3
p4_end_module END-MODULE ( old-current -- )

    #include <pfe/pfe-base.h>

FCode p4_end_module ---

### Description

clean up the cs-stack from the last `MODULE` definition. Effectivly, MODULE definitions can be nested.

      : END-MODULE ( old-current )
        PREVIOUS PREVIOUS CURRENT !

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_export 3
p4_export EXPORT ( old-current "name" -- old-current )

    #include <pfe/pfe-base.h>

FCode p4_export ---

### Description

the named word in the hidden dictionary (i.e. the wordlist referenced in `CURRENT`) is exported into the public wordlist of it (i.e. which is in this implementation `CONTEXT`[1]). The actual implemenation will create a `DEFER`-word in the public wordlist withits parameter area pointing to the cfa of the hidden implementation.

      : EXPORT
        CURRENT @ CONTEXT CELL+ @ CURRENT !
        DEFER CURRENT !
        LATEST COUNT CURRENT @ SEARCH-WORDLIST
        IF LATEST NAME&gt; &gt;BODY ! ELSE ABORT" can't find word to export" THEN
      ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_expose_module 3
p4_expose_module EXPOSE-MODULE ( "name" -- )

    #include <pfe/pfe-base.h>

FCode p4_expose_module ---

### Description

affects the search order, ALSO module-wid CONTEXT ! hidden'

      : EXPOSE-MODULE
         ALSO S" HIDDEN'"
         ' DUP VOC? ABORT?" is no vocabulary" &gt;VOC
         SEARCH-WORDLIST 0= IF " no hidden vocabulary found" THEN
         DUP VOC? ABORT?" hidden is no vocabulary" EXECUTE
      ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_also_module 3
p4_also_module ALSO-MODULE ( "name" -- )

    #include <pfe/pfe-base.h>

FCode p4_also_module ---

### Description

affects the search-order, ALSO module-wid CONTEXT !

      : ALSO-MODULE
        ' DUP VOC? ABORT?" is no vocabulary"
        ALSO EXECUTE
      ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_nvram_words 3
p4_nvram_words NVRAM,WORDS ( -- )

    #include <pfe/option-ext.h>

FCode p4_nvram_words ---

### Description

Print a list of `WORDS` in the NVRAM buffer. Try to show also the current value, atleast for NVRAM numbers and strings. Words can be added or changed with the help of `NVRAM`,SET or `NVRAM`,USE

Values in the NVRAM buffer will survive a `COLD` reboot, in many hosted environments however the NVRAM will be lost on program exit.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 2001 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_nvram_as 3
p4_nvram_as NVRAM,AS ( str-ptr str-len "varname" -- )

    #include <pfe/option-ext.h>

FCode p4_nvram_as ---

### Description

set the NVRAM variable to the specified string.

Some NVRAM strings do not take effect until next `COLD` reboot.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 2001 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_nvram_to 3
p4_nvram_to NVRAM,TO ( number "varname" -- )

    #include <pfe/option-ext.h>

FCode p4_nvram_to ---

### Description

set the NVRAM variable to the specified number.

Most NVRAM numbers do not take effect until next `COLD` reboot.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 2001 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_nvram_z_fetch 3
p4_nvram_z_fetch NVRAM,Z@ ( "varname" -- z-str )

    #include <pfe/option-ext.h>

FCode p4_nvram_z_fetch ---

### Description

Return the string pointer of the NVRAM string item, or null if no such item exists.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 2001 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_nvram_s_fetch 3
p4_nvram_s_fetch NVRAM,S@ ( "varname" -- str-ptr str-len )

    #include <pfe/option-ext.h>

FCode p4_nvram_s_fetch ---

### Description

Return the string span of the NVRAM string item, or double null if no such item exists.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 2001 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_nvram_Q_fetch 3
p4_nvram_Q_fetch NVRAM,?@ ( number "varname" -- number' )

    #include <pfe/option-ext.h>

FCode p4_nvram_Q_fetch ---

### Description

Return the value of the NVRAM value item, or leave the original number untouched (i.e. the default value for your option).

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 2001 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_SetOptionsDefault 3
p4_SetOptionsDefault ...

    #include <pfe/option-set.h>

_export void p4_SetOptionsDefault(p4_sessionP set, int len)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_AddOptions 3
p4_AddOptions ...

    #include <pfe/option-set.h>

_export int p4_AddOptions(p4_sessionP set, int argc, const char** argv)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_SetOptions 3
p4_SetOptions ...

    #include <pfe/option-set.h>

_export int p4_SetOptions(p4_sessionP set, int len, int argc, const char** argv)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_FreeOptions 3
p4_FreeOptions

    #include <pfe/option-set.h>

_export int p4_FreeOptions(int returncode, p4_sessionP set)

### Description

de-init the session struct

`p4_SetOptions` , `p4_AddOptions`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_SetModules 3
p4_SetModules ...

    #include <pfe/option-set.h>

_export int p4_SetModules(p4_sessionP set, p4Words* modules)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2003. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_gettimeofday 3
p4_gettimeofday

    #include <pfe/pfe-base.h>

_export void p4_gettimeofday(p4ucell* sec, p4ucell* usec)

### Description

helper function - both arg pointers MUST be given

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ntohs 3
p4_ntohs NTOHS ( w -- w' )

    #include <netinet/in.h>

FCode p4_ntohs ---

### Description

if current host-encoding is bigendian, this is a NOOP otherwise byteswap the lower 16-bit bits of the topofstack. see `W@` and `W!` (on some platforms, the upper bits are erased, on others not)

0.33.71
0.33.71 pfe
p4_ntohl 3
p4_ntohl NTOHL ( l -- l' )

    #include <netinet/in.h>

FCode p4_ntohl ---

### Description

if current host-encoding is bigendian, this is a NOOP otherwise byteswap the lower 32-bit bits of the topofstack. see `L@` and `L!` (being usually just `@` and `!` ) (on some platforms, the upper bits are erased, on others not)

0.33.71
0.33.71 pfe
p4_definitions 3
p4_definitions DEFINITIONS ( -- )

    #include <pfe/search-order-ext.h>

FCode p4_definitions ---

### Description

make the current context-vocabulary the definition-vocabulary, that is where new names are declared in. see `ORDER`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_get_current 3
p4_get_current GET-CURRENT ( -- voc )

    #include <pfe/search-order-ext.h>

FCode p4_get_current ---

### Description

return the current definition vocabulary, see `DEFINITIONS`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_get_order 3
p4_get_order GET-ORDER ( -- vocn ... voc1 n )

    #include <pfe/search-order-ext.h>

FCode p4_get_order ---

### Description

get the current search order onto the stack, see `SET-ORDER`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_search_wordlist 3
p4_search_wordlist SEARCH-WORDLIST ( str-ptr str-len voc -- 0 | xt 1 | xt -1 )

    #include <pfe/search-order-ext.h>

FCode p4_search_wordlist ---

### Description

almost like `FIND` or `(FIND)` -- but searches only the specified vocabulary.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_set_current 3
p4_set_current SET-CURRENT ( voc -- )

    #include <pfe/search-order-ext.h>

FCode p4_set_current ---

### Description

set the definition-vocabulary. see `DEFINITIONS`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_set_order 3
p4_set_order SET-ORDER ( vocn ... voc1 n -- )

    #include <pfe/search-order-ext.h>

FCode p4_set_order ---

### Description

set the search-order -- probably saved beforehand using `GET-ORDER`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_wordlist 3
p4_wordlist WORDLIST ( -- voc )

    #include <pfe/search-order-ext.h>

FCode p4_wordlist ---

### Description

return a new vocabulary-body for private definitions.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_also 3
p4_also ALSO ( -- )

    #include <pfe/search-order-ext.h>

FCode p4_also ---

### Description

a `DUP` on the search `ORDER` - each named vocabulary replaces the topmost `ORDER` vocabulary. Using `ALSO` will make it fixed to the search-order. (but it is not nailed in trap-conditions as if using `DEFAULT-ORDER` )

      order:   vocn ... voc2 voc1 -- vocn ... voc2 voc1 voc1

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_order 3
p4_order ORDER ( -- )

    #include <pfe/search-order-ext.h>

FCode p4_order ---

### Description

show the current search-order, followed by the `CURRENT` `DEFINITIONS` vocabulary and the `ONLY` base vocabulary

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_previous 3
p4_previous PREVIOUS ( -- )

    #include <pfe/search-order-ext.h>

FCode p4_previous ---

### Description

the invers of `ALSO` , does a `DROP` on the search `ORDER` of vocabularies.

      order: vocn ... voc2 voc1 -- vocn ... voc2
      example: ALSO PRIVATE-VOC DEFINTIONS (...do some...) PREVIOUS DEFINITIONS

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_default_order 3
p4_default_order DEFAULT-ORDER ( -- )

    #include <pfe/search-order-ext.h>

FCode p4_default_order ---

### Description

nail the current search `ORDER` so that it will even survive a trap-condition. This default-order can be explicitly loaded with `RESET-ORDER`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_reset_order 3
p4_reset_order RESET-ORDER ( -- )

    #include <pfe/search-order-ext.h>

FCode p4_reset_order ---

### Description

load the `DEFAULT-ORDER` into the current search `ORDER` - this is implicitly done when a trap is encountered.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_search_init 3
p4_search_init "ENVIRONMENT WORDLISTS" ( -- value )

    #include <pfe/search-order-ext.h>

FCode p4_search_init ---

### Description

the maximum number of wordlists in the search order

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_getpid 3
p4_getpid $PID ( -- pid )

    #include <pfe/def-comp.h>

FCode p4_getpid ---

### Description

calls system's `getpid`

0.33.71
0.33.71 pfe
p4_getuid 3
p4_getuid $UID ( -- val )

    #include <pfe/def-comp.h>

FCode p4_getuid ---

### Description

calls system's `getuid`

0.33.71
0.33.71 pfe
p4_geteuid 3
p4_geteuid $EUID ( -- val )

    #include <pfe/def-comp.h>

FCode p4_geteuid ---

### Description

calls system's `geteuid`

0.33.71
0.33.71 pfe
p4_getgid 3
p4_getgid $GID ( -- val )

    #include <pfe/def-comp.h>

FCode p4_getgid ---

### Description

calls system's `getgid`

0.33.71
0.33.71 pfe
p4_umask 3
p4_umask UMASK ( val -- ret )

    #include <pfe/def-comp.h>

FCode p4_umask ---

### Description

calls system's `umask`

0.33.71
0.33.71 pfe
p4_home 3
p4_home $HOME ( -- str-ptr str-len )

    #include <pfe/def-comp.h>

FCode p4_home ---

### Description

calls system's `getenv(HOME)`

0.33.71
0.33.71 pfe
p4_user 3
p4_user $USER ( -- str-ptr str-len )

    #include <pfe/def-comp.h>

FCode p4_user ---

### Description

calls system's `getenv(USER)`

0.33.71
0.33.71 pfe
p4_cwd 3
p4_cwd $CWD ( -- str-ptr str-len )

    #include <pfe/def-comp.h>

FCode p4_cwd ---

### Description

calls system's `getcwd`

0.33.71
0.33.71 pfe
p4_pwd 3
p4_pwd PWD ( -- )

    #include <pfe/def-comp.h>

FCode p4_pwd ---

### Description

calls system's `getcwd` and prints it to the screen

      : PWD  $CWD TYPE ;

0.33.71
0.33.71 pfe
p4_chdir 3
p4_chdir CHDIR ( bstring -- )

    #include <pfe/def-comp.h>

FCode p4_chdir ---

### Description

change the current directory. ( (under VxWorks it is global! do not use in scripts!!) )

0.33.71
0.33.71 pfe
p4_install_signal_handlers 3
p4_install_signal_handlers ...

    #include <pfe/signals-ext.h>

_export void p4_install_signal_handlers(void)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_swap_signals 3
p4_swap_signals ...

    #include <pfe/signals-ext.h>

_export void p4_swap_signals(void)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_forth_signal 3
p4_forth_signal ...

    #include <pfe/signals-ext.h>

_export p4xt p4_forth_signal(int sig, p4xt xt)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_load_signals 3
p4_load_signals ...

    #include <pfe/signals-ext.h>

_export void p4_load_signals(p4_Wordl *wid)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_raise 3
p4_raise (RAISE) ( signal# -- ) [FTH]

    #include <pfe/signals-ext.h>

FCode p4_raise ---

### Description

send a `SIGNAL` to self OLD: use RAISE-SIGNAL

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_raise_signal 3
p4_raise_signal RAISE-SIGNAL ( signal# -- ior ) [FTH]

    #include <pfe/signals-ext.h>

FCode p4_raise_signal ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_smart_interpret_char 3
p4_smart_interpret_char ...

    #include <pfe/smart-go-ext.h>

p4xt p4_smart_interpret_char(char c)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
_p4_smart_interpret_init 3
_p4_smart_interpret_init ...

    #include <pfe/smart-go-ext.h>

p4_char_t* _p4_smart_interpret_init(char c, char const * nm, int l)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_smart_interpret_init 3
p4_smart_interpret_init ...

    #include <pfe/smart-go-ext.h>

void p4_smart_interpret_init(char c, char const * nm, int l)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_smart_interpret_store 3
p4_smart_interpret_store SMART-INTERPRET! ( -- )

    #include <pfe/smart-go-ext.h>

FCode p4_smart_interpret_store ---

### Description

enables/disables the SMART-INTERPRET extension in `INTERPRET` , (actually stores an XT in `DEFER` inside the mainloop interpreter)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_changer 3
p4_narrow_changer "NARROW-CHANGER(" ( changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_changer ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_inputlist 3
p4_narrow_inputlist "NARROW-INPUTLIST(" ( changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_inputlist ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_outputlist 3
p4_narrow_outputlist "NARROW-OUTPUTLIST(" ( changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_outputlist ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_input_variant 3
p4_narrow_input_variant "NARROW-INPUT-VARIANT(" ( variant# changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_input_variant ---

### Description

0 = default, 1 = 'S', 2 = 'R', ... 4 = 'P', ... 7 = 'M', .. 14 = 'F'

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_output_variant 3
p4_narrow_output_variant "NARROW-OUTPUT-VARIANT(" ( variant# changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_output_variant ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_input_stack 3
p4_narrow_input_stack "NARROW-INPUT-STACK(" ( stk-char variant# changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_input_stack ---

### Description

0 = default, 1 = 'S', 2 = 'R', ... 4 = 'P', ... 7 = 'M', .. 14 = 'F'

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_output_stack 3
p4_narrow_output_stack "NARROW-OUTPUT-STACK(" ( stk-char variant# changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_output_stack ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_input_argument 3
p4_narrow_input_argument "NARROW-INPUT-ARGUMENT(" ( arg# stk-char variant# changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_input_argument ---

### Description

0 = default, 1 = 'S', 2 = 'R', ... 4 = 'P', ... 7 = 'M', .. 14 = 'F' arg# is [0] = TOS and [1] = UNDER, same as the pick values where 3 2 1 0 2 pick . =:= 2

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_output_argument 3
p4_narrow_output_argument "NARROW-OUTPUT-ARGUMENT(" ( arg# stk-char variant# changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_output_argument ---

### Description

arg# is [0] = TOS and [1] = UNDER, same as the pick values where 3 2 1 0 2 pick . =:= 2

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_input_argument_name 3
p4_narrow_input_argument_name "NARROW-INPUT-ARGUMENT-NAME(" ( arg# stk-char variant# changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_input_argument_name ---

### Description

0 = default, 1 = 'S', 2 = 'R', ... 4 = 'P', ... 7 = 'M', .. 14 = 'F' arg# is [0] = TOS and [1] = UNDER, same as the pick values where 3 2 1 0 2 pick . =:= 2

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_output_argument_name 3
p4_narrow_output_argument_name "NARROW-OUTPUT-ARGUMENT-NAME(" ( arg# stk-char variant# changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_output_argument_name ---

### Description

arg# is [0] = TOS and [1] = UNDER, same as the pick values where 3 2 1 0 2 pick . =:= 2

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_input_argument_type 3
p4_narrow_input_argument_type "NARROW-INPUT-ARGUMENT-TYPE(" ( arg# stk-char variant# changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_input_argument_type ---

### Description

0 = default, 1 = 'S', 2 = 'R', ... 4 = 'P', ... 7 = 'M', .. 14 = 'F' arg# is [0] = TOS and [1] = UNDER, same as the pick values where 3 2 1 0 2 pick . =:= 2

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_output_argument_type 3
p4_narrow_output_argument_type "NARROW-OUTPUT-ARGUMENT-TYPE(" ( arg# stk-char which# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_output_argument_type ---

### Description

arg# is [0] = TOS and [1] = UNDER, same as the pick values where 3 2 1 0 2 pick . =:= 2

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_canonic_input_type 3
p4_canonic_input_type "CANONIC-INPUT-TYPE(" ( arg# stk-char variant# changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_canonic_input_type ---

### Description

0 = default, 1 = 'S', 2 = 'R', ... 4 = 'P', ... 7 = 'M', .. 14 = 'F' arg# is [0] = TOS and [1] = UNDER, same as the pick values where 3 2 1 0 2 pick . =:= 2

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_canonic_output_type 3
p4_canonic_output_type "CANONIC-OUTPUT-TYPE(" ( arg# stk-char variant# changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_canonic_output_type ---

### Description

arg# is [0] = TOS and [1] = UNDER, same as the pick values where 3 2 1 0 2 pick . =:= 2

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_rewriter_test 3
p4_rewriter_test "REWRITER-TEST(" ( "tracked-stack -- input-stack<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_rewriter_test ---

### Description

suppose that the left side is a tracked stack line during compiling and the right side is a candidate changer input stack. Test whethr the candidate does match and the complete changer would be allowed to run a rewrite in the track stack buffer.

Possible conditions include: the left side has not enough arguments or... any argument on the right side has a type specialization that does not match as a valid suffix to their counterpart on the left side.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_rewriter_input_arg 3
p4_rewriter_input_arg "REWRITER-INPUT-ARG(" ( arg# "tracked-stack -- changer<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_rewriter_input_arg ---

### Description

suppose that the left side is a tracked stack line during compiling and the right side is a candidate changer input stack. Assume the righthand candidate does match - look at the given argument on the left side and show the prefix being copied to the output trackstack when the rewrite-rule is gettin applied later.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_rewrite_line 3
p4_rewrite_line "REWRITE-LINE(" ( "stack-layout<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCode p4_rewrite_line ---

### Description

fill rewrite-buffer with a stack-layout to be processed. see `REWRITE-SHOW.`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_rewrite_show 3
p4_rewrite_show "REWRITE-SHOW." ( -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCode p4_rewrite_show ---

### Description

show current rewrite-buffer.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_rewrite_stack_test 3
p4_rewrite_stack_test "REWRITE-STACK-TEST(" ( "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCode p4_rewrite_stack_test ---

### Description

check whether this stackhelp does match on current rewrite-buffer and say oK/No respectivly.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_rewrite_input_arg 3
p4_rewrite_input_arg "REWRITE-INPUT-ARG(" ( arg# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_rewrite_input_arg ---

### Description

check whether this stackhelp does match on current rewrite-buffer and in the given input match show us the argument but only the good prefix i.e. the type constraint being cut off already.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_rewrite_stack_result 3
p4_rewrite_stack_result "REWRITE-STACK-RESULT(" ( "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCode p4_rewrite_stack_result ---

### Description

rewrite the current rewrite-buffer and show the result that would occur with this stackhelp being applied.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_input_notation 3
p4_narrow_input_notation "NARROW-INPUT-NOTATION(" ( notation# changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_input_notation ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_output_notation 3
p4_narrow_output_notation "NARROW-OUTPUT-NOTATION(" ( notation# changer# "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCodep4_narrow_output_notation ---

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_rewrite_stackdef_test 3
p4_rewrite_stackdef_test "REWRITE-STACKDEF-TEST(" ( "stackdef<rp;>" ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCode p4_rewrite_stackdef_test ---

### Description

match a stackdef (single variant of stacks). assume: single variant in rewrite-buffer and single variant in stackdef-arg and only one changer in arg-stackhelp

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_rewrite_stackdef_result 3
p4_rewrite_stackdef_result "REWRITE-STACKDEF-RESULT(" ( "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCode p4_rewrite_stackdef_result ---

### Description

assume: only one changer (if more are provided then only the first is used) only one stackdef variant in inputlist

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_rewrite_test 3
p4_rewrite_test "REWRITE-TEST(" ( "stackhelp<rp;>" -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCode p4_rewrite_test ---

### Description

Test whether the given changer would match the current line. assume: only one changer (if more are provided then only the first is used)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_narrow_inputdef_for_stackdef 3
p4_narrow_inputdef_for_stackdef return 1 if "inputlist" was narrowed.

    #include <pfe/stackhelp-ext.h>

int p4_narrow_inputdef_for_stackdef(pair_t inputlist, pair_t stackdef)

### Description

return 0 if no good inputdef was found in inputlist variants.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_find_stackhelp_body 3
p4_find_stackhelp_body FIND word in the search-order

    #include <pfe/stackhelp-ext.h>

stackhelp_body* p4_find_stackhelp_body(const p4_char_t* word, p4cell len)

### Description

and find a matching stackhelp entry in the stackhelp-wordlist. We do check for a matching XT to allow for multiple words with the same name. If this find-routine is too specific then try again with a direct search.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_stackhelpcomment 3
p4_stackhelpcomment "|(" ( [string<rp;>] -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCode p4_stackhelpcomment ---

### Description

add a checkstack notation for the LAST word or just try to match the given notation with the stacklayout traced so far - possibly casting a few types as needed.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_stackhelps 3
p4_stackhelps implicit PFE.word.ptr / PFE.word.len args

    #include <pfe/stackhelp-ext.h>

void p4_stackhelps(void)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_stackhelp 3
p4_stackhelp STACKHELP ( [name] -- ) [EXT]

    #include <pfe/stackhelp-ext.h>

FCode p4_stackhelp ---

### Description

show the stackhelp info registered for this name.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_stackhelp_execute_procs 3
p4_stackhelp_execute_procs call it after p4_stackhelp_rewrite : it does consume any

    #include <pfe/stackhelp-ext.h>

int p4_stackhelp_execute_procs(const char* str, const char* end)

### Description

stackhelp infos that ought to be executed to be a check. This applies also to exitpoints! - no argument as it does work on the CHK.line internal buffer

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_search_stackhelp 3
p4_search_stackhelp or fallback to first stackhelp available

    #include <pfe/stackhelp-ext.h>

___ p4char* nfa = p4_search_stackhelp(word, len)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_slash_string 3
p4_slash_string /STRING ( str-ptr str-len n -- str-ptr' str-len' )

    #include <pfe/string-ext.h>

FCode p4_slash_string ---

### Description

shorten the buffer from the beginning by n characters, i.e.

       str-ptr += n ;
       str-len -= n;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_blank 3
p4_blank BLANK ( str-ptr str-len -- )

    #include <pfe/string-ext.h>

FCode p4_blank ---

### Description

`FILL` a given buffer with `BL` blanks

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_cmove 3
p4_cmove CMOVE ( from-ptr to-ptr len# -- )

    #include <pfe/string-ext.h>

FCode p4_cmove ---

### Description

memcpy an area from->to for len bytes, starting at the lower addresses, see `CMOVE>`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_cmove_up 3
p4_cmove_up CMOVE> ( from-ptr to-ptr len# -- )

    #include <pfe/string-ext.h>

FCode p4_cmove_up ---

### Description

memcpy an area from->to for len bytes, starting with the higher addresses, see `CMOVE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_compare 3
p4_compare COMPARE ( str1-ptr str1-len str2-ptr str2-len -- diff# )

    #include <pfe/string-ext.h>

FCode p4_compare ---

### Description

compare both str-buffers, return 0 if they are equal, -1 if lower or shorter, and 1 if greater or longer

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sliteral 3
p4_sliteral SLITERAL ( C: str-ptr str-len -- S: str-ptr str-len )

    #include <pfe/string-ext.h>

FCode p4_sliteral ---

### Description

this word does almost the same as `LITERAL` - it takes an `S"` string as specified in the CS-STACK at compile time and compiles into the current definition where it is returned as if there were a direct string-literal. This can be used to compute a string-literal at compile-time and hardwire it.

      example:
        : ORIGINAL-HOME  [ $HOME COUNT ] SLITERAL ; ( -- str-ptr str-len )

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_field 3
p4_field FIELD ( offset size "name" -- offset+size )

    #include <pfe/pfe-base.h>

FCode p4_field ---

### Description

create a field - the workhorse for both `STRUCT` and `STRUCTURE` implementations. The created fieldname is an `OFFSET:`-word that memorizes the current offset in its PFA and will add that offset on runtime. This forth-word does *not* align.

      : FIELD CREATE
        OVER ,
        +
      DOES&gt;
         @ +
      ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sizeof_XT 3
p4_sizeof_XT SIZEOF ( "name" -- size )

    #include <pfe/pfe-base.h>

FCode_XE p4_sizeof_XT ---

### Description

get the size-value from a previous structure definition

      : SIZEOF   ' &gt;BODY @  STATE @ IF [COMPILE] LITERAL THEN ; IMMEDIATE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_structure_RT 3
p4_structure_RT STRUCTURE ( "name" -- here zero-offset ) exec

    #include <pfe/pfe-base.h>

FCode_RT p4_structure_RT ---

### Description

start a structure definition

      : STRUCTURE: CREATE !CSP
        HERE
        0 DUP ,
      DOES&gt;
        CREATE @ ALLOT
      ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_endstructure 3
p4_endstructure ENDSTRUCTURE ( here some-offset -- )

    #include <pfe/pfe-base.h>

FCode p4_endstructure ---

### Description

finalize a previously started `STRUCTURE` definition

      : ENDSTRUCTURE  SWAP !  ?CSP ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_struct 3
p4_struct STRUCT ( "name" -- here zero-offset )

    #include <pfe/pfe-base.h>

FCode p4_struct ---

### Description

begin definition of a new structure (mpe.000)

      : STRUCT CREATE  !CSP
        HERE
        0 DUP ,
      DOES&gt;
        @
      ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_end_struct 3
p4_end_struct END-STRUCT ( here some-offset -- )

    #include <pfe/pfe-base.h>

FCode p4_end_struct ---

### Description

terminate definition of a new structure (mpe.000)

      : END-STRUCT  SWAP !  ?CSP ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_subrecord 3
p4_subrecord SUBRECORD ( outer-offset "name" -- outer-offset here zero-offset )

    #include <pfe/pfe-base.h>

FCode p4_subrecord ---

### Description

begin definition of a subrecord (mpe.000)

      : STRUCT CREATE
        HERE
        0 DUP ,
      DOES&gt;
        @
      ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_end_subrecord 3
p4_end_subrecord END-SUBRECORD ( outer-offset here some-offset -- outer-offset+some )

    #include <pfe/pfe-base.h>

FCode p4_end_subrecord ---

### Description

end definition of a subrecord (mpe.000)

      : END-SUBRECORD  TUCK SWAP !  + ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_array_of 3
p4_array_of ARRAY-OF ( some-offset n len "name" -- some-offset )

    #include <pfe/pfe-base.h>

FCode p4_array_of ---

### Description

a `FIELD`-array

      : ARRAY-OF * FIELD ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_variant 3
p4_variant VARIANT ( outer-offset "name" -- outer-offset here zero-offset )

    #include <pfe/pfe-base.h>

FCode p4_variant ---

### Description

Variant records describe an alternative view of the current record or subrecord from the start to the current point. The variant need not be of the same length, but the larger is taken

      : VARIANT SUBRECORD ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_end_variant 3
p4_end_variant END-VARIANT ( outer-offset here some-offset -- outer-offset )

    #include <pfe/pfe-base.h>

FCode p4_end_variant ---

### Description

terminate definition of a new variant (mpe.000)

      : END-STRUCT  TUCK SWAP !  2DUP &lt; IF NIP ELSE DROP THEN ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_instance 3
p4_instance INSTANCE ( len "name" -- )

    #include <pfe/pfe-base.h>

FCode p4_instance ---

### Description

Create a named instance of a named structure.

      : INSTANCE  CREATE ALLOT ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_instance_addr 3
p4_instance_addr INSTANCE-ADDR ( len -- addr )

    #include <pfe/pfe-base.h>

FCode p4_instance_addr ---

### Description

Create nameless instance of a structure and return base address.

      : INSTANCE-ADDR  HERE SWAP ALLOT ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_backward_mark 3
p4_backward_mark <MARK ( -- DP-mark ) compile-only

    #include <pfe/system-ext.h>

FCode p4_backward_mark ---

### Description

memorizes the current `DP` on the CS-STACK used for `<RESOLVE` later. Useful for creation of compiling words, eg. `BEGIN` , see `AHEAD`

      simulate:
        : &lt;MARK ?COMP  HERE ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_backward_resolve 3
p4_backward_resolve <RESOLVE ( DP-mark -- ) compile-only

    #include <pfe/system-ext.h>

FCode p4_backward_resolve ---

### Description

resolves a previous `<MARK` , actually pushes the DP-address memorized at <MARK into the dictionary. Mostly used after `BRANCH` or => ?BRANCH in compiling words like `UNTIL`

      simulate:
        : &lt;RESOLVE ?COMP  , ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_forward_mark 3
p4_forward_mark MARK> ( -- DP-mark ) compile-only

    #include <pfe/system-ext.h>

FCode p4_forward_mark ---

### Description

makes room for a pointer in the dictionary to be resolved through `RESOLVE>` and does therefore memorize that cell's address on the CS-STACK Mostly used after `BRANCH` or => ?BRANCH in compiling words like `IF` or `ELSE`

      simulate:
        : MARK&gt; ?COMP  HERE 0 , ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_forward_resolve 3
p4_forward_resolve RESOLVE> ( DP-mark -- ) compile-only

    #include <pfe/system-ext.h>

FCode p4_forward_resolve ---

### Description

resolves a pointer created by `MARK>` Mostly used in compiling words like `THEN`

      simulate:
        : RESOLVE&gt; ?COMP  HERE SWAP ! ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_branch 3
p4_branch BRANCH ( -- )

    #include <pfe/system-ext.h>

FCode p4_branch ---

### Description

compiles a branch-runtime into the dictionary that can be resolved with `MARK&lt;`d or `&lt;RESOLVE`. Usage:

          BRANCH MARK&amp;lt;     or
          BRANCH &amp;gt;RESOLVE  or ...

this is the runtime-portion of `ELSE` - the use of `ELSE` should be preferred. See also => ?BRANCH

      : BRANCH COMPILE (BRANCH) ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_q_branch 3
p4_q_branch ?BRANCH ( -- )

    #include <pfe/system-ext.h>

FCode p4_q_branch ---

### Description

compiles a cond-branch-runtime into the dictionary that can be resolved with `&gt;MARK&`d or `RESOLVE&gt;`. Usage:

          ?BRANCH MARK&amp;lt;     or
          ?BRANCH &amp;gt;RESOLVE  or ...

this is the runtime-portion of `IF` - the use of `IF` should be preferred. See also `BRANCH`

      : ?BRANCH COMPILE (?BRANCH) ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_show_control_strings 3
p4_show_control_strings SHOW-TERM-CONTROLS ( -- ) for debugging

    #include <pfe/term-ext.h>

FCode p4_show_control_strings ---

### Description

show the current mappings for the terminal output may give hints about what is wrong if the output seems to miss some functionality

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc, 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_show_rawkey_strings 3
p4_show_rawkey_strings SHOW-TERM-ESC-KEYS ( -- ) for debugging

    #include <pfe/term-ext.h>

FCode p4_show_rawkey_strings ---

### Description

show the current mappings for the terminal input may give hints about what is wrong if the input seems to miss some functionality

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc, 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_show_termcap 3
p4_show_termcap SHOW-TERMCAP ( -- ) for debugging

    #include <pfe/term-ext.h>

FCode p4_show_termcap ---

### Description

print the termcap strings used for input and output may give hints about what is wrong if the terminal seems to miss some functionality

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc, 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_assume_vt100 3
p4_assume_vt100 ASSUME_VT100 ( -- )

    #include <pfe/term-ext.h>

FCode p4_assume_vt100 ---

### Description

load hardwired VT100-termcap into the terminal-driver

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc, 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_assume_dumbterm 3
p4_assume_dumbterm ASSUME_DUMBTERM ( -- )

    #include <pfe/term-ext.h>

FCode p4_assume_dumbterm ---

### Description

load hardwired DUMBTERM-termcap into the terminal-driver

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc, 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_gotoxy 3
p4_gotoxy GOTOXY ( x y -- )

    #include <pfe/term-ext.h>

FCode p4_gotoxy ---

### Description

move the cursor to the specified position on the screen - this is usually done by sending a corresponding esc-sequence to the terminal.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc, 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_question_xy 3
p4_question_xy ?XY ( -- x y )

    #include <pfe/term-ext.h>

FCode p4_question_xy ---

### Description

returns the cursor position on screen, on a real unix system this includes a special call to the screen driver, in remote systems this can be the expected position as seen on the client side's terminal driver.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc, 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ekey_to_fkey 3
p4_ekey_to_fkey EKEY>FKEY ( key-code# -- key-code# 0 | fkey-code# true! )

    #include <pfe/term-ext.h>

FCodep4_ekey_to_fkey ---

### Description

If the input ekey value was not an extended key then flag is set to FALSE and the value is left unchanged. Compare to EKEY>CHAR for the inverse.

If the input eky was an extended key then the value will be modified such that shifted values are transposed to their base EKEY plus `K-SHIFT-MASK` - therefore the K-SHIFT-MASK is only apropriate for the result fkey-code values of the `p4_ekey_to_fkey` function.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc, 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_termcatch 3
p4_termcatch TERMCATCH ( str-ptr str-len some-xt* -- str-ptr str-len' catch-code# )
FCode p4_termcatch ---

### Description

create a catch-domain around the token to be executed. This works the same as `CATCH`. Additionally all terminal output of that word is being captured to the buffer being provided as an argument. The maximum length input argument is modified flagging the actual length of captured output stream as the output argument. Note that in most cases a `POCKET-PAD` is just not big enough, atleast many error condition notifications tend to be quite lengthy for byte counted forth strings.

      : TERMCATCH TERM-CAPTURE-ON CATCH &gt;R TERM-CAPTURE-OFF R&gt; ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_defined 3
p4_defined [DEFINED] ( "name" -- flag )

    #include <pfe/pfe-base.h>

extern FCodep4_defined ---

### Description

Search the dictionary for _name_. If _name_ is found, return TRUE; otherwise return FALSE. Immediate for use in definitions.

[DEFINED] word ( -- nfa|0 ) immediate does check for the word using find (so it does not throw like `'` ) and puts it on stack. As it is immediate it does work in compile-mode too, so it places its argument in the cs-stack then. This is most useful with a directly following `[IF]` clause, so that sth. like an `[IFDEF] word` can be simulated through `[DEFINED] word [IF]`

      : [DEFINED] BL WORD FIND NIP ; IMMEDIATE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_undefined 3
p4_undefined [UNDEFINED] ( "name" -- flag )

    #include <pfe/pfe-base.h>

extern FCode p4_undefined ---

### Description

Search the dictionary for _name_. If _name_ is found, return FALSE; otherwise return TRUE. Immediate for use in definitions.

see `[DEFINED]`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_empty 3
p4_empty EMPTY ( -- )

    #include <pfe/pfe-base.h>

FCode p4_empty ---

### Description

Reset the dictionary to a predefined golden state, discarding all definitions and releasing all allocated data space beyond that state.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_third 3
p4_third THIRD ( x y z -- x y z x )

    #include <pfe/pfe-base.h>

FCode p4_third ---

### Description

Copy third element on the stack onto top of stack.

      : THIRD   2 PICK ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_fourth 3
p4_fourth FOURTH ( w x y z -- w x y z w )

    #include <pfe/pfe-base.h>

FCode p4_fourth ---

### Description

Copy fourth element on the stack onto top of stack.

      : FOURTH  3 PICK ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_two_nip 3
p4_two_nip 2NIP ( w x y z -- y z )

    #include <pfe/pfe-base.h>

FCode p4_two_nip ---

### Description

Drop the third and fourth elements from the stack.

      : 2NIP   2SWAP 2DROP ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_andif 3
p4_andif ANDIF ( p ... -- flag )

    #include <pfe/pfe-base.h>

FCode p4_andif ---

### Description

Given `p ANDIF q THEN`, _q_ will not be performed if _p_ is false.

      : ANDIF  S" DUP IF DROP " EVALUATE ; IMMEDIATE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_orif 3
p4_orif ORIF ( p ... -- flag )

    #include <pfe/pfe-base.h>

FCode p4_orif ---

### Description

Given `p ORIF q THEN`, _q_ will not be performed if _p_ is true.

      : ORIF   S" DUP 0= IF DROP " EVALUATE ; IMMEDIATE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_scan 3
p4_scan SCAN ( str len char -- str+i len-i )

    #include <pfe/pfe-base.h>

FCode p4_scan ---

### Description

Look for a particular character in the specified string.

      : SCAN
         &gt;R  BEGIN  DUP WHILE  OVER C@ R@ -
             WHILE  1 /STRING  REPEAT THEN
         R&gt; DROP ;

ie. scan for first occurence of c in string

        : SCAN &gt;R BEGIN DUP OVER C@ R@ = 0= OR WHILE
                         1- SWAP 1- SWAP REPEAT R&gt; DROP ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_skip 3
p4_skip SKIP ( str len char -- str+i len-i )

    #include <pfe/pfe-base.h>

FCode p4_skip ---

### Description

Advance past leading characters in the specified string.

      : SKIP
        &gt;R  BEGIN  DUP WHILE  OVER C@ R@ =
             WHILE  1 /STRING  REPEAT THEN
         R&gt; DROP ;

ie. skip leading characters c

        : SKIP  &gt;R BEGIN DUP OVER C@ R@ = OR WHILE
                         1- SWAP 1- SWAP REPEAT R&gt; DROP ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_back 3
p4_back BACK ( str len char -- str len-i )

    #include <pfe/pfe-base.h>

FCode p4_back ---

### Description

Look for a particular character in the string from the back toward the front.

      : BACK
         &gt;R  BEGIN  DUP WHILE
             1-  2DUP + C@  R@ =
         UNTIL 1+ THEN
         R&gt; DROP ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_div_split 3
p4_div_split /SPLIT ( a m a+i m-i -- a+i m-i a i )

    #include <pfe/pfe-base.h>

FCode p4_div_split ---

### Description

Split a character string _a m_ at place given by _a+i m-i_. Called "cut-split" because "slash-split" is a tongue twister.

      : /SPLIT  DUP &gt;R  2SWAP  R&gt; - ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_is_white 3
p4_is_white IS-WHITE ( char -- flag )

    #include <pfe/pfe-base.h>

FCode p4_is_white ---

### Description

Test char for white space.

      : IS-WHITE   33 - 0&lt; ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_trim 3
p4_trim TRIM ( str len -- str len-i )

    #include <pfe/pfe-base.h>

FCode p4_trim ---

### Description

Trim white space from end of string.

      : TRIM
         BEGIN  DUP WHILE
             1-  2DUP + C@ IS-WHITE NOT
         UNTIL 1+ THEN ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bl_scan 3
p4_bl_scan BL-SCAN ( str len -- str+i len-i )

    #include <pfe/pfe-base.h>

FCodep4_bl_scan ---

### Description

Look for white space from start of string

      : BL-SCAN
         BEGIN  DUP WHILE  OVER C@ IS-WHITE NOT
         WHILE  1 /STRING  REPEAT THEN ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bl_skip 3
p4_bl_skip BL-SKIP ( str len -- str+i len-i )

    #include <pfe/pfe-base.h>

FCodep4_bl_skip ---

### Description

Skip over white space at start of string.

      : BL-SKIP
         BEGIN  DUP WHILE  OVER C@ IS-WHITE
         WHILE  1 /STRING  REPEAT THEN ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_starts_Q 3
p4_starts_Q STARTS? ( str len pattern len2 -- str len flag )

    #include <pfe/pfe-base.h>

FCode p4_starts_Q ---

### Description

Check start of string.

      : STARTS?   DUP &gt;R  2OVER  R&gt; MIN  COMPARE 0= ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_ends_Q 3
p4_ends_Q ENDS? ( str len pattern len2 -- str len flag )

    #include <pfe/pfe-base.h>

FCode p4_ends_Q ---

### Description

Check end of string.

      : ENDS?   DUP &gt;R  2OVER  DUP R&gt; - /STRING  COMPARE 0= ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_is_digit 3
p4_is_digit IS-DIGIT ( char -- flag )

    #include <pfe/pfe-base.h>

FCodep4_is_digit ---

### Description

Test _char_ for digit [0-9].

      : IS-DIGIT   [CHAR] 0 -  10 U&lt; ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_is_alpha 3
p4_is_alpha IS-ALPHA ( char -- flag )

    #include <pfe/pfe-base.h>

FCodep4_is_alpha ---

### Description

Test _char_ for alphabetic [A-Za-z].

      : IS-ALPHA  32 OR  [CHAR] a -  26 U&lt; ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_is_alnum 3
p4_is_alnum IS-ALNUM ( char -- flag )

    #include <pfe/pfe-base.h>

FCode p4_is_alnum ---

### Description

Test _char_ for alphanumeric [A-Za-z0-9].

      : IS-ALNUM
         DUP IS-ALPHA  ORIF  DUP IS-DIGIT  THEN  NIP ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_split_next_line 3
p4_split_next_line SPLIT-NEXT-LINE ( src . -- src' . str len )

    #include <pfe/pfe-base.h>

FCode p4_split_next_line ---

### Description

Split the next line from the string.

      : SPLIT-NEXT-LINE
         2DUP #EOL-CHAR SCAN
         DUP &gt;R  1 /STRING  2SWAP R&gt; - ;

FIXME: inform Neil Bawd that this is probably not what he wanted. replace /STRING with /SPLIT here.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_view_next_line 3
p4_view_next_line VIEW-NEXT-LINE ( src . str len -- src . str len str2 len2 )

    #include <pfe/pfe-base.h>

FCode p4_view_next_line ---

### Description

Copy next line above current line.

      : VIEW-NEXT-LINE
         2OVER 2DUP #EOL-CHAR SCAN NIP - ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_next_word 3
p4_next_word NEXT-WORD ( -- str len )

    #include <pfe/pfe-base.h>

FCode p4_next_word ---

### Description

Get the next word across line breaks as a character string. _len_ will be 0 at end of file.

      : NEXT-WORD
         BEGIN   BL WORD COUNT      ( str len )
             DUP IF EXIT THEN
             REFILL
         WHILE  2DROP ( ) REPEAT ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_lexeme 3
p4_lexeme LEXEME ( "name" -- str len )

    #include <pfe/pfe-base.h>

FCode p4_lexeme ---

### Description

Get the next word on the line as a character string. If it's a single character, use it as the delimiter to get a phrase.

      : LEXEME
         BL WORD ( addr) DUP C@ 1 =
             IF  CHAR+ C@ WORD  THEN
         COUNT ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_h_sh 3
p4_h_sh H# ( "hexnumber" -- n )

    #include <pfe/pfe-base.h>

FCode p4_h_sh ---

### Description

Get the next word in the input stream as a hex single-number literal. (Adopted from Open Firmware.)

      : H#  ( "hexnumber" -- n )  \  Simplified for easy porting.
         0 0 BL WORD COUNT
         BASE @ &gt;R  HEX  &gt;NUMBER  R&gt; BASE !
             ABORT" Not Hex " 2DROP          ( n)
         STATE @ IF  POSTPONE LITERAL  THEN
         ; IMMEDIATE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_backslash_backslash 3
p4_backslash_backslash \\ ( "...<eof;>" -- )

    #include <pfe/pfe-base.h>

FCode p4_backslash_backslash ---

### Description

Ignore the rest of the input stream.

      : \\   BEGIN  -1 PARSE  2DROP  REFILL 0= UNTIL ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_tick_th 3
p4_tick_th 'th ( n "addr" -- &addr[n] )

    #include <pfe/pfe-base.h>

FCode p4_tick_th ---

### Description

Address `n CELLS addr +`.

      : 'th     ( n "addr" -- &amp;addr[n] )
         S" 2 LSHIFT " EVALUATE
         BL WORD COUNT EVALUATE
         S" + " EVALUATE
         ; IMMEDIATE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren_dot 3
p4_paren_dot (.) ( n -- addr u )

    #include <pfe/pfe-base.h>

FCodep4_paren_dot ---

### Description

Convert _n_ to characters, without punctuation, as for `.` (dot), returning the address and length of the resulting string.

      : (.)  ( n -- addr u )  DUP ABS 0 &lt;# #S ROT SIGN #&gt; ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_cell_minus 3
p4_cell_minus CELL- ( addr -- addr' )

    #include <pfe/pfe-base.h>

FCodep4_cell_minus ---

### Description

Decrement address by one cell

      : CELL-  ( addr -- addr' )  CELL - ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_hiword 3
p4_hiword HIWORD ( xxyy -- xx )

    #include <pfe/pfe-base.h>

FCode p4_hiword ---

### Description

The high half of the value.

      : HIWORD  ( xxyy -- xx )  16 RSHIFT ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_loword 3
p4_loword LOWORD ( xxyy -- yy )

    #include <pfe/pfe-base.h>

FCode p4_loword ---

### Description

The low half of the value.

      : LOWORD  ( xxyy -- yy )  65535 AND ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_rewind_file 3
p4_rewind_file REWIND-FILE ( file-id -- ior )

    #include <pfe/pfe-base.h>

FCode p4_rewind_file ---

### Description

Rewind the file.

      : REWIND-FILE       ( file-id -- ior )
         0 0 ROT REPOSITION-FILE ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2001 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dot_s 3
p4_dot_s .S ( -- )

    #include <pfe/tools-ext.h>

FCode p4_dot_s ---

### Description

print the stack content in vertical nice format. tries to show cell-stack and float-stack side-by-side,

Depending on configuration, there are two parameter stacks: for integers and for floating point operations. If both stacks are empty, `.S` will display the message `&lt;stacks empty&gt;`.

If only the floating point stack is empty, `.S` displays the integer stack items in one column, one item per line, both in hex and in decimal like this (the first item is topmost):

      12345 HEX 67890 .S
         	424080 [00067890]
              12345 [00003039] ok

If both stacks ar not empty, => .S displays both stacks, in two columns, one item per line

      HEX 123456.78E90 ok
      DECIMAL 123456.78E90 .S
         	   291 [00000123]          1.234568E+95
         1164414608 [45678E90] ok

Confusing example? Remember that floating point input only works when the `BASE` number is `DECIMAL`. The first number looks like a floating point but it is a goodhex double integer too - the number base is `HEX`. Thus it is accepted as a hex number. Second try with a decimal base will input the floating point number.

If only the integer stack is empty, => .S shows two columns, but he first columns is called `&lt;stack empty&gt;`, and the second column is the floating point stack, topmost item first.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_question 3
p4_question ? ( addr -- )

    #include <pfe/tools-ext.h>

FCode p4_question ---

### Description

Display the (integer) content of at address `addr`. This word is sensitive to `BASE`

      simulate:
        : ?  @ . ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_dump 3
p4_dump DUMP ( addr len -- )

    #include <pfe/tools-ext.h>

FCode p4_dump ---

### Description

show a hex-dump of the given area, if it's more than a screenful it will ask using => ?CR

You can easily cause a segmentation fault of something like that by accessing memory that does not belong to the pfe-process.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_see 3
p4_see SEE ( "word" -- )

    #include <pfe/tools-ext.h>

FCode p4_see ---

### Description

decompile word - tries to show it in re-compilable form.

`(SEE)` tries to display the word as a reasonable indented source text. If you defined your own control structures or use extended control-flow patterns, the indentation may be suboptimal.

      simulate:
        : SEE  [COMPILE] ' (SEE) ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_words 3
p4_words WORDS ( -- )

    #include <pfe/tools-ext.h>

FCode p4_words ---

### Description

uses CONTEXT and lists the words defined in that vocabulary. usually the vocabulary to list is named directly in before.

      example:
         FORTH WORDS  or  LOADED WORDS

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_new_ahead 3
p4_new_ahead AHEAD ( -- DP-mark ORIG-magic ) compile-only

    #include <pfe/tools-ext.h>

FCode p4_new_ahead ---

### Description

      simulate:
        : AHEAD  BRANCH MARK&gt; (ORIG#) ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bye 3
p4_bye BYE ( -- ) no-return

    #include <pfe/tools-ext.h>

FCode p4_bye ---

### Description

should quit the forth environment completly

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_cs_pick 3
p4_cs_pick CS-PICK ( 2a 2b 2c ... n -- 2a 2b 2c ... 2a )

    #include <pfe/tools-ext.h>

FCode p4_cs_pick ---

### Description

pick a value in the compilation-stack - note that the compilation stack _can_ be seperate in some forth-implemenations. In PFE the parameter-stack is used in a double-cell fashion, so CS-PICK would 2PICK a DP-mark and a COMP-magic, see `PICK`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_cs_roll 3
p4_cs_roll CS-ROLL ( 2a 2b 2c ... n -- 2b 2c ... 2a )

    #include <pfe/tools-ext.h>

FCode p4_cs_roll ---

### Description

roll a value in the compilation-stack - note that the compilation stack _can_ be seperate in some forth-implemenations. In PFE the parameter-stack is used in a double-cell fashion, so CS-ROLL would 2ROLL a DP-mark and a COMP-magic, see `ROLL`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bracket_else 3
p4_bracket_else [ELSE] ( -- )

    #include <pfe/tools-ext.h>

FCode p4_bracket_else ---

### Description

eat up everything upto and including the next [THEN]. count nested [IF] ... [THEN] constructs. see `[IF]`

      this word provides a simple pre-compiler mechanism

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bracket_if 3
p4_bracket_if [IF] ( flag -- )

    #include <pfe/tools-ext.h>

FCode p4_bracket_if ---

### Description

check the condition in the CS-STACK. If true let the following text flow into `INTERPRET` , otherwise eat up everything upto and including the next `[ELSE]` or `[THEN]` . In case of skipping, count nested [IF] ... [THEN] constructs.

      this word provides a simple pre-compiler mechanism

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_assembler 3
p4_assembler ASSEMBLER ( -- )

    #include <pfe/tools-ext.h>

FCode p4_assembler ---

### Description

set the `ASSEMBLER-WORDLIST` as current `CONTEXT`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_create_code 3
p4_create_code CODE ( "name" -- )

    #include <pfe/tools-ext.h>

FCode p4_create_code ---

### Description

`CREATE` a new name and put PFA adress into the CFA place.

NOTE: this description (PFA into CFA) is only correct for traditional indirect threaded code (ITC). The other variants use a block info in the CFA - there we will start a normal colon word which is cut off immediately by a `;CODE` directive to enter the machine-level.

BE AWARE: The TOOLS-EXT will not provide an `END-CODE` or any other word in the `ASSEMBLER` wordlist which is required to start any useful assembler programming. After requiring ASSEMBLER-EXT you will see a second "CODE" in the `EXTENSIONS` wordlist that will also provide an optimized execution than the result of this standard-forth implemenation.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_semicolon_code_execution 3
p4_semicolon_code_execution ;CODE ( -- )

    #include <pfe/tools-ext.h>

FCode_XE p4_semicolon_code_execution ---

### Description

Does end the latest word (being usually some DOES> part) and enters machine-level (in EXEC-mode).

BE AWARE: The TOOLS-EXT will not provide an `END-CODE` or any other word in the `ASSEMBLER` wordlist which is required to start any useful assembler programming. After requiring ASSEMBLER-EXT you will see a second ";CODE" in the `EXTENSIONS` wordlist that will also provide an optimized execution than the result of this standard-forth implemenation.

The Standard-Forth implementation will actually compile a derivate of `BRANCH` into the dictionary followed by `;`. The compiled word will not jump to the target adress (following the execution token) but it will call the target adress via the host C stack. The target machine level word (C domain) will just return here for being returned (Forth domain). Hence `END-CODE` may be a simple RET, comma!

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_end_code 3
p4_end_code END-CODE ( "name" -- )

    #include <pfe/tools-ext.h>

FCode p4_end_code ---

### Description

call `PREVIOUS` and add PROC LEAVE assembler snippet as needed for the architecture - usually includes bits to "return from subroutine". Remember that not all architectures are support and PFE usually does only do variants of call-threading with a separate loop for the inner interpreter that does "call into subroutine".

Some forth implementations do "jump into routine" and the PROC LEAVE part would do "jump to next routine" also known as next-threading. The sbr-call-threading is usually similar to the native subroutine-coding of the host operating system. See `CODE`

On some machine types, this word is NOT DEFINED!

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_vlist 3
p4_vlist VLIST ( -- )

    #include <pfe/tools-mix.h>

FCode p4_vlist ---

### Description

The VLIST command had been present in FIG and other forth implementations. It has to list all accessible words. In PFE it list all words in the search order. Well, the point is, that we do really just look into the search order and are then calling `WORDS` on that Wordl. That way you can see all accessible words in the order they might be found. Uses => ?CR

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_store_csp 3
p4_store_csp !CSP ( -- )

    #include <pfe/tools-mix.h>

FCode p4_store_csp ---

### Description

put `SP` into `CSP` used in control-words

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Q_csp 3
p4_Q_csp ?CSP ( -- )

    #include <pfe/tools-mix.h>

FCode p4_Q_csp ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Q_comp 3
p4_Q_comp ?COMP ( -- )

    #include <pfe/tools-mix.h>

FCode p4_Q_comp ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Q_exec 3
p4_Q_exec ?EXEC ( -- )

    #include <pfe/tools-mix.h>

FCode p4_Q_exec ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Q_file 3
p4_Q_file ?FILE ( file-id -- )

    #include <pfe/tools-mix.h>

FCode p4_Q_file ---

### Description

check the file-id otherwise (fixme)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Q_loading 3
p4_Q_loading ?LOADING ( -- )

    #include <pfe/tools-mix.h>

FCode p4_Q_loading ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Q_pairs 3
p4_Q_pairs ?PAIRS ( a b -- )

    #include <pfe/tools-mix.h>

FCode p4_Q_pairs ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Q_stack 3
p4_Q_stack ?STACK ( -- )

    #include <pfe/tools-mix.h>

FCode p4_Q_stack ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren_forget 3
p4_paren_forget (FORGET) ( addr -- )

    #include <pfe/tools-mix.h>

FCode p4_paren_forget ---

### Description

forget everything above addr - used by `FORGET`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren_dictlimit 3
p4_paren_dictlimit (DICTLIMIT) ( -- constvalue )

    #include <pfe/tools-mix.h>

FCodep4_paren_dictlimit ---

### Description

the upper limit of the forth writeable memory space, the variable `DICTLIMIT` must be below this line. stack-space and other space-areas are often allocated above `DICTLIMIT` upto this constant.

`DICTFENCE` is the lower end of the writeable dictionary

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren_dictfence 3
p4_paren_dictfence (DICTFENCE) ( -- constvalue )

    #include <pfe/tools-mix.h>

FCodep4_paren_dictfence ---

### Description

the lower limit of the forth writeable memory space, the variable `DICTFENCE` must be above this line. Some code-areas are often moved in between `DICTFENCE` and this constant. To guard normal Forth code from deletion the usual practice goes with the `FENCE` variable

`DICTLIMIT` is the upper end of the writeable dictionary

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_Q_file_open 3
p4_Q_file_open ...

    #include <pfe/tools-sub.h>

_export void p4_Q_file_open(p4_File *fid)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_abortq 3
p4_abortq ...

    #include <pfe/tools-sub.h>

_export void p4_abortq(const char *fmt,...)

### Description

(missing description)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_to_compile 3
p4_to_compile

    #include <pfe/useful-ext.h>

void p4_to_compile(p4xt xt)

### Description

see `>COMPILE` and `POSTPONE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_prefix_begin 3
p4_prefix_begin "($" ( [word] -- cs-token ) compile-only

    #include <pfe/useful-ext.h>

FCode p4_prefix_begin ---

### Description

takes the execution token of the following word and saves it on the compile-stack. The correspondig closing `)` will then feed it into `>COMPILE` - so this pair of word provides you with a prefix-operation syntax that you may have been seen in lisp-like languages.

        ($ IF ($ 0= A1 @ )) ($ THEN ." hello " )

Note that an opening simple `(` paren is a comment.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_prefix_end 3
p4_prefix_end ")" ( cs-token -- )

    #include <pfe/useful-ext.h>

FCode p4_prefix_end ---

### Description

takes the execution-token from `(\$` and compiles it using `>COMPILE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_prefix_end_doubled 3
p4_prefix_end_doubled "))" ( cs-token cs-token -- )

    #include <pfe/useful-ext.h>

FCode p4_prefix_end_doubled ---

### Description

takes two execution-tokens from two of `(\$` and compiles them on after another using `>COMPILE`

      simulate:
         : )) [COMPILE] ) [COMPILE] ) ; IMMEDIATE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_sprintf 3
p4_sprintf PFE-SPRINTF ( args ... format$ dest$ -- len-dest )

    #include <pfe/useful-ext.h>

FCode p4_sprintf ---

### Description

just like the standard sprintf() function in C, but the format is a counted string and accepts %#s to be the format-symbol for a forth-counted string. The result is a zeroterminated string at dest$ having a length being returned. To create a forth-counted string, you could use:

        variable A 256 ALLOT
        15 " example" " the %#s value is %i" A 1+ SPRINTF A C!
        A COUNT TYPE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_printf 3
p4_printf PFE-PRINTF ( args ... format$ -- )

    #include <pfe/useful-ext.h>

FCode p4_printf ---

### Description

uses `SPRINTF` to print to a temporary 256-char buffer and prints it to stdout afterwards. See the example at `SPRINTF` of what it does internally.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_loadf 3
p4_loadf LOADF ( "filename" -- )

    #include <pfe/useful-ext.h>

FCode p4_loadf ---

### Description

loads a file just like `INCLUDE` but does also put a `MARKER` in the `LOADED` dictionary that you can do a `FORGET` on to kill everything being loaded from that file.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_paren_loadf_locate 3
p4_paren_loadf_locate "(LOADF-LOCATE)" ( xt -- nfa )

    #include <pfe/useful-ext.h>

FCodep4_paren_loadf_locate ---

### Description

the implementation of `LOADF-LOCATE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_loadf_locate 3
p4_loadf_locate LOADF-LOCATE ( "name" -- )

    #include <pfe/useful-ext.h>

FCodep4_loadf_locate ---

### Description

look for the filename created by `LOADF` that had been defining the given name. `LOADF` has created a marker that is above the `INCLUDED` file and that marker has a body-value just below the `INCLUDED` file. Hence the symbol was defined during `LOADF` execution of that file.

      : LOADF-LOCATE ?EXEC POSTPONE ' (LOADF-LOCATE) .NAME ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_semicolon_and_execution 3
p4_semicolon_and_execution "(;AND)" ( -- )

    #include <pfe/useful-ext.h>

FCode_XE p4_semicolon_and_execution ---

### Description

compiled by `;AND`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_semicolon_and 3
p4_semicolon_and ";AND" ( -- )

    #include <pfe/useful-ext.h>

FCode p4_semicolon_and ---

### Description

For the code piece between `MAKE` and `;AND` , this word will do just an `EXIT` . For the code outside of the `MAKE` construct a branch-around must be resolved then.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_make_to_local_execution 3
p4_make_to_local_execution "((MAKE-))" ( -- )

    #include <pfe/useful-ext.h>

FCode_XE p4_make_to_local_execution ---

### Description

compiled by `MAKE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_make_to_execution 3
p4_make_to_execution "((MAKE))" ( -- )

    #include <pfe/useful-ext.h>

FCode_XE p4_make_to_execution ---

### Description

compiled by `MAKE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_make 3
p4_make MAKE ( [word] -- ) ... ;AND

    #include <pfe/useful-ext.h>

FCode p4_make ---

### Description

make a seperated piece of code between `MAKE` and `;AND` and on execution of the `MAKE` the named word is twisted to point to this piece of code. The word is usually a `DOER` but the current implementation works on `DEFER` just as well, just as it does on other words who expect to find an execution-token in its PFA. You could even create a colon-word that starts with `NOOP` and can then make that colon-word be prefixed with the execution of the code piece. This `MAKE` does even work on `LOCALS|` and `VAR` but it is uncertain what that is good for.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_offset_RT 3
p4_offset_RT OFFSET-RT ( value -- value+offset )

    #include <pfe/useful-ext.h>

FCode_RT p4_offset_RT ---

### Description

this runtime will add the body-value to the value at top-of-stack. used heavily in structure access words, compiled by `/FIELD`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_offset_constant 3
p4_offset_constant +CONSTANT ( offset "name" -- )

    #include <pfe/useful-ext.h>

FCode p4_offset_constant ---

### Description

create a new offsetword. The word is created and upon execution it adds the offset, ie. compiling the `OFFSET-RT` runtime:

            ( address -- address+offset )

This word is just a convenience word, just use the word `+FIELD` directly and choose a `DROP` to flag the end of a current offset-field declaration series. See also `/FIELD` series to declare simple structures which end with a final `CONSTANT` to memorize the complete size. The `/FIELD` style is more traditional.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_plus_field 3
p4_plus_field +FIELD: ( offset "name" -- offset )

    #include <pfe/useful-ext.h>

FCode p4_plus_field ---

### Description

created a new name with an `OFFSET-RT` runtime using the given offset. Leave the offset-value untouched, so it can be modified with words like `CHAR+` and `CELL+` and `SFLOAT+` ; This word is the simplest way to declared structure access words in forth - the two `STRUCT` modules contain a more elaborate series of words. Use this one like:

      0                        ( a fresh definition is started )
      +FIELD: zapp.a+ CHAR+     ( zero offset from the base of the struct )
      +FIELD: zapp.b+ CELL+     ( no alignment, starts off at 1 from base )
      +FIELD: zapp+   DROP      ( store size of complete zap structure )

      0 zapp+                  ( extend the zap structure )
      +FIELD: zappx.c+ CELL+    ( a new field )
      +FIELD: zappx+   DROP     ( and save it again )

      CREATE zapp1  0 zapp+ ALLOT ( a way to allocate a strucutre )

      zapp2 zapp.b+ @         ( read a value from the field )
      16 zapp2 zapp.b+ !      ( store a value in there )

this form is not the traditional form used in forth, it is however quite simple. Use the simplefield declaration with `/FIELD` to be compatible with traditional styles that build on top of sizeof constants in forth (which are not part of the ANS Forth standard).

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_slash_field 3
p4_slash_field /FIELD ( offset size "name" -- offset+size )

    #include <pfe/useful-ext.h>

FCode p4_slash_field ---

### Description

created a new `+FIELD` name with an `OFFSET-RT` of offset. Then add the size value to the offset so that the next `/FIELD` declaration will start at the end of the field currently declared. This word is the simplest way to declared structure access words in forth - the two `STRUCT` modules contain a more elaborate series of words. This one is used like:

      0                        ( a fresh definition is started )
      /CHAR /FIELD -&gt;zapp.a    ( zero offset from the base of the struct )
      /CELL /FIELD -&gt;zapp.b    ( no alignment, starts off at 1 from base )
      CONSTANT /zapp           ( store size of complete zap structure )

      /zapp                    ( extend the zap structure )
      /CELL /FIELD -&gt;zappx.c   ( a new field )
      CONSTANT /zappx          ( and save it again )

      CREATE zapp1 /zapp ALLOT ( a way to allocate a strucutre )
      /zapp BUFFER: zapp2      ( another way to do it, semi-standard )

      zapp2 -&gt;zapp.b @         ( read a value from the field )
      16 zapp2 -&gt;zapp.b !      ( store a value in there )

compare also with `/CHAR` `/WCHAR` `/CELL` `/DCELL` and use `+FIELD` as the lowlevel word, can simulate as

      : /FIELD SWAP +FIELD + ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bracket_not 3
p4_bracket_not [NOT] ( a -- a' )

    #include <pfe/useful-ext.h>

FCode p4_bracket_not ---

### Description

executes `0=` but this word is immediate so that it does affect the cs-stack while compiling rather than compiling anything. This is useful just before words like `[IF]` to provide semantics of an `[IFNOT]`. It is most useful in conjunction with "=> [DEFINED] word" as it the sequence "`[DEFINED] word [NOT] [IF]`" can simulate "`[IFNOTDEF] word`"

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_replace_in 3
p4_replace_in REPLACE-IN ( to-xt from-xt n "name" -- )

    #include <pfe/useful-ext.h>

FCodep4_replace_in ---

### Description

will handle the body of the named word as a sequence of cells (or tokens) and replaces the n'th occurences of from-xt into to-xt. A negative value will change all occurences. A zero value will not change any.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_x_quote 3
p4_x_quote 'X"' ( "hex-q" -- bstring )

    #include <pfe/useful-ext.h>

FCode p4_x_quote ---

### Description

places a counted string on stack containing bytes specified by hex-string - the hex string may contain spaces which will delimit the bytes

      example:
         X" 41 42 4344" COUNT TYPE ( shows ABCD )

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_evaluate_with 3
p4_evaluate_with EVALUATE-WITH ( i*x addr len xt[i*x--j*x] -- j*x )

    #include <pfe/useful-ext.h>

FCodep4_evaluate_with ---

### Description

added to be visible on the forth command line on request by MLG, he has explained the usage before a lot, you can get an idea from:

         : EVALUATE ['] INTERPRET EVALUATE-WITH ;

The word is used internally in PFE for the loadlist evaluation of the binary modules: where previously each loadercode had its own CREATE-execution we do now call the original forthish CREATE-word like, so bootstrapping a `VARIABLE` will now call VARIABLE itself and of course we need to set up the TIB-area to point to the name of the variable that shall be created in the forth dictionary:

      : LOAD-WORD ( arg-value str-ptr str-len loader-code -- )
           CASE
             #LOAD-VARIABLE OF ['] VARIABLE EVALUATE-WITH ENDOF
             ....
           ENDCASE
           CLEARSTACK
      ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bracket_vocabulary 3
p4_bracket_vocabulary [VOCABULARY] ( "name" -- )

    #include <pfe/useful-ext.h>

FCode p4_bracket_vocabulary ---

### Description

create an immediate vocabulary. Provides for basic modularization.

      : [VOCABULARY] VOCABULARY IMMEDIATE ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bracket_possibly 3
p4_bracket_possibly [POSSIBLY] ( [name] -- ?? )

    #include <pfe/useful-ext.h>

FCode p4_bracket_possibly ---

### Description

check if the name exists, and execute it immediatly if found. Derived from POSSIBLY as seen in other forth systems.

      : [POSSIBLY] (') ?DUP IF EXECUTE THEN ; IMMEDIATE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bracket_def 3
p4_bracket_def [DEF] ( -- )

    #include <pfe/useful-ext.h>

FCode p4_bracket_def ---

### Description

immediatly set topmost `CONTEXT` voc to `CURRENT` compilation voc.

      : DEF' CURRENT @ CONTEXT ! ; IMMEDIATE

note that in PFE most basic vocabularies are immediate, so that you can use a sequence of

      FORTH ALSO  DEFINITIONS
      [DEF] : GET-FIND-3  [ANS] ['] FIND  [FIG] ['] FIND  [DEF] ['] FIND ;

where the first wordlist to be searched via the search order are [ANS] and [FIG] and FORTH (in this order) and which may or may not yield different flavours of the FIND routine (i.e. different XTs)

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_context_Q 3
p4_context_Q CONTEXT? ( -- number )

    #include <pfe/useful-ext.h>

FCode p4_context_Q ---

### Description

GET-CONTEXT and count how many times it is in the order but the CONTEXT variable itself. The returned number is therefore minus one the occurences in the complete search-order. usage:

        ALSO EXTENSIONS CONTEXT? [IF] PREVIOUS [THEN]
        ALSO DEF' DEFAULT-ORDER
      : CONTEXT?
        0 LVALUE _count
        GET-ORDER 1- SWAP  LVALUE _context
        0 ?DO _context = IF 1 +TO _count THEN LOOP
        _count
      ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_defs_are_case_sensitive 3
p4_defs_are_case_sensitive DEFS-ARE-CASE-SENSITIVE ( -- )

    #include <pfe/useful-ext.h>

FCode p4_defs_are_case_sensitive ---

### Description

accesses `CURRENT` which is generally the last wordlist that the `DEFINITIONS` shall go in. sets there a flag in the vocabulary-definition so that words are matched case-sensitive.

      example:
         VOCABULARY MY-VOC  MY-VOC DEFINITIONS DEFS-ARE-CASE-SENSITIVE

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_case_sensitive_voc 3
p4_case_sensitive_voc CASE-SENSITIVE-VOC ( -- )

    #include <pfe/useful-ext.h>

FCode p4_case_sensitive_voc ---

### Description

accesses `CONTEXT` which is generally the last named `VOCABULARY` . sets a flag in the vocabulary-definition so that words are matched case-sensitive.

      example:
         VOCABULARY MY-VOC  MY-VOC CASE-SENSITIVE-VOC

OBSOLETE! use `DEFS-ARE-CASE-SENSITIVE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_defs_are_searched_also 3
p4_defs_are_searched_also DEFS-ARE-SEARCHED-ALSO ( -- )

    #include <pfe/useful-ext.h>

FCode p4_defs_are_searched_also ---

### Description

binds `CONTEXT` with `CURRENT`. If the `CURRENT` `VOCABULARY` is in the search-order (later), then the `CONTEXT` vocabulary will be searched also. If the result of this word could lead into a recursive lookup with `FIND` it will throw `CURRENT_DELETED` and leave the `CURRENT` `VOCABULARY` unaltered.

      example:

MY-VOC DEFINITIONS MY-VOC-PRIVATE DEFS-ARE-SEARCHED-ALSO

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_bracket_execute 3
p4_bracket_execute [EXECUTE] ( [word] -- )

    #include <pfe/useful-ext.h>

FCode p4_bracket_execute ---

### Description

ticks the following word, and executes it - even in compiling mode.

      : [EXECUTE] ' EXECUTE ;

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 1998 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_spy_on 3
p4_spy_on SPY_ON ( -- )
FCode p4_spy_on ---

### Description

change the runtime-code of `(NEST)` to call a special word that prints info to the screen whenever a colon word is entered. It will print the name and the current stack, and results in a kind of execution trace over `SPY' :`-colon nested words.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 2000 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_spy_off 3
p4_spy_off SPY_OFF ( -- )
FCode p4_spy_off ---

### Description

disable `SPY_ON` nest-trace.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 2000 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_spy_colon_RT 3
p4_spy_colon_RT "SPY' (NEST)" ( -- )
FCode_RT p4_spy_colon_RT ---

### Description

compiled by `:`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 2000 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_spy_colon 3
p4_spy_colon "SPY:" ( name -- )
FCode p4_spy_colon ---

### Description

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` this is the spy-version `SPY_ON`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 2000 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_spy_semicolon 3
p4_spy_semicolon ";SPY" ( -- )
FCode p4_spy_semicolon ---

### Description

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

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 2000 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_spy_exit 3
p4_spy_exit "SPY-EXIT" ( -- )
FCode p4_spy_exit ---

### Description

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 `;`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) Tektronix, Inc. 2000 - 2001. Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_tick_from 3
p4_tick_from "'>" ( [name] -- xt )

    #include <pfe/pfe-base.h>

FCode p4_tick_from ---

### Description

get the execution-token, ie the CFA, of the word following. This word is fully state-smart while the ANSI standard words namely `'` and `[']` are not.

0.33.71
0.33.71 pfe
p4_fetch_from 3
p4_fetch_from @> ( [name] -- value )

    #include <pfe/pfe-base.h>

FCode p4_fetch_from ---

### Description

does fetch the value from the PFA of the named item, which may be about everything, including a `VARIABLE` , `VALUE` `LVALUE` , `LOCALS|` , `VAR` , `DEFER` , `DOER` , `DOES>` and more.

0.33.71
0.33.71 pfe
p4_into_execution 3
p4_into_execution ((INTO))

    #include <pfe/pfe-base.h>

FCode_XE p4_into_execution ---

### Description

execution compiled by `INTO`

0.33.71
0.33.71 pfe
p4_into_local_execution 3
p4_into_local_execution ((INTO-)) ( -- value )

    #include <pfe/pfe-base.h>

FCode_XE p4_into_local_execution ---

### Description

execution compiled by `INTO`

0.33.71
0.33.71 pfe
p4_into 3
p4_into INTO ( [name] -- pfa )

    #include <pfe/pfe-base.h>

FCode p4_into ---

### Description

will return the parameter-field address of the following word. Unlike others, this word will also return the address of `LOCALS|` and local `LVALUE` - so in fact a `TO A` and `INTO A !` are the same. This word is most useful when calling C-exported function with a temporary local-VAR as a return-place argument - so the address of a local has to be given as an arg. Beware that you should not try to save the address anywhere else, since a local's address does always depend of the RP-depth - EXIT from a colon-word and the value may soon get overwritten. (see also `TO` )

0.33.71
0.33.71 pfe
p4_dot_h2 3
p4_dot_h2 .H2 ( value -- )

    #include <pfe/pfe-base.h>

FCode p4_dot_h2 ---

### Description

print hexadecimal, but with per-byte 0-padding

        0x0     -&gt; 00
        0xf     -&gt; 0f
        0x12    -&gt; 12
        0x123   -&gt; 0123
        0x1234  -&gt; 1234
        0x12345 -&gt; 012345

0.33.71
0.33.71 pfe
p4_here_word 3
p4_here_word HERE-WORD ( char "name<char;>" -- )

    #include <pfe/pfe-base.h>

FCode p4_here_word ---

### Description

a FIG-compatible WORD. Where ANSI says "skip leading delimiters" this one acts as "skip leading whitespace". And it will not return anything and have the string parsed to `HERE`

0.33.71
0.33.71 pfe
p4_z_quote 3
p4_z_quote 'Z"' ( [chars<">] -- z* )

    #include <pfe/pfe-base.h>

FCodep4_z_quote ---

### Description

scan the input to the next doublequote and create a buffer that holds the chars - return the address of that zero-terminated string-buffer, either `POCKET-PAD` or `ALLOT`ed into the dictionary.

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2004 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_zcount 3
p4_zcount ZCOUNT ( z* -- z* len )

    #include <pfe/pfe-base.h>

FCode p4_zcount ---

### Description

push length of z-string, additionally to the string addr itself.

      : ZSTRLEN ZCOUNT NIP ;

(see libc strlen(3)) / compare with `COUNT` / `ZSTRLEN`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2004 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_zstrlen 3
p4_zstrlen ZSTRLEN ( z* -- len )

    #include <pfe/pfe-base.h>

FCode p4_zstrlen ---

### Description

push length of z-string.

      : ZSTRLEN ZCOUNT NIP ;

(see libc strlen(3)) / compare with `ZMOVE` / `CMOVE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2004 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_zmove 3
p4_zmove ZMOVE ( zsrc* zdest* -- )

    #include <pfe/pfe-base.h>

FCode p4_zmove ---

### Description

copy a zero terminated string (see libc strcpy(3)) / compare with `ZSTRLEN` / `COUNT`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2004 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_appendz 3
p4_appendz +ZPLACE ( caddr* u zdest* -- )

    #include <pfe/pfe-base.h>

FCode p4_appendz ---

### Description

Add the string defined by CADDR LEN to the zero terminated string at ZDEST - (for older scripts the `SYNONYM` named `APPENDZ` exists) (see libc strncat(3)) / compare with `ZPLACE` / `+PLACE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2004 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_zplace 3
p4_zplace ZPLACE ( addr* len zaddr* -- )

    #include <pfe/pfe-base.h>

FCode p4_zplace ---

### Description

copy string and place as 0 terminated (see libc strncpy(3)) / see also `+ZPLACE` / `Z+PLACE`

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2004 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_c_backslash_quote 3
p4_c_backslash_quote 'C\\\"' ( [backslashed-strings_<">] -- bstr* )

    #include <pfe/pfe-base.h>

FCode p4_c_backslash_quote ---

### Description

scan the following text to create a literal just like `C"` does, but backslashes can be used to escape special chars. The rules for the backslashes follow C literals, implemented techniques are \n \r \b \a \f \v \e \777 and all non-alnum chars represent themselves, esp. \" \' \ \? \! \% \( \) \[ \] \{ \} etcetera. most importantly the doublequote itself can be escaped. but be also informed that the usage of \' and \" is not portable as some systems preferred to map [\'] into ["]. Here I use the experimental addition to map [\q] to ["] and [\i] to [']

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2004 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_s_backslash_quote 3
p4_s_backslash_quote 'S\\\"' ( [backslashed-strings_<">] -- str cnt )

    #include <pfe/pfe-base.h>

FCode p4_s_backslash_quote ---

### Description

scan the following text to create a literal just like `S"` does, but backslashes can be used to escape special chars. The rules for the backslashes follow C literals, implemented techniques are \n \r \b \a \f \v \e \777 and all non-alnum chars represent themselves, esp. \" \' \ \? \! \% \( \) \[ \] \{ \} etcetera. most importantly the doublequote itself can be escaped. but be also informed that the usage of \' and \" is not portable as some systems preferred to map [\'] into ["]. Here I use the experimental addition to map [\q] to ["] and [\i] to [']

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2004 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>

0.33.71
0.33.71 pfe
p4_z_backslash_quote 3
p4_z_backslash_quote 'Z\\\"' ( [backslashed-strings_<">] -- zstr* )

    #include <pfe/pfe-base.h>

FCode p4_z_backslash_quote ---

### Description

scan the following text to create a literal just like `Z"` does, but backslashes can be used to escape special chars. The rules for the backslashes follow C literals, implemented techniques are \n \r \b \a \f \v \e \777 and all non-alnum chars represent themselves, esp. \" \' \ \? \! \% \( \) \[ \] \{ \} etcetera. most importantly the doublequote itself can be escaped but be also informed that the usage of \' and \" is not portable as some systems preferred to map [\'] into ["]. Here I use the experimental addition to map [\q] to ["] and [\i] to [']

### Author

- Guido U. Draheim (modified by $Author: guidod $)

### Copyright

Copyright (C) 2000 - 2004 Guido U. Draheim <guidod@gmx.de> Copyright (C) 2005 - 2008 Guido U. Draheim <guidod@gmx.de>