


















#         ciforth : a generic I86 ISO FORTH by HCC FIG
# $Id: ci86.gnr,v 5.190 2022/04/06 14:41:12 albert Exp $
# Copyright (2012): Albert van der Horst by GNU Public License
#
#HCC FIG Holland : Hobby Computer Club, Forth Interest Group  Holland
        #  66,106
 #   ciforth $Revision: 5.190 $
#
# For the generic system (to generate ciforth in an other configuration than this one):
#     http://home.hccnet.nl/a.w.m.van.der.horst/ci86gnr.html
#
# The following configuration information should agree with the configuration
# on the frontpage of your docmentation (texinfo, ps, pdf.)
# WITHOUT FITTING DOCUMENTATION YOU MIGHT AS WELL GIVE UP! 
#
# Configuration of this particular version:
# 64-bits protected mode 
# running under Linux  #  with native forth I/O 

# Normally ciforth doesn't observe ISO >IN.
# Contains :
# (there may be no items here.)
#        Security words
#         Loadable words, i.e. all of ISO CORE, more than is needed
#           for a self contained kernel.
# A field in the header to point to source
# An extra field in the header for double links or free use.
#

         # Assembler directive

#
# Gnu as version of ciforth created by ``m4'' from generic listing.
# This source can be assembled using versions better than 2.13.
# This file can be assembled and linked in the following way:
#       as -64 lina.s
#       ld -melf_x86_64   -s -N a.out -o lina
# The -s (strip) is not necessary, and may even be detrimental.

.Intel_syntax prefix

 /* 
        A generic version of ISO FORTH for IBM type standard PC's by
                Albert van der Horst

                in cooperation with
                HCC Forth user group
                The Netherlands
                www.forth.hccnet.nl

                with
        direct contributions for OSX from Robert Spykerman.

              based on
              FIG-FORTH
   implemented by:  Charlie Krajewski
                    205 ( BIG ) Blue Rd.
                    Middletown, CT  06457

  The listing has been made possible by the
  prior work of:
               Thomas Newman, Hayward, Ca.

 : other_acknowledgements
         John_Cassidy
         Kim_Harris
         George_Flammer
         Robert_D._Villwock ;

 : for tools
         Richard M. Stallman
         Linus Torvalds

No one who programs with FORTH can afford to be without:
  "Starting Forth  by Leo Brodie" and "Thinking Forth by Leo Brodie".
   Both out of print.

This Forth is a descendant in the 300+ (RCS)- generations from fig-Forth.

For nostalgic reasons the following comment has never been removed:
   Although there is much to be said for typing in your own
   listing and getting it running, there is much to be said
   not typing in your own listing.  If you feel that 100+
   pages of plinking is nutty, contact me for availability
   of a disc with source & executable files.  Obtainable at
   a bargain basement price, prepare yourself for bargain
   basement support.

All publications of the FORTH Interest Group are public domain.
They may be further distributed by the inclusion of this
credit notice:
               This publication has been made available by:

               FORTH Interest Group
               P.O. Box 1105
               San Carlos, Ca.  94070
[I feel obliged to keep this last one in (%AH). Note that although it is
based on fig-Forth no stone is left unturned.]
 */ 

        #
# ########################################################################################
#                       PREPARATION (no code)
# ########################################################################################

FIGREL  =     5       # FIG RELEASE #
FIGREV  =     0       # FIG REVISION #
USRVER  =     0      # USER VERSION NUMBER, a digit now
#
#      VERY ELEMENTARY .
CW      =     8    # Size of a cell in Forth, not in the bootcode.
ERRORSCREEN =     48    # Screen where the error messages start.
#
#      MEMORY LAYOUT.
# Normally this is specified at the m4 configuration level.
# For a configured system these values can be changed at this single place. 
NBUF    =     16   # No. of buffers, or screens 
KBBUF   =     1024      # Data bytes per disk buffer
US      =     0x40*CW  # User variable space, eats into next data stack, if any.
EM      =     (0x4000000)     # Where the memory ends w.r.t. ORIG. 1) 
EMP     =     (EM-1)/0x1000+1 # Number of pages.
TAS     =     0x10000    #Size of unitialised area per task.
STACKSIZE   = TAS/4  #For both stacks. 
TIBSIZE     = TAS/4  #TIB size. 
#
# NOTE 1:
#Nothing tricky on 64 bits systems


#
#      ASCII CHARACTER EQUIVALENTS
#
ABL     =     ' '     # SPACE
ACR     =     0x0D     # CR
AMS     =     '-'          # MINUS SIGN 
ASO     =     '['          # SQUARE BRACKET OPEN 
ASC     =     ']'          # SQUARE BRACKET CLOSE 
ADOT    =     '.'          # PERIOD
ALF      =     0x0A     # LINE FEED, USED INTERNALLY AS
                        # LINE ENDER
AFF      =     0x0C     # FORM FEED
BELL    =     0x07     # ^G
BSIN    =     0x08     # INPUT DELETE CHARACTER
BSOUT   =     0x08     # OUTPUT BACKSPACE ( ^H )
#
#      HEADER RELATED EQUATES
B_DUMMY   =     0x01     # dea is dummy, from namespace link
B_INVIS   =     0x02     # dea is invisible, "smudged".
B_IMMED   =     0x04     # dea is a immediate.
B_DENOT   =     0x08     # dea is a denotation.
C_HOFFSET =     0       # Offsets of code field in cells, w.r.t. dea
D_HOFFSET =     1       # Same for data field
F_HOFFSET =     2       # Same for flag field
L_HOFFSET =     3       # Same for link field
N_HOFFSET =     4       # Same for name field
S_HOFFSET =     5       # Same for source field
X_HOFFSET =     S_HOFFSET+1# Same for extra field
PH_OFFSET =     5+1+1   # Past header field: Start of data area. 
BD_OFFSET =     5+1+1+1 # Start of BODY for CREATEd word.
HEADSIZE  =     (CW*(PH_OFFSET))  #In cells, only to clean up source.
#
 #  
#
#
BPS     =     512             #Bytes/sector, common to all of MSDOS
SPB     =     KBBUF/BPS
#
#
#
#
#
# 



# ------------------------------------------------------------ 
#   syscalls are copied from                                            
#https://github.com/torvalds/linux/blob/master/arch/x86/entry/syscalls/syscall_64.tbl 
# ------------------------------------------------------------ 
# https://github.com/torvalds/linux/tree/master/arch/x86/entry/syscalls
# you may benefit from the program stealconstant 
# https://github.com/albertvanderhorst/stealconstant 

SEEK_SET        =     0x0    
SEEK_CUR	=     0x1     
TCGETS  =       0x5401
TCSETS  =       0x5402
ECHO    =       0x8
EAGAIN  =       0xb
EINTR   =       0x4
EPIPE   =       0x20
VMIN    =       0x6
VTIME   =       0x5
ICANON  =       0x2
O_RDWR  =       0x2
O_RDONLY        =       0x0
O_WRONLY        =       0x1
O_CREAT =       0x40
O_NONBLOCK      =       0x800
SIZE_TERMIO     =       0x3c

# Numbers of system calls. See "Linux kernel Internals" Appendix A. 
# By M.Beck, H. Boehme e.a. Addison Wesley.                         
# The system calls themselves are extensively documented in chapter 
# 2 of the man pages, e.g. "man 2 exit"

exit    =       0x3c
open    =       0x2
close   =       0x3
creat   =       0x55
unlink  =       0x57
chdir   =       0x50
read    =       0x0
select  =       0x17
write   =       0x1
ioctl   =       0x10
ioperm  =       0xad
iopl    =       0xac
lseek   =       0x8
execve  =       0x3b
fork    =       0x39
waitpid =       0x3d
pipe    =       0x16

_newselect = select

wait4   =     waitpid
#RAWIO           EQU     (ECHO _OR_ ICANON)

# ------------------------------------------------------------  
#   End of constants stolen from C in linux 64 bit environment.        
# ------------------------------------------------------------  
 
RAWIO           =     (ECHO | ICANON)

# 
# 
# 


            .section .forth,"awx",@progbits
        #
        .global  _start       # Entry point's guesses.
        .global  start        # Entry point.
        .global  _main        # Entry point.
_ORIG:
_start:      # Entry point.
# 
# 

# 
    
    

# 

# 
# 
NOBOOT:         # Skip till here if not booting.

# 
ENDBOOT:


#
# 

# 
# 

# 
#
#

#


# 
#


# 4.15.3.2
_main:
start:
#
COLD_ENTRY:
        CLD                     # DIR = INC

        MOV     %RAX, QWORD PTR[USINI+(CW*(1))]
        MOV     %RBX, %RAX
        DEC     %RBX
        OR      %RBX, OFFSET STACKSIZE-1    #Requires it is power of 2.
        INC     %RBX
        SUB     %RBX,%RAX
        ADD     QWORD PTR[USINI+(CW*(0))], %RBX
        ADD     QWORD PTR[USINI+(CW*(1))], %RBX
        ADD     QWORD PTR[USINI+(CW*(2))], %RBX
        ADD     QWORD PTR[USINI+(CW*(3))], %RBX
        ADD     QWORD PTR[USINI+(CW*(4))], %RBX

 # 
       MOV     QWORD PTR[USINI+(CW*(31))],%RSP #Remember ARGS.
#
        MOV     %RSP,QWORD PTR[USINI+(CW*(2))]    #Parameter stack
        MOV     %RBP,QWORD PTR[USINI+(CW*(3))]    #Return stack
        MOV     %RSI,OFFSET COLD+(CW*(PH_OFFSET)) #Interpreter pointer
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#
#
# ########################################################################################
#                       FORTH ITSELF
# ########################################################################################
#
 /* 
   FORTH REGISTERS
   The names under FORTH are used in the generic source.

   FORTH   Intel    FORTH PRESERVATION RULES
   -----   ----     ----- ------------ -----
   HIP   %RSI      High level Interpreter Pointer.  Must be preserved
                    across FORTH words.

   WOR   %RAX      Working register.  When entering a word
                    via its code field the dea is passed in WOR.

   SPO   %RSP      Parameter stack pointer.  Must be preserved
                    across FORTH words.

   RPO   %RBP      Return stack pointer.  Must be preserved across
                    FORTH words.

            %RAX      General register.  Used to pass data from
                    FORTH words, see label APUSH or macro _APUSH

            %RDX      General register.  Used to pass more data from
                    FORTH words, see label DPUSH or macro _DPUSH

            %RBX      General purpose register.

            %RCX      General purpose register.

            %CS      Segment register. Must be preserved
                    across FORTH words.

            %DS      ditto

            %SS      ibid

            %ES      Temporary segment register only used by
                    a few words. However it MUST remain equal to
                    %DS, such that string primitives can be used
                    with impunity.
            The remaining registers are free to use.
            Within assembler words %RAX can be used too,
            as it has served its purpose.

            Here are some  useful code sequences.
            For next:
                    LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
            For push single and next:
                    PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
            For push double and next:
                    PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   


----------------------------------------------------------
 */ 
        #
 /* 
---------------------------------------------

   COMMENT CONVENTIONS
   ------- -----------

   =       IS EQUAL TO
   <-      ASSIGNMENT

  NAME        =  Address of name
  (NAME)      =  Contents of name
  DEA         =  DICTIONARY ENTRY ADDRESS
                 fields have fixed offsets from DEA
  CFA         =  CODE FIELD ADDRESS : a pointer to executable code
  DFA         =  DATA FIELD ADDRESS : a pointer to
                        data/high level code/ DOES> pointer
  FFA         =  FLAG FIELD ADDRESS: contains flags
  LFA         =  LINK FIELD ADDRESS: a pointer to the next DEA
  NFA         =  NAME FIELD ADDRESS: a pointer to a name buffer
  SFA         =  SOURCE FIELD ADDRESS: a pointer into source code
  PHA         =  POST HEADER ADDRESS: Afterall fields

  S1          =  Parameter stack - 1st cell
  S2          =  Parameter stack - 2nd cell
  R1          =  Return stack    - 1st cell
  R2          =  Return stack    - 2nd cell

  LSB         =  Least significant bit
  MSB         =  Most  significant bit
  LB          =  Low byte
  HB          =  High byte
  LC          =  Low  cell
  HC          =  High cell

------------------------------------------------------------
 */ 
# 
        #
# 
#
# 
# In 32 bit versions there may be no jumps to NEXT at all 
# The label NEXT1 is rarely relevant (for _OLDDEBUG_) 
DPUSH:  PUSH    %RDX      # Fall through.
APUSH:  PUSH    %RAX
NEXT:
#
        LODSQ           #AX <- (IP)
NEXT1:  MOV     %RAX,%RAX   # (WOR) <- (IP)

        JMP     QWORD PTR[%RAX]    # TO `CFA'
#
#       Dictionary starts here.

DP0:
# End of ONLY namespace. Namespaces all end in a link to 0.

#  *********
#  *   '   *
#  *********
#
        .balign    8,0x00
N_TICK:
        .quad      1
        .ASCII      "'"
        .balign    8,0x00
TICK:
        .quad    DOCOL
        .quad    TICK+HEADSIZE
        .quad    B_IMMED + B_DENOT
        .quad    0
        .quad    N_TICK
        .quad    0
        .quad    0

        .quad      ITICK
        .quad      LITER
        .quad      SEMIS
#

#  *********
#  *   &   *
#  *********
#
        .balign    8,0x00
N_DCHAR:
        .quad      1
        .ASCII      "&"
        .balign    8,0x00
DCHAR:
        .quad    DOCOL
        .quad    DCHAR+HEADSIZE
        .quad    B_IMMED + B_DENOT
        .quad    TICK
        .quad    N_DCHAR
        .quad    0
        .quad    0

        .quad      PPFET
        .quad      NIP
        .quad      LDUP, QBL
        .quad      LIT, 10, QERR
        .quad      LITER
        .quad      QDELIM
        .quad      SEMIS

#

#  *********
#  *   ^   *
#  *********
#
        .balign    8,0x00
N_DCTL:
        .quad      1
        .ASCII      "^"
        .balign    8,0x00
DCTL:
        .quad    DOCOL
        .quad    DCTL+HEADSIZE
        .quad    B_IMMED + B_DENOT
        .quad    DCHAR
        .quad    N_DCTL
        .quad    0
        .quad    0

        .quad      PPFET
        .quad      NIP
        .quad      LDUP, QBL
        .quad      LIT, 10, QERR
        .quad      LIT, '@', LSUB
        .quad      LITER
        .quad      QDELIM
        .quad      SEMIS
#

#  *********
#  *   0   *
#  *********
#
        .balign    8,0x00
N_DEN0:
        .quad      1
        .ASCII      "0"
        .balign    8,0x00
DEN0:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DCTL
        .quad    N_DEN0
        .quad    0
        .quad    0

#  *********
#  *   1   *
#  *********
#
        .balign    8,0x00
N_DEN1:
        .quad      1
        .ASCII      "1"
        .balign    8,0x00
DEN1:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DEN0
        .quad    N_DEN1
        .quad    0
        .quad    0

#  *********
#  *   2   *
#  *********
#
        .balign    8,0x00
N_DEN2:
        .quad      1
        .ASCII      "2"
        .balign    8,0x00
DEN2:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DEN1
        .quad    N_DEN2
        .quad    0
        .quad    0

#  *********
#  *   3   *
#  *********
#
        .balign    8,0x00
N_DEN3:
        .quad      1
        .ASCII      "3"
        .balign    8,0x00
DEN3:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DEN2
        .quad    N_DEN3
        .quad    0
        .quad    0

#  *********
#  *   4   *
#  *********
#
        .balign    8,0x00
N_DEN4:
        .quad      1
        .ASCII      "4"
        .balign    8,0x00
DEN4:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DEN3
        .quad    N_DEN4
        .quad    0
        .quad    0

#  *********
#  *   5   *
#  *********
#
        .balign    8,0x00
N_DEN5:
        .quad      1
        .ASCII      "5"
        .balign    8,0x00
DEN5:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DEN4
        .quad    N_DEN5
        .quad    0
        .quad    0

#  *********
#  *   6   *
#  *********
#
        .balign    8,0x00
N_DEN6:
        .quad      1
        .ASCII      "6"
        .balign    8,0x00
DEN6:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DEN5
        .quad    N_DEN6
        .quad    0
        .quad    0


#  *********
#  *   7   *
#  *********
#
        .balign    8,0x00
N_DEN7:
        .quad      1
        .ASCII      "7"
        .balign    8,0x00
DEN7:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DEN6
        .quad    N_DEN7
        .quad    0
        .quad    0

#  *********
#  *   8   *
#  *********
#
        .balign    8,0x00
N_DEN8:
        .quad      1
        .ASCII      "8"
        .balign    8,0x00
DEN8:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DEN7
        .quad    N_DEN8
        .quad    0
        .quad    0

#  *********
#  *   9   *
#  *********
#
        .balign    8,0x00
N_DEN9:
        .quad      1
        .ASCII      "9"
        .balign    8,0x00
DEN9:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DEN8
        .quad    N_DEN9
        .quad    0
        .quad    0

#  *********
#  *   A   *
#  *********
#
        .balign    8,0x00
N_DENA:
        .quad      1
        .ASCII      "A"
        .balign    8,0x00
DENA:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DEN9
        .quad    N_DENA
        .quad    0
        .quad    0

#  *********
#  *   B   *
#  *********
#
        .balign    8,0x00
N_DENB:
        .quad      1
        .ASCII      "B"
        .balign    8,0x00
DENB:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DENA
        .quad    N_DENB
        .quad    0
        .quad    0


#  *********
#  *   C   *
#  *********
#
        .balign    8,0x00
N_DENC:
        .quad      1
        .ASCII      "C"
        .balign    8,0x00
DENC:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DENB
        .quad    N_DENC
        .quad    0
        .quad    0

#  *********
#  *   D   *
#  *********
#
        .balign    8,0x00
N_DEND:
        .quad      1
        .ASCII      "D"
        .balign    8,0x00
DEND:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DENC
        .quad    N_DEND
        .quad    0
        .quad    0

#  *********
#  *   E   *
#  *********
#
        .balign    8,0x00
N_DENE:
        .quad      1
        .ASCII      "E"
        .balign    8,0x00
DENE:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DEND
        .quad    N_DENE
        .quad    0
        .quad    0

#  *********
#  *   F   *
#  *********
#
        .balign    8,0x00
N_DENF:
        .quad      1
        .ASCII      "F"
        .balign    8,0x00
DENF:
        .quad    DOCOL
        .quad    LNUMB
        .quad    B_IMMED + B_DENOT
        .quad    DENE
        .quad    N_DENF
        .quad    0
        .quad    0

#

#  *********
#  *   -   *
#  *********
#
        .balign    8,0x00
N_DENM:
        .quad      1
        .ASCII      "-"
        .balign    8,0x00
DENM:
        .quad    DOCOL
        .quad    DENM+HEADSIZE
        .quad    B_IMMED + B_DENOT
        .quad    DENF
        .quad    N_DENM
        .quad    0
        .quad    0

        .quad      PNUMB, DNEGA, SDLITE
        .quad      SEMIS
#

#  *********
#  *   +   *
#  *********
#
        .balign    8,0x00
N_DENP:
        .quad      1
        .ASCII      "+"
        .balign    8,0x00
DENP:
        .quad    DOCOL
        .quad    DENP+HEADSIZE
        .quad    B_IMMED + B_DENOT
        .quad    DENM
        .quad    N_DENP
        .quad    0
        .quad    0

        .quad      PNUMB, SDLITE
        .quad      SEMIS
#

#  *********
#  *   "   *
#  *********
#
        .balign    8,0x00
N_DENQ:
        .quad      1
        .ASCII      "\""
        .balign    8,0x00
DENQ:
        .quad    DOCOL
        .quad    DENQ+HEADSIZE
        .quad    B_IMMED + B_DENOT
        .quad    DENP
        .quad    N_DENQ
        .quad    0
        .quad    0

        .quad      LIT, SKIP, COMMA        #  'SKIP , HERE >R 0 ,
        .quad      HERE, TOR, ZERO, COMMA
DENQ1:
        .quad      LIT, '"', PARSE         #           BEGIN &" PARSE
        .quad      PPFET, LDUP, LIT, '"', EQUAL #           PP@@ DUP &" =
        .quad      ZBRAN
        .quad      DENQ2-.-CW                 #           WHILE
        .quad      TDROP, ONEP             #           2DROP 1+ R@ $+!
        .quad      LDUP, ALLOT, RR, SADD
        .quad      BRAN
        .quad      DENQ1-.-CW                  #           REPEAT
DENQ2:
        .quad      QBL, ZEQU
        .quad      LIT, 10, QERR           #           ?BLANK 0= 10 ?ERROR
        .quad      DROP                    #                DROP 
        .quad      LDUP, ALLOT, RR, SADD     #         DUP ALLOT R@ $+!
    #          0 HERE ! 
    .quad LALIGN
        .quad      FROMR, SFET, DLITE      #           R> $@ POSTPONE DLITERAL ;
        .quad      SEMIS
#

# The FORTH word is the only non-denotation in the ONLY namespace.
#  *************
#  *   FORTH   *
#  *************
#
        .balign    8,0x00
N_FORTH:
        .quad      5
        .ASCII      "FORTH"
        .balign    8,0x00
FORTH:
        .quad    DODOE
        .quad    FORTH+HEADSIZE
        .quad    0x0
        .quad    DENQ
        .quad    N_FORTH
        .quad    0
        .quad    0

        .quad      DOVOC
        .quad      0       # END OF NAMESPACE LIST

        .balign    8,0x00

        .quad    0x0
        .quad    0
        .quad    B_DUMMY
        .quad    TASK
        .quad    (ZERO+(CW*(D_HOFFSET)))
        .quad    0
        .quad    0

#
#
#

#  ************
#  *   CORE   *
#  ************
#
        .balign    8,0x00
N_CORE:
        .quad      4
        .ASCII      "CORE"
        .balign    8,0x00
CORE:
        .quad    DOCOL
        .quad    CORE+HEADSIZE
        .quad    0x0
        .quad    0
        .quad    N_CORE
        .quad    0
        .quad    0

        .quad      ZERO    # Not (fully) present.
        .quad      SEMIS
#

#  ***********
#  *   CPU   *
#  ***********
#
        .balign    8,0x00
N_LCPU:
        .quad      3
        .ASCII      "CPU"
        .balign    8,0x00
LCPU:
        .quad    DOCOL
        .quad    LCPU+HEADSIZE
        .quad    0x0
        .quad    CORE
        .quad    N_LCPU
        .quad    0
        .quad    0


       .quad      LIT, 0x26482776, ZERO     # 'AMDX86'
             # '80386'
           # '80386'
# 

        .quad      SEMIS
#
#       If M4_VERSION exists and contains a . it is an official release
#

#  ***************
#  *   VERSION   *
#  ***************
#
        .balign    8,0x00
N_LVERSION:
        .quad      7
        .ASCII      "VERSION"
        .balign    8,0x00
LVERSION:
        .quad    DOCOL
        .quad    LVERSION+HEADSIZE
        .quad    0x0
        .quad    LCPU
        .quad    N_LVERSION
        .quad    0
        .quad    0

 /* 
#       If this is there it is an official release
        .quad      SKIP
        .quad      22
IBMPC:  .byte      'IBM-PC ciforth'
        .byte      FIGREL+0x40,ADOT,FIGREV+0x30,ADOT,USRVER+0x30
        .quad      LIT, IBMPC, LIT, 22
 */ 
        .quad      SKIP
         .quad      5
SB0: .ASCII      "5.4.1"
       .balign    8,0x00
        .quad      LIT, SB0
        .quad      LIT, 5
        .quad      SEMIS
#

#  ************
#  *   NAME   *
#  ************
#
        .balign    8,0x00
N_LENAME:
        .quad      4
        .ASCII      "NAME"
        .balign    8,0x00
LENAME:
        .quad    DOCOL
        .quad    LENAME+HEADSIZE
        .quad    0x0
        .quad    LVERSION
        .quad    N_LENAME
        .quad    0
        .quad    0

        .quad      SKIP
         .quad      7
SB1: .ASCII      "ciforth"
       .balign    8,0x00
        .quad      LIT, SB1
        .quad      LIT, 7
        .quad      SEMIS
#

#  ****************
#  *   SUPPLIER   *
#  ****************
#
        .balign    8,0x00
N_SUPPLIER:
        .quad      8
        .ASCII      "SUPPLIER"
        .balign    8,0x00
SUPPLIER:
        .quad    DOCOL
        .quad    SUPPLIER+HEADSIZE
        .quad    0x0
        .quad    LENAME
        .quad    N_SUPPLIER
        .quad    0
        .quad    0

        .quad      SKIP
         .quad      20
SB2: .ASCII      "Albert van der Horst"
       .balign    8,0x00
        .quad      LIT, SB2
        .quad      LIT, 20
        .quad      SEMIS
#
#

#  ************
#  *   ONLY   *
#  ************
#
        .balign    8,0x00
N_ONLY:
        .quad      4
        .ASCII      "ONLY"
        .balign    8,0x00
ONLY:
        .quad    DODOE
        .quad    ONLY+HEADSIZE
        .quad    0x0
        .quad    0
        .quad    N_ONLY
        .quad    0
        .quad    0

        .quad      DOVOC
        .quad      FORTH     # NEXT NAMESPACE 
ONLYBODY:

        .balign    8,0x00

        .quad    0x0
        .quad    0
        .quad    B_DUMMY
        .quad    FORTH
        .quad    (ZERO+(CW*(D_HOFFSET)))
        .quad    0
        .quad    0

#

#  *******************
#  *   ENVIRONMENT   *
#  *******************
#
        .balign    8,0x00
N_ENV:
        .quad      11
        .ASCII      "ENVIRONMENT"
        .balign    8,0x00
ENV:
        .quad    DODOE
        .quad    ENV+HEADSIZE
        .quad    0x0
        .quad    ONLY
        .quad    N_ENV
        .quad    0
        .quad    0

        .quad      DOVOC
        .quad      ONLY       # NEXT NAMESPACE 

        .balign    8,0x00

        .quad    0x0
        .quad    0
        .quad    B_DUMMY
        .quad    SUPPLIER
        .quad    (ZERO+(CW*(D_HOFFSET)))
        .quad    0
        .quad    0

#

#  ************
#  *   NOOP   *
#  ************
#
        .balign    8,0x00
N_NOOP:
        .quad      4
        .ASCII      "NOOP"
        .balign    8,0x00
NOOP:
        .quad    NOOP+HEADSIZE
        .quad    NOOP+HEADSIZE
        .quad    0x0
        .quad    ENV
        .quad    N_NOOP
        .quad    0
        .quad    0

       LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#
# 
#

#  ***********
#  *   LIT   *
#  ***********
#
        .balign    8,0x00
N_LIT:
        .quad      3
        .ASCII      "LIT"
        .balign    8,0x00
LIT:
        .quad    LIT+HEADSIZE
        .quad    LIT+HEADSIZE
        .quad    0x0
        .quad    NOOP
        .quad    N_LIT
        .quad    0
        .quad    0

        LODSQ           # AX <- LITERAL
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]             # TO TOP OF STACK
#

#  ***************
#  *   EXECUTE   *
#  ***************
#
        .balign    8,0x00
N_EXEC:
        .quad      7
        .ASCII      "EXECUTE"
        .balign    8,0x00
EXEC:
        .quad    EXEC+HEADSIZE
        .quad    EXEC+HEADSIZE
        .quad    0x0
        .quad    LIT
        .quad    N_EXEC
        .quad    0
        .quad    0

        POP     %RAX      # GET XT
        JMP     QWORD PTR[%RAX]  #(IP) <- (PFA)
#


#  ***************
#  *   RECURSE   *
#  ***************
#
        .balign    8,0x00
N_RECURSE:
        .quad      7
        .ASCII      "RECURSE"
        .balign    8,0x00
RECURSE:
        .quad    DOCOL
        .quad    RECURSE+HEADSIZE
        .quad    B_IMMED
        .quad    EXEC
        .quad    N_RECURSE
        .quad    0
        .quad    0

        .quad      LATEST, COMMA
        .quad      SEMIS
#
#

#  **************
#  *   BRANCH   *
#  **************
#
        .balign    8,0x00
N_BRAN:
        .quad      6
        .ASCII      "BRANCH"
        .balign    8,0x00
BRAN:
        .quad    (SKIP+HEADSIZE)
        .quad    BRAN+HEADSIZE
        .quad    0x0
        .quad    RECURSE
        .quad    N_BRAN
        .quad    0
        .quad    0

#

#  ************
#  *   SKIP   *
#  ************
#
        .balign    8,0x00
N_SKIP:
        .quad      4
        .ASCII      "SKIP"
        .balign    8,0x00
SKIP:
        .quad    SKIP+HEADSIZE
        .quad    SKIP+HEADSIZE
        .quad    0x0
        .quad    BRAN
        .quad    N_SKIP
        .quad    0
        .quad    0

BRAN1:  LODSQ

        DEC     %RAX
        OR      %AL, OFFSET 8 - 1
        INC     %RAX
#
        ADD     %RSI,%RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ***************
#  *   0BRANCH   *
#  ***************
#
        .balign    8,0x00
N_ZBRAN:
        .quad      7
        .ASCII      "0BRANCH"
        .balign    8,0x00
ZBRAN:
        .quad    ZBRAN+HEADSIZE
        .quad    ZBRAN+HEADSIZE
        .quad    0x0
        .quad    SKIP
        .quad    N_ZBRAN
        .quad    0
        .quad    0

        POP     %RAX      # GET STACK VALUE
        OR      %RAX,%RAX   # ZERO?
        JZ      BRAN1   # YES, BRANCH
        LEA     %RSI,[%RSI+(CW*(1))]
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ***************
#  *   (+LOOP)   *
#  ***************
#
        .balign    8,0x00
N_XPLOOP:
        .quad      7
        .ASCII      "(+LOOP)"
        .balign    8,0x00
XPLOOP:
        .quad    XPLOOP+HEADSIZE
        .quad    XPLOOP+HEADSIZE
        .quad    0x0
        .quad    ZBRAN
        .quad    N_XPLOOP
        .quad    0
        .quad    0

        POP     %RBX      # GET INCREMENT
        ADD     [%RBP],%RBX # INDEX = INDEX + INCR
        MOV     %RCX,[%RBP] # GET NEW INDEX
        SUB     %RCX,[%RBP+(CW*(1))]        # COMPARE WITH LIMIT
        XOR     %RCX,%RBX   # compare sign
        SETNS    %AL      #different signs?
        MOVZX   %RAX,%AL
        NEG     %RAX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   

#

#  ************
#  *   (DO)   *
#  ************
#
        .balign    8,0x00
N_XDO:
        .quad      4
        .ASCII      "(DO)"
        .balign    8,0x00
XDO:
        .quad    XDO+HEADSIZE
        .quad    XDO+HEADSIZE
        .quad    0x0
        .quad    XPLOOP
        .quad    N_XDO
        .quad    0
        .quad    0

        LODSQ
        ADD     %RAX,%RSI  #Make absolute
        POP     %RDX      # INITIAL INDEX VALUE
        POP     %RBX      # LIMIT VALUE
        XCHG    %RBP,%RSP   # GET RETURN STACK
        PUSH    %RAX      # Target location.
        PUSH    %RBX
        PUSH    %RDX
        XCHG    %RBP,%RSP   # GET PARAMETER STACK
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *************
#  *   (?DO)   *
#  *************
#
        .balign    8,0x00
N_XQDO:
        .quad      5
        .ASCII      "(?DO)"
        .balign    8,0x00
XQDO:
        .quad    XQDO+HEADSIZE
        .quad    XQDO+HEADSIZE
        .quad    0x0
        .quad    XDO
        .quad    N_XQDO
        .quad    0
        .quad    0

        LODSQ
        ADD     %RAX,%RSI  #Make absolute
        POP     %RDX      # INITIAL INDEX VALUE
        POP     %RBX      # LIMIT VALUE
        CMP     %RDX,%RBX
        JGE     QXDO1
        XCHG    %RBP,%RSP   # GET RETURN STACK
        PUSH    %RAX      # Target location.
        PUSH    %RBX
        PUSH    %RDX
        XCHG    %RBP,%RSP   # GET PARAMETER STACK
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
QXDO1:  MOV     %RSI,%RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *********
#  *   I   *
#  *********
#
        .balign    8,0x00
N_IDO:
        .quad      1
        .ASCII      "I"
        .balign    8,0x00
IDO:
        .quad    IDO+HEADSIZE
        .quad    IDO+HEADSIZE
        .quad    0x0
        .quad    XQDO
        .quad    N_IDO
        .quad    0
        .quad    0

        MOV     %RAX,[%RBP] # GET INDEX VALUE
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]             # TO PARAMETER STACK
#

#  *********
#  *   J   *
#  *********
#
        .balign    8,0x00
N_JDO:
        .quad      1
        .ASCII      "J"
        .balign    8,0x00
JDO:
        .quad    JDO+HEADSIZE
        .quad    JDO+HEADSIZE
        .quad    0x0
        .quad    IDO
        .quad    N_JDO
        .quad    0
        .quad    0

        MOV     %RAX,[%RBP+(CW*(3))] # GET INDEX VALUE
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]             # TO PARAMETER STACK
#

#  **************
#  *   UNLOOP   *
#  **************
#
        .balign    8,0x00
N_UNLOOP:
        .quad      6
        .ASCII      "UNLOOP"
        .balign    8,0x00
UNLOOP:
        .quad    UNLOOP+HEADSIZE
        .quad    UNLOOP+HEADSIZE
        .quad    0x0
        .quad    JDO
        .quad    N_UNLOOP
        .quad    0
        .quad    0

        LEA     %RBP,[%RBP+(CW*(3))]
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ***************
#  *   +ORIGIN   *
#  ***************
#
        .balign    8,0x00
N_PORIG:
        .quad      7
        .ASCII      "+ORIGIN"
        .balign    8,0x00
PORIG:
        .quad    DOCOL
        .quad    PORIG+HEADSIZE
        .quad    0x0
        .quad    UNLOOP
        .quad    N_PORIG
        .quad    0
        .quad    0

        .quad      LIT
        .quad      USINI
        .quad      PLUS
        .quad      SEMIS
#
#      Initialisation block for user variables through DOC-LINK
#       <<<<< must be in same order as user variables >>>>>
# Still fig-compatible! Both entries take two cells.
#
        LEA     %RAX,[COLD]
        JMP     QWORD PTR[%RAX]          #Hope stacks are still okay.
        .balign    8,0x00
# Make it possible to revector WARM. You can even make it low level. 
        LEA     %RAX,[WARM]
        JMP     QWORD PTR[%RAX]          #Hope stacks are still okay.
        .balign    8,0x00
USINI:  .quad      STRUSA   # user area, copied before use in this threading Forth. # 
        .quad      STRUSA  # INIT (U0) user area of the main task 1
        .quad      INITS0  # INIT (S0)         2
# %RSP@ must not be divisible by TASK-SIZE, to serve as user pointer. 
        .quad      INITR0   - (CW*(1)) 
                        # INIT (R0)         3
        .quad      STRTIB  # INIT (TIB)        4
        .quad      BSIN    # RUBOUT: get rid of latest char 5
        .quad      0       # AVAILABLE         6
        .quad      1       # INIT (WARNING)     7
        .quad      INITDP  #      INIT (FENCE)  8
DPA:    .quad      INITDP  #      INIT (DP)     9
        .quad      ENV #       INIT (VOC-LINK) 10
        .quad      39+16  # INIT (MAX-USER) 11
#
#
#
#
        .quad      0, 0            # WHERE             12 13 
        .quad      0, 0            #REMAINDER   14 15 
# 
        .SPACE   US-(. - USINI)        # All user can be initialised.
#
#      <<<<< end of data used by cold start >>>>>

#  *************
#  *   DIGIT   *
#  *************
#
        .balign    8,0x00
N_DIGIT:
        .quad      5
        .ASCII      "DIGIT"
        .balign    8,0x00
DIGIT:
        .quad    DIGIT+HEADSIZE
        .quad    DIGIT+HEADSIZE
        .quad    0x0
        .quad    PORIG
        .quad    N_DIGIT
        .quad    0
        .quad    0

        POP     %RDX      #NUMBER BASE
        POP     %RAX      #ASCII DIGIT
        SUB     %AL,OFFSET '0'
        JB      DIGI2   #NUMBER ERROR
        CMP     %AL,OFFSET 9
        JBE     DIGI1   #NUMBER = 0 THRU 9
        SUB     %AL,OFFSET 7
        CMP     %AL,OFFSET 10   #NUMBER 'A' THRU 'Z'?
        JB      DIGI2   #NO
DIGI1:  CMP     %AL,%DL   # COMPARE NUMBER TO BASE
        JAE     DIGI2   #NUMBER ERROR
        SUB     %RDX,%RDX   #ZERO
        MOV     %DL,%AL   #NEW BINARY NUMBER
        MOV     %AL,OFFSET 1    #TRUE FLAG
        NEG     %RAX
        JMP     DIGI3
#   NUMBER ERROR
DIGI2:  SUB     %RAX,%RAX   #FALSE FLAG
DIGI3:
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **************
#  *   ~MATCH   *
#  **************
#
        .balign    8,0x00
N_NMATCH:
        .quad      6
        .ASCII      "~MATCH"
        .balign    8,0x00
NMATCH:
        .quad    DOCOL
        .quad    NMATCH+HEADSIZE
        .quad    0x0
        .quad    DIGIT
        .quad    N_NMATCH
        .quad    0
        .quad    0

#
        .quad      TOR                           # Remember dea
        .quad      OVER
        .quad      RR, TNFA, FETCH, SFET
        .quad      CORA
        .quad      FROMR, SWAP                   # Leave flag on top of dea.
        .quad      SEMIS                            #
#

#  **************
#  *   ?BLANK   *
#  **************
#
        .balign    8,0x00
N_QBL:
        .quad      6
        .ASCII      "?BLANK"
        .balign    8,0x00
QBL:
        .quad    DOCOL
        .quad    QBL+HEADSIZE
        .quad    0x0
        .quad    NMATCH
        .quad    N_QBL
        .quad    0
        .quad    0

        .quad      LBL, ONEP, LESS
        .quad      SEMIS
#

#  ************
#  *   PP@@   *
#  ************
#
        .balign    8,0x00
N_PPFET:
        .quad      4
        .ASCII      "PP@@"
        .balign    8,0x00
PPFET:
        .quad    DOCOL
        .quad    PPFET+HEADSIZE
        .quad    0x0
        .quad    QBL
        .quad    N_PPFET
        .quad    0
        .quad    0

        .quad      SRC, CELLP, TFET
        .quad      OVER, EQUAL
        .quad      ZBRAN
        .quad      PPFET1-.-CW
        .quad      ZERO
        .quad      BRAN
        .quad      PPFET2-.-CW
PPFET1:
        .quad      LDUP
        
        .quad      CFET
        .quad      ONE, PP, PSTOR
PPFET2:
        .quad      SEMIS
#

#  ************
#  *   NAME   *
#  ************
#
        .balign    8,0x00
N_LNAME:
        .quad      4
        .ASCII      "NAME"
        .balign    8,0x00
LNAME:
        .quad    DOCOL
        .quad    LNAME+HEADSIZE
        .quad    0x0
        .quad    PPFET
        .quad    N_LNAME
        .quad    0
        .quad    0

        .quad      X
PWORD0: .quad      DROP
        .quad      PPFET, QBL
        .quad      OVER, SRC, CELLP, FETCH, LSUB # At end?
        .quad      LAND, ZEQU
        .quad      ZBRAN
        .quad      PWORD0-.-CW

        .quad      X
PWORD1: .quad      DROP
        .quad      PPFET, QBL
        .quad      ZBRAN
        .quad      PWORD1-.-CW

        .quad      OVER, LSUB
        
        .quad      SEMIS
#

#  *************
#  *   PARSE   *
#  *************
#
        .balign    8,0x00
N_PARSE:
        .quad      5
        .ASCII      "PARSE"
        .balign    8,0x00
PARSE:
        .quad    DOCOL
        .quad    PARSE+HEADSIZE
        .quad    0x0
        .quad    LNAME
        .quad    N_PARSE
        .quad    0
        .quad    0

        .quad      SRC, CELLP, TFET
        .quad      OVER, LSUB
        
        .quad      ROT, SSLAS, TSWAP
        .quad      ZEQU
        .quad      ZBRAN
        .quad      PARSE8-.-CW
        .quad      DROP, SRC, CELLP, FETCH
PARSE8: 
        .quad      PP, STOR
        .quad SEMIS
#

#  ***********
#  *   SRC   *
#  ***********
#
        .balign    8,0x00
N_SRC:
        .quad      3
        .ASCII      "SRC"
        .balign    8,0x00
SRC:
        .quad    DOUSE
        .quad    (CW*(27))
        .quad    0x0
        .quad    PARSE
        .quad    N_SRC
        .quad    0
        .quad    0
      # And 28 and 29.
#


#  **************
#  *   SOURCE   *
#  **************
#
        .balign    8,0x00
N_SOURCE:
        .quad      6
        .ASCII      "SOURCE"
        .balign    8,0x00
SOURCE:
        .quad    DOCOL
        .quad    SOURCE+HEADSIZE
        .quad    0x0
        .quad    SRC
        .quad    N_SOURCE
        .quad    0
        .quad    0

        .quad      SRC, TFET
        .quad      SWAP, OVER, LSUB
        .quad      SEMIS
#
# 
#

#  **********
#  *   CR   *
#  **********
#
        .balign    8,0x00
N_CR:
        .quad      2
        .ASCII      "CR"
        .balign    8,0x00
CR:
        .quad    DOCOL
        .quad    CR+HEADSIZE
        .quad    0x0
        .quad    SOURCE
        .quad    N_CR
        .quad    0
        .quad    0

        .quad      LIT,ALF
        .quad      EMIT
        .quad      ZERO, LOUT, STOR
        .quad      SEMIS
#

#  *************
#  *   CMOVE   *
#  *************
#
        .balign    8,0x00
N_LCMOVE:
        .quad      5
        .ASCII      "CMOVE"
        .balign    8,0x00
LCMOVE:
        .quad    LCMOVE+HEADSIZE
        .quad    LCMOVE+HEADSIZE
        .quad    0x0
        .quad    CR
        .quad    N_LCMOVE
        .quad    0
        .quad    0

        CLD             #direction
        MOV     %RBX,%RSI   #save 
        POP     %RCX      #count
        POP     %RDI      #dest
        POP     %RSI      #source
        REP     MOVSB
        MOV     %RSI,%RBX   #get back 
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ************
#  *   MOVE   *
#  ************
#
        .balign    8,0x00
N_LMOVE:
        .quad      4
        .ASCII      "MOVE"
        .balign    8,0x00
LMOVE:
        .quad    LMOVE+HEADSIZE
        .quad    LMOVE+HEADSIZE
        .quad    0x0
        .quad    LCMOVE
        .quad    N_LMOVE
        .quad    0
        .quad    0

        MOV     %RBX,%RSI   #SAVE 
        POP     %RCX      #count
        POP     %RDI      #dest
        POP     %RSI      #source
        CMP     %RSI,%RDI
        JC    MOVE1
        CLD             #INC DIRECTION
        JMP SHORT MOVE2
MOVE1:  STD
        ADD     %RDI,%RCX
        DEC     %RDI
        ADD     %RSI,%RCX
        DEC     %RSI
MOVE2:
        REP     MOVSB   #THAT'S THE MOVE
        CLD             #INC DIRECTION
        MOV     %RSI,%RBX   #GET BACK 
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#
#

#  ***********
#  *   UM*   *
#  ***********
#
        .balign    8,0x00
N_USTAR:
        .quad      3
        .ASCII      "UM*"
        .balign    8,0x00
USTAR:
        .quad    USTAR+HEADSIZE
        .quad    USTAR+HEADSIZE
        .quad    0x0
        .quad    LMOVE
        .quad    N_USTAR
        .quad    0
        .quad    0

        POP     %RAX
        POP     %RBX
        MUL     %RBX      #UNSIGNED
        XCHG    %RAX,%RDX   #AX NOW = MSW
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]             #STORE DOUBLE CELL
#

#  **************
#  *   UM/MOD   *
#  **************
#
        .balign    8,0x00
N_USLAS:
        .quad      6
        .ASCII      "UM/MOD"
        .balign    8,0x00
USLAS:
        .quad    USLAS+HEADSIZE
        .quad    USLAS+HEADSIZE
        .quad    0x0
        .quad    USTAR
        .quad    N_USLAS
        .quad    0
        .quad    0

        POP     %RBX      #DIVISOR
        POP     %RDX      #MSW OF DIVIDEND
        POP     %RAX      #LSW OF DIVIDEND
        DIV     %RBX      #16 BIT DIVIDE
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]             #STORE QUOT/REM
#

#  ***********
#  *   AND   *
#  ***********
#
        .balign    8,0x00
N_LAND:
        .quad      3
        .ASCII      "AND"
        .balign    8,0x00
LAND:
        .quad    LAND+HEADSIZE
        .quad    LAND+HEADSIZE
        .quad    0x0
        .quad    USLAS
        .quad    N_LAND
        .quad    0
        .quad    0

        POP     %RAX
        POP     %RBX
        AND     %RAX,%RBX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   OR   *
#  **********
#
        .balign    8,0x00
N_LOR:
        .quad      2
        .ASCII      "OR"
        .balign    8,0x00
LOR:
        .quad    LOR+HEADSIZE
        .quad    LOR+HEADSIZE
        .quad    0x0
        .quad    LAND
        .quad    N_LOR
        .quad    0
        .quad    0

        POP     %RAX      # (S1) <- (S1) OR (S2)
        POP     %RBX
        OR      %RAX,%RBX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ***********
#  *   XOR   *
#  ***********
#
        .balign    8,0x00
N_LXOR:
        .quad      3
        .ASCII      "XOR"
        .balign    8,0x00
LXOR:
        .quad    LXOR+HEADSIZE
        .quad    LXOR+HEADSIZE
        .quad    0x0
        .quad    LOR
        .quad    N_LXOR
        .quad    0
        .quad    0

        POP     %RAX      # (S1) <- (S1) XOR (S2)
        POP     %RBX
        XOR     %RAX,%RBX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **************
#  *   INVERT   *
#  **************
#
        .balign    8,0x00
N_INVERT:
        .quad      6
        .ASCII      "INVERT"
        .balign    8,0x00
INVERT:
        .quad    INVERT+HEADSIZE
        .quad    INVERT+HEADSIZE
        .quad    0x0
        .quad    LXOR
        .quad    N_INVERT
        .quad    0
        .quad    0

        POP     %RAX      # (S1) <- (S1) XOR (S2)
        NOT     %RAX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ************
#  *   DSP@   *
#  ************
#
        .balign    8,0x00
N_SPFET:
        .quad      4
        .ASCII      "DSP@"
        .balign    8,0x00
SPFET:
        .quad    SPFET+HEADSIZE
        .quad    SPFET+HEADSIZE
        .quad    0x0
        .quad    INVERT
        .quad    N_SPFET
        .quad    0
        .quad    0

        MOV     %RAX,%RSP   # (S1) <- (SP)
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ************
#  *   DSP!   *
#  ************
#
        .balign    8,0x00
N_SPSTO:
        .quad      4
        .ASCII      "DSP!"
        .balign    8,0x00
SPSTO:
        .quad    SPSTO+HEADSIZE
        .quad    SPSTO+HEADSIZE
        .quad    0x0
        .quad    SPFET
        .quad    N_SPSTO
        .quad    0
        .quad    0

        POP     %RAX
        MOV     %RSP,%RAX        #RESET PARAM STACK POINTER
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *************
#  *   DEPTH   *
#  *************
#
        .balign    8,0x00
N_DEPTH:
        .quad      5
        .ASCII      "DEPTH"
        .balign    8,0x00
DEPTH:
        .quad    DOCOL
        .quad    DEPTH+HEADSIZE
        .quad    0x0
        .quad    SPSTO
        .quad    N_DEPTH
        .quad    0
        .quad    0

        .quad      SZERO, FETCH
        .quad      SPFET
        .quad      LSUB
        .quad      LIT, CW, SLASH
        .quad      ONEM
        .quad      SEMIS
#

#  ***********
#  *   CLS   *
#  ***********
#
        .balign    8,0x00
N_CLS:
        .quad      3
        .ASCII      "CLS"
        .balign    8,0x00
CLS:
        .quad    DOCOL
        .quad    CLS+HEADSIZE
        .quad    0x0
        .quad    DEPTH
        .quad    N_CLS
        .quad    0
        .quad    0

        .quad      SZERO, FETCH
        .quad      SPSTO
        .quad      SEMIS
#

#  ************
#  *   RSP@   *
#  ************
#
        .balign    8,0x00
N_RPFET:
        .quad      4
        .ASCII      "RSP@"
        .balign    8,0x00
RPFET:
        .quad    RPFET+HEADSIZE
        .quad    RPFET+HEADSIZE
        .quad    0x0
        .quad    CLS
        .quad    N_RPFET
        .quad    0
        .quad    0
      #(S1) <- (RP)
        PUSH    %RBP
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ************
#  *   RSP!   *
#  ************
#
        .balign    8,0x00
N_RPSTO:
        .quad      4
        .ASCII      "RSP!"
        .balign    8,0x00
RPSTO:
        .quad    RPSTO+HEADSIZE
        .quad    RPSTO+HEADSIZE
        .quad    0x0
        .quad    RPFET
        .quad    N_RPSTO
        .quad    0
        .quad    0

        POP     %RBP
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ************
#  *   EXIT   *
#  ************
#
        .balign    8,0x00
N_EXIT:
        .quad      4
        .ASCII      "EXIT"
        .balign    8,0x00
EXIT:
        .quad    EXIT+HEADSIZE
        .quad    EXIT+HEADSIZE
        .quad    0x0
        .quad    RPSTO
        .quad    N_EXIT
        .quad    0
        .quad    0

        MOV     %RSI,[%RBP] #(IP) <- (R1)
        LEA     %RBP,[%RBP+(CW*(1))]
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   CO   *
#  **********
#
        .balign    8,0x00
N_CO:
        .quad      2
        .ASCII      "CO"
        .balign    8,0x00
CO:
        .quad    CO+HEADSIZE
        .quad    CO+HEADSIZE
        .quad    0x0
        .quad    EXIT
        .quad    N_CO
        .quad    0
        .quad    0

        XCHG    %RSI,[%RBP]
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ***********
#  *   (;)   *
#  ***********
#
        .balign    8,0x00
N_SEMIS:
        .quad      3
        .ASCII      "(;)"
        .balign    8,0x00
SEMIS:
        .quad    (EXIT+HEADSIZE)
        .quad    SEMIS+HEADSIZE
        .quad    0x0
        .quad    CO
        .quad    N_SEMIS
        .quad    0
        .quad    0

#

#  *************
#  *   LEAVE   *
#  *************
#
        .balign    8,0x00
N_LLEAV:
        .quad      5
        .ASCII      "LEAVE"
        .balign    8,0x00
LLEAV:
        .quad    DOCOL
        .quad    LLEAV+HEADSIZE
        .quad    0x0
        .quad    SEMIS
        .quad    N_LLEAV
        .quad    0
        .quad    0
  #LIMIT <- INDEX
        .quad      UNLOOP
        .quad      SEMIS
#

#  **********
#  *   >R   *
#  **********
#
        .balign    8,0x00
N_TOR:
        .quad      2
        .ASCII      ">R"
        .balign    8,0x00
TOR:
        .quad    TOR+HEADSIZE
        .quad    TOR+HEADSIZE
        .quad    0x0
        .quad    LLEAV
        .quad    N_TOR
        .quad    0
        .quad    0
        # (R1) <- (S1)
        POP     %RBX      #GET STACK PARAMETER
        LEA     %RBP,[%RBP - (CW*(1))]    #MOVE RETURN STACK DOWN
        MOV     [%RBP],%RBX #ADD TO RETURN STACK
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   R>   *
#  **********
#
        .balign    8,0x00
N_FROMR:
        .quad      2
        .ASCII      "R>"
        .balign    8,0x00
FROMR:
        .quad    FROMR+HEADSIZE
        .quad    FROMR+HEADSIZE
        .quad    0x0
        .quad    TOR
        .quad    N_FROMR
        .quad    0
        .quad    0
      #(S1) <- (R1)
        MOV     %RAX,[%RBP] # GET RETURN STACK VALUE
        LEA     %RBP,[%RBP + (CW*(1))]
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *************
#  *   RDROP   *
#  *************
#
        .balign    8,0x00
N_RDROP:
        .quad      5
        .ASCII      "RDROP"
        .balign    8,0x00
RDROP:
        .quad    RDROP+HEADSIZE
        .quad    RDROP+HEADSIZE
        .quad    0x0
        .quad    FROMR
        .quad    N_RDROP
        .quad    0
        .quad    0
      #(S1) <- (R1)
        LEA     %RBP,[%RBP+(CW*(1))]
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   R@   *
#  **********
#
        .balign    8,0x00
N_RR:
        .quad      2
        .ASCII      "R@"
        .balign    8,0x00
RR:
        .quad    (IDO+HEADSIZE)
        .quad    RR+HEADSIZE
        .quad    0x0
        .quad    RDROP
        .quad    N_RR
        .quad    0
        .quad    0

#

#  **********
#  *   0=   *
#  **********
#
        .balign    8,0x00
N_ZEQU:
        .quad      2
        .ASCII      "0="
        .balign    8,0x00
ZEQU:
        .quad    ZEQU+HEADSIZE
        .quad    ZEQU+HEADSIZE
        .quad    0x0
        .quad    RR
        .quad    N_ZEQU
        .quad    0
        .quad    0

        POP     %RAX      #S2
        AND     %RAX,%RAX
        SETZ    %AL
        MOVZX   %RAX,%AL
        NEG     %RAX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
        POP     %RAX
#

#  **********
#  *   0<   *
#  **********
#
        .balign    8,0x00
N_ZLESS:
        .quad      2
        .ASCII      "0<"
        .balign    8,0x00
ZLESS:
        .quad    ZLESS+HEADSIZE
        .quad    ZLESS+HEADSIZE
        .quad    0x0
        .quad    ZEQU
        .quad    N_ZLESS
        .quad    0
        .quad    0

        POP     %RAX
        AND     %RAX,%RAX
        SETS    %AL
        MOVZX   %RAX,%AL
        NEG     %RAX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *********
#  *   +   *
#  *********
#
        .balign    8,0x00
N_PLUS:
        .quad      1
        .ASCII      "+"
        .balign    8,0x00
PLUS:
        .quad    PLUS+HEADSIZE
        .quad    PLUS+HEADSIZE
        .quad    0x0
        .quad    ZLESS
        .quad    N_PLUS
        .quad    0
        .quad    0

        POP     %RAX      #(S1) <- (S1) + (S2)
        POP     %RBX
        ADD     %RAX,%RBX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   D+   *
#  **********
#
        .balign    8,0x00
N_DPLUS:
        .quad      2
        .ASCII      "D+"
        .balign    8,0x00
DPLUS:
        .quad    DPLUS+HEADSIZE
        .quad    DPLUS+HEADSIZE
        .quad    0x0
        .quad    PLUS
        .quad    N_DPLUS
        .quad    0
        .quad    0

        POP     %RAX      # YHC
        POP     %RDX      # YLC
        POP     %RBX      # XHC
        POP     %RCX      # XLC
        ADD     %RDX,%RCX   # SLC
        ADC     %RAX,%RBX   # SHC
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **************
#  *   NEGATE   *
#  **************
#
        .balign    8,0x00
N_NEGATE:
        .quad      6
        .ASCII      "NEGATE"
        .balign    8,0x00
NEGATE:
        .quad    NEGATE+HEADSIZE
        .quad    NEGATE+HEADSIZE
        .quad    0x0
        .quad    DPLUS
        .quad    N_NEGATE
        .quad    0
        .quad    0

        POP     %RAX
        NEG     %RAX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ***************
#  *   DNEGATE   *
#  ***************
#
        .balign    8,0x00
N_DNEGA:
        .quad      7
        .ASCII      "DNEGATE"
        .balign    8,0x00
DNEGA:
        .quad    DNEGA+HEADSIZE
        .quad    DNEGA+HEADSIZE
        .quad    0x0
        .quad    NEGATE
        .quad    N_DNEGA
        .quad    0
        .quad    0

        POP     %RBX
        POP     %RCX
        SUB     %RAX,%RAX
        MOV     %RDX,%RAX
        SUB     %RDX,%RCX   # MAKE 2'S COMPLEMENT
        SBB     %RAX,%RBX   # HIGH CELL
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
        #
#

#  ************
#  *   OVER   *
#  ************
#
        .balign    8,0x00
N_OVER:
        .quad      4
        .ASCII      "OVER"
        .balign    8,0x00
OVER:
        .quad    OVER+HEADSIZE
        .quad    OVER+HEADSIZE
        .quad    0x0
        .quad    DNEGA
        .quad    N_OVER
        .quad    0
        .quad    0

        POP     %RDX
        POP     %RAX
        PUSH    %RAX
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ************
#  *   DROP   *
#  ************
#
        .balign    8,0x00
N_DROP:
        .quad      4
        .ASCII      "DROP"
        .balign    8,0x00
DROP:
        .quad    DROP+HEADSIZE
        .quad    DROP+HEADSIZE
        .quad    0x0
        .quad    OVER
        .quad    N_DROP
        .quad    0
        .quad    0

        POP     %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ***********
#  *   NIP   *
#  ***********
#
        .balign    8,0x00
N_NIP:
        .quad      3
        .ASCII      "NIP"
        .balign    8,0x00
NIP:
        .quad    NIP+HEADSIZE
        .quad    NIP+HEADSIZE
        .quad    0x0
        .quad    DROP
        .quad    N_NIP
        .quad    0
        .quad    0

        POP     %RAX
        POP     %RBX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *************
#  *   2DROP   *
#  *************
#
        .balign    8,0x00
N_TDROP:
        .quad      5
        .ASCII      "2DROP"
        .balign    8,0x00
TDROP:
        .quad    TDROP+HEADSIZE
        .quad    TDROP+HEADSIZE
        .quad    0x0
        .quad    NIP
        .quad    N_TDROP
        .quad    0
        .quad    0

        POP     %RAX
        POP     %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ************
#  *   SWAP   *
#  ************
#
        .balign    8,0x00
N_SWAP:
        .quad      4
        .ASCII      "SWAP"
        .balign    8,0x00
SWAP:
        .quad    SWAP+HEADSIZE
        .quad    SWAP+HEADSIZE
        .quad    0x0
        .quad    TDROP
        .quad    N_SWAP
        .quad    0
        .quad    0

        POP     %RDX
        POP     %RAX
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ***********
#  *   DUP   *
#  ***********
#
        .balign    8,0x00
N_LDUP:
        .quad      3
        .ASCII      "DUP"
        .balign    8,0x00
LDUP:
        .quad    LDUP+HEADSIZE
        .quad    LDUP+HEADSIZE
        .quad    0x0
        .quad    SWAP
        .quad    N_LDUP
        .quad    0
        .quad    0

        POP     %RAX
        PUSH    %RAX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ************
#  *   2DUP   *
#  ************
#
        .balign    8,0x00
N_TDUP:
        .quad      4
        .ASCII      "2DUP"
        .balign    8,0x00
TDUP:
        .quad    TDUP+HEADSIZE
        .quad    TDUP+HEADSIZE
        .quad    0x0
        .quad    LDUP
        .quad    N_TDUP
        .quad    0
        .quad    0

        POP     %RAX
        POP     %RDX
        PUSH    %RDX
        PUSH    %RAX
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *************
#  *   2SWAP   *
#  *************
#
        .balign    8,0x00
N_TSWAP:
        .quad      5
        .ASCII      "2SWAP"
        .balign    8,0x00
TSWAP:
        .quad    TSWAP+HEADSIZE
        .quad    TSWAP+HEADSIZE
        .quad    0x0
        .quad    TDUP
        .quad    N_TSWAP
        .quad    0
        .quad    0

        POP     %RBX
        POP     %RCX
        POP     %RAX
        POP     %RDX
        PUSH     %RCX
        PUSH     %RBX
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *************
#  *   2OVER   *
#  *************
#
        .balign    8,0x00
N_TOVER:
        .quad      5
        .ASCII      "2OVER"
        .balign    8,0x00
TOVER:
        .quad    TOVER+HEADSIZE
        .quad    TOVER+HEADSIZE
        .quad    0x0
        .quad    TSWAP
        .quad    N_TOVER
        .quad    0
        .quad    0

        POP     %RBX
        POP     %RCX
        POP     %RAX
        POP     %RDX
        PUSH     %RDX
        PUSH     %RAX
        PUSH     %RCX
        PUSH     %RBX
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   +!   *
#  **********
#
        .balign    8,0x00
N_PSTOR:
        .quad      2
        .ASCII      "+!"
        .balign    8,0x00
PSTOR:
        .quad    PSTOR+HEADSIZE
        .quad    PSTOR+HEADSIZE
        .quad    0x0
        .quad    TOVER
        .quad    N_PSTOR
        .quad    0
        .quad    0

        POP     %RBX      #ADDRESS
        POP     %RAX      #INCREMENT
        ADD     [%RBX],%RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **************
#  *   TOGGLE   *
#  **************
#
        .balign    8,0x00
N_TOGGL:
        .quad      6
        .ASCII      "TOGGLE"
        .balign    8,0x00
TOGGL:
        .quad    TOGGL+HEADSIZE
        .quad    TOGGL+HEADSIZE
        .quad    0x0
        .quad    PSTOR
        .quad    N_TOGGL
        .quad    0
        .quad    0

        POP     %RAX      #BIT PATTERN
        POP     %RBX      #ADDR
        XOR     [%RBX],%RAX #
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *********
#  *   @   *
#  *********
#
        .balign    8,0x00
N_FETCH:
        .quad      1
        .ASCII      "@"
        .balign    8,0x00
FETCH:
        .quad    FETCH+HEADSIZE
        .quad    FETCH+HEADSIZE
        .quad    0x0
        .quad    TOGGL
        .quad    N_FETCH
        .quad    0
        .quad    0

        POP     %RBX
        MOV     %RAX,[%RBX]
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#


#  **********
#  *   L@   *
#  **********
#
        .balign    8,0x00
N_LFETCH:
        .quad      2
        .ASCII      "L@"
        .balign    8,0x00
LFETCH:
        .quad    LFETCH+HEADSIZE
        .quad    LFETCH+HEADSIZE
        .quad    0x0
        .quad    FETCH
        .quad    N_LFETCH
        .quad    0
        .quad    0

        POP     %RBX
        XOR     %RAX,%RAX
        MOV     %EAX,[%RBX]
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#
#

#  **********
#  *   C@   *
#  **********
#
        .balign    8,0x00
N_CFET:
        .quad      2
        .ASCII      "C@"
        .balign    8,0x00
CFET:
        .quad    CFET+HEADSIZE
        .quad    CFET+HEADSIZE
        .quad    0x0
        .quad    LFETCH
        .quad    N_CFET
        .quad    0
        .quad    0

        POP     %RBX
        XOR     %RAX,%RAX
        MOV     %AL,[%RBX]
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   2@   *
#  **********
#
        .balign    8,0x00
N_TFET:
        .quad      2
        .ASCII      "2@"
        .balign    8,0x00
TFET:
        .quad    TFET+HEADSIZE
        .quad    TFET+HEADSIZE
        .quad    0x0
        .quad    CFET
        .quad    N_TFET
        .quad    0
        .quad    0

        POP     %RBX      #ADDR
        MOV     %RAX,[%RBX] #MSW
        MOV     %RDX,[%RBX+(CW*(1))]        #LSW
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *********
#  *   !   *
#  *********
#
        .balign    8,0x00
N_STOR:
        .quad      1
        .ASCII      "!"
        .balign    8,0x00
STOR:
        .quad    STOR+HEADSIZE
        .quad    STOR+HEADSIZE
        .quad    0x0
        .quad    TFET
        .quad    N_STOR
        .quad    0
        .quad    0

        POP     %RBX      #ADDR
        POP     %RAX      #DATA
        MOV     [%RBX],%RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#


#  **********
#  *   L!   *
#  **********
#
        .balign    8,0x00
N_LSTOR:
        .quad      2
        .ASCII      "L!"
        .balign    8,0x00
LSTOR:
        .quad    LSTOR+HEADSIZE
        .quad    LSTOR+HEADSIZE
        .quad    0x0
        .quad    STOR
        .quad    N_LSTOR
        .quad    0
        .quad    0

        POP     %RBX      #ADDR
        POP     %RAX      #DATA
        MOV     [%RBX],%EAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#
#

#  **********
#  *   C!   *
#  **********
#
        .balign    8,0x00
N_CSTOR:
        .quad      2
        .ASCII      "C!"
        .balign    8,0x00
CSTOR:
        .quad    CSTOR+HEADSIZE
        .quad    CSTOR+HEADSIZE
        .quad    0x0
        .quad    LSTOR
        .quad    N_CSTOR
        .quad    0
        .quad    0

        POP     %RBX      #ADDR
        POP     %RAX      #DATA
        MOV     [%RBX],%AL
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   2!   *
#  **********
#
        .balign    8,0x00
N_TSTOR:
        .quad      2
        .ASCII      "2!"
        .balign    8,0x00
TSTOR:
        .quad    TSTOR+HEADSIZE
        .quad    TSTOR+HEADSIZE
        .quad    0x0
        .quad    CSTOR
        .quad    N_TSTOR
        .quad    0
        .quad    0

        POP     %RBX      #ADDR
        POP     %RAX      #MSW
        MOV     [%RBX],%RAX
        POP     %RAX      #LSW
        MOV     [%RBX+(CW*(1))],%RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **************
#  *   WITHIN   *
#  **************
#
        .balign    8,0x00
N_WITHIN:
        .quad      6
        .ASCII      "WITHIN"
        .balign    8,0x00
WITHIN:
        .quad    DOCOL
        .quad    WITHIN+HEADSIZE
        .quad    0x0
        .quad    TSTOR
        .quad    N_WITHIN
        .quad    0
        .quad    0

        .quad      OVER, LSUB, TOR
        .quad      LSUB, FROMR
        .quad      ULESS
        .quad      SEMIS
#
#
#

#  *********
#  *   :   *
#  *********
#
        .balign    8,0x00
N_COLON:
        .quad      1
        .ASCII      ":"
        .balign    8,0x00
COLON:
        .quad    DOCOL
        .quad    COLON+HEADSIZE
        .quad    0x0
        .quad    WITHIN
        .quad    N_COLON
        .quad    0
        .quad    0

        .quad      SCSP
        .quad      LNAME
        .quad      PCREAT
        .quad      LATEST, HIDDEN
        .quad      RBRAC
        .quad      PSCOD
DOCOL:  LEA     %RBP,[%RBP - (CW*(1))]  #Push HIP
        MOV     [%RBP],%RSI #R1 <- (IP)
         MOV     %RSI,[%RAX+(CW*(D_HOFFSET - C_HOFFSET))]  #(IP) <- (PFA)
#        CALL    DISPLAYSI
# 
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *********
#  *   ;   *
#  *********
#
        .balign    8,0x00
N_SEMI:
        .quad      1
        .ASCII      ";"
        .balign    8,0x00
SEMI:
        .quad    DOCOL
        .quad    SEMI+HEADSIZE
        .quad    B_IMMED
        .quad    COLON
        .quad    N_SEMI
        .quad    0
        .quad    0

        .quad      QCSP
        .quad      LIT, SEMIS, COMMA
        .quad      LATEST, HIDDEN
        .quad      LBRAC
        .quad      SEMIS
#

#  ****************
#  *   CONSTANT   *
#  ****************
#
        .balign    8,0x00
N_LCONST:
        .quad      8
        .ASCII      "CONSTANT"
        .balign    8,0x00
LCONST:
        .quad    DOCOL
        .quad    LCONST+HEADSIZE
        .quad    0x0
        .quad    SEMI
        .quad    N_LCONST
        .quad    0
        .quad    0

        .quad      LNAME
        .quad      PCREAT
        .quad      LATEST, TDFA, STOR
        .quad      PSCOD
DOCON:  MOV     %RAX,[%RAX+(CW*((D_HOFFSET)))] #GET DATA FROM PFA
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ****************
#  *   VARIABLE   *
#  ****************
#
        .balign    8,0x00
N_VAR:
        .quad      8
        .ASCII      "VARIABLE"
        .balign    8,0x00
VAR:
        .quad    DOCOL
        .quad    VAR+HEADSIZE
        .quad    0x0
        .quad    LCONST
        .quad    N_VAR
        .quad    0
        .quad    0

        .quad      LDATA
        .quad      ZERO, COMMA
        .quad      SEMIS
#

#  ************
#  *   DATA   *
#  ************
#
        .balign    8,0x00
N_LDATA:
        .quad      4
        .ASCII      "DATA"
        .balign    8,0x00
LDATA:
        .quad    DOCOL
        .quad    LDATA+HEADSIZE
        .quad    0x0
        .quad    VAR
        .quad    N_LDATA
        .quad    0
        .quad    0

        .quad      LNAME
        .quad      PCREAT
        .quad      PSCOD
DOVAR:  MOV     %RAX,[%RAX+(CW*((D_HOFFSET)))] #(AX) <- PFA
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ************
#  *   USER   *
#  ************
#
        .balign    8,0x00
N_USER:
        .quad      4
        .ASCII      "USER"
        .balign    8,0x00
USER:
        .quad    DOCOL
        .quad    USER+HEADSIZE
        .quad    0x0
        .quad    LDATA
        .quad    N_USER
        .quad    0
        .quad    0

        .quad      LCONST
        .quad      PSCOD
DOUSE:  MOV     %RBX,[%RAX+(CW*((D_HOFFSET)))] #PFA  
       MOV     %RAX, %RBP
        OR      %RAX, OFFSET STACKSIZE-1  #Requires it is power of 2.
        INC     %RAX
         ADD     %RAX,%RBX      #ADDR OF VARIABLE
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#
#

#  *********
#  *   _   *
#  *********
#
        .balign    8,0x00
N_X:
        .quad      1
        .ASCII      "_"
        .balign    8,0x00
X:
        .quad    X+HEADSIZE
        .quad    X+HEADSIZE
        .quad    0x0
        .quad    USER
        .quad    N_X
        .quad    0
        .quad    0

        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]    #Whatever happens to be in %RAX, i.e. the dea of ``_''.
#

#  *********
#  *   0   *
#  *********
#
        .balign    8,0x00
N_ZERO:
        .quad      1
        .ASCII      "0"
        .balign    8,0x00
ZERO:
        .quad    DOCON
        .quad    0
        .quad    0x0
        .quad    X
        .quad    N_ZERO
        .quad    0
        .quad    0

# The data field of 0 is used for an empty string.
#

#  *********
#  *   1   *
#  *********
#
        .balign    8,0x00
N_ONE:
        .quad      1
        .ASCII      "1"
        .balign    8,0x00
ONE:
        .quad    DOCON
        .quad    1
        .quad    0x0
        .quad    ZERO
        .quad    N_ONE
        .quad    0
        .quad    0

#

#  *********
#  *   2   *
#  *********
#
        .balign    8,0x00
N_TWO:
        .quad      1
        .ASCII      "2"
        .balign    8,0x00
TWO:
        .quad    DOCON
        .quad    2
        .quad    0x0
        .quad    ONE
        .quad    N_TWO
        .quad    0
        .quad    0

#

#  **********
#  *   BL   *
#  **********
#
        .balign    8,0x00
N_LBL:
        .quad      2
        .ASCII      "BL"
        .balign    8,0x00
LBL:
        .quad    DOCON
        .quad    ABL
        .quad    0x0
        .quad    TWO
        .quad    N_LBL
        .quad    0
        .quad    0

#

#
#  **********
#  *   $@   *
#  **********
#
        .balign    8,0x00
N_SFET:
        .quad      2
        .ASCII      "$@"
        .balign    8,0x00
SFET:
        .quad    SFET+HEADSIZE
        .quad    SFET+HEADSIZE
        .quad    0x0
        .quad    LBL
        .quad    N_SFET
        .quad    0
        .quad    0

        POP   %RBX
        MOV   %RAX,[%RBX]
        LEA   %RDX, [%RBX+(CW*(1))]
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   $!   *
#  **********
#
        .balign    8,0x00
N_SSTOR:
        .quad      2
        .ASCII      "$!"
        .balign    8,0x00
SSTOR:
        .quad    DOCOL
        .quad    SSTOR+HEADSIZE
        .quad    0x0
        .quad    SFET
        .quad    N_SSTOR
        .quad    0
        .quad    0

        .quad TDUP, STOR, CELLP, SWAP, LMOVE
        .quad SEMIS
#

# 

#  ***********
#  *   $+!   *
#  ***********
#
        .balign    8,0x00
N_SADD:
        .quad      3
        .ASCII      "$+!"
        .balign    8,0x00
SADD:
        .quad    DOCOL
        .quad    SADD+HEADSIZE
        .quad    0x0
        .quad    SSTOR
        .quad    N_SADD
        .quad    0
        .quad    0

        .quad   LDUP, FETCH, TOR # Remember old count.
        .quad   TDUP, PSTOR
        .quad   CELLP, FROMR, PLUS, SWAP, LMOVE
        .quad SEMIS
#

#  ***********
#  *   $C+   *
#  ***********
#
        .balign    8,0x00
N_CHAPP:
        .quad      3
        .ASCII      "$C+"
        .balign    8,0x00
CHAPP:
        .quad    DOCOL
        .quad    CHAPP+HEADSIZE
        .quad    0x0
        .quad    SADD
        .quad    N_CHAPP
        .quad    0
        .quad    0

        .quad   LDUP, TOR
        .quad   LDUP, FETCH, PLUS, CELLP, CSTOR
        .quad   ONE, FROMR, PSTOR
        .quad SEMIS
#

#  **********
#  *   $,   *
#  **********
#
        .balign    8,0x00
N_SCOMMA:
        .quad      2
        .ASCII      "$,"
        .balign    8,0x00
SCOMMA:
        .quad    DOCOL
        .quad    SCOMMA+HEADSIZE
        .quad    0x0
        .quad    CHAPP
        .quad    N_SCOMMA
        .quad    0
        .quad    0

        .quad HERE, TOR
        .quad LDUP, CELLP, ALLOT
        .quad RR, SSTOR, FROMR
 .quad LALIGN
        .quad SEMIS
#

#  ***********
#  *   C/L   *
#  ***********
#
        .balign    8,0x00
N_CSLL:
        .quad      3
        .ASCII      "C/L"
        .balign    8,0x00
CSLL:
        .quad    DOCON
        .quad    64
        .quad    0x0
        .quad    SCOMMA
        .quad    N_CSLL
        .quad    0
        .quad    0

#


#  **************
#  *   _FIRST   *
#  **************
#
        .balign    8,0x00
N__FIRST:
        .quad      6
        .ASCII      "_FIRST"
        .balign    8,0x00
_FIRST:
        .quad    DOCON
        .quad    BUF1
        .quad    0x0
        .quad    CSLL
        .quad    N__FIRST
        .quad    0
        .quad    0

 #  
#
# 
#

#  **************
#  *   _LIMIT   *
#  **************
#
        .balign    8,0x00
N__LIMIT:
        .quad      6
        .ASCII      "_LIMIT"
        .balign    8,0x00
_LIMIT:
        .quad    DOCON
        .quad    BUF1+(KBBUF+2*CW)*NBUF
        .quad    0x0
        .quad    _FIRST
        .quad    N__LIMIT
        .quad    0
        .quad    0

# THE END  OF THE MEMORY 

#  **********
#  *   EM   *
#  **********
#
        .balign    8,0x00
N_LEM:
        .quad      2
        .ASCII      "EM"
        .balign    8,0x00
LEM:
        .quad    DOCON
        .quad    ACTUAL_EM
        .quad    0x0
        .quad    _LIMIT
        .quad    N_LEM
        .quad    0
        .quad    0

#

#  **********
#  *   BM   *
#  **********
#
        .balign    8,0x00
N_LBM:
        .quad      2
        .ASCII      "BM"
        .balign    8,0x00
LBM:
        .quad    DOCON
        .quad    _ORIG
        .quad    0x0
        .quad    LEM
        .quad    N_LBM
        .quad    0
        .quad    0

#


#  *****************
#  *   TASK-SIZE   *
#  *****************
#
        .balign    8,0x00
N_LTAS:
        .quad      9
        .ASCII      "TASK-SIZE"
        .balign    8,0x00
LTAS:
        .quad    DOCON
        .quad    TAS
        .quad    0x0
        .quad    LBM
        .quad    N_LTAS
        .quad    0
        .quad    0

#
 
#  *************
#  *   B/BUF   *
#  *************
#
        .balign    8,0x00
N_BBUF:
        .quad      5
        .ASCII      "B/BUF"
        .balign    8,0x00
BBUF:
        .quad    DOCON
        .quad    KBBUF
        .quad    0x0
        .quad    LTAS
        .quad    N_BBUF
        .quad    0
        .quad    0

#
# All user variables are initialised 
# with the values from USINI.
# The implementation relies on the initialisation of 
# those with numbers (1..11), so change in concord with USINI.

#  **********
#  *   U0   *
#  **********
#
        .balign    8,0x00
N_UZERO:
        .quad      2
        .ASCII      "U0"
        .balign    8,0x00
UZERO:
        .quad    DOUSE
        .quad    (CW*(1))
        .quad    0x0
        .quad    BBUF
        .quad    N_UZERO
        .quad    0
        .quad    0

#

#  **********
#  *   S0   *
#  **********
#
        .balign    8,0x00
N_SZERO:
        .quad      2
        .ASCII      "S0"
        .balign    8,0x00
SZERO:
        .quad    DOUSE
        .quad    (CW*(2))
        .quad    0x0
        .quad    UZERO
        .quad    N_SZERO
        .quad    0
        .quad    0

#

#  **********
#  *   R0   *
#  **********
#
        .balign    8,0x00
N_RZERO:
        .quad      2
        .ASCII      "R0"
        .balign    8,0x00
RZERO:
        .quad    DOUSE
        .quad    (CW*(3))
        .quad    0x0
        .quad    SZERO
        .quad    N_RZERO
        .quad    0
        .quad    0

#

#  ***********
#  *   TIB   *
#  ***********
#
        .balign    8,0x00
N_TIB:
        .quad      3
        .ASCII      "TIB"
        .balign    8,0x00
TIB:
        .quad    DOUSE
        .quad    (CW*(4))
        .quad    0x0
        .quad    RZERO
        .quad    N_TIB
        .quad    0
        .quad    0

#

#  **************
#  *   RUBOUT   *
#  **************
#
        .balign    8,0x00
N_RUBOUT:
        .quad      6
        .ASCII      "RUBOUT"
        .balign    8,0x00
RUBOUT:
        .quad    DOUSE
        .quad    (CW*(5))
        .quad    0x0
        .quad    TIB
        .quad    N_RUBOUT
        .quad    0
        .quad    0

#

#  ***************
#  *   WARNING   *
#  ***************
#
        .balign    8,0x00
N_LWARN:
        .quad      7
        .ASCII      "WARNING"
        .balign    8,0x00
LWARN:
        .quad    DOUSE
        .quad    (CW*(7))
        .quad    0x0
        .quad    RUBOUT
        .quad    N_LWARN
        .quad    0
        .quad    0

#

#  *************
#  *   FENCE   *
#  *************
#
        .balign    8,0x00
N_FENCE:
        .quad      5
        .ASCII      "FENCE"
        .balign    8,0x00
FENCE:
        .quad    DOUSE
        .quad    (CW*(8))
        .quad    0x0
        .quad    LWARN
        .quad    N_FENCE
        .quad    0
        .quad    0

#

#  **********
#  *   DP   *
#  **********
#
        .balign    8,0x00
N_LDP:
        .quad      2
        .ASCII      "DP"
        .balign    8,0x00
LDP:
        .quad    DOUSE
        .quad    (CW*(9))
        .quad    0x0
        .quad    FENCE
        .quad    N_LDP
        .quad    0
        .quad    0

#

#  ****************
#  *   VOC-LINK   *
#  ****************
#
        .balign    8,0x00
N_VOCL:
        .quad      8
        .ASCII      "VOC-LINK"
        .balign    8,0x00
VOCL:
        .quad    DOUSE
        .quad    (CW*(10))
        .quad    0x0
        .quad    LDP
        .quad    N_VOCL
        .quad    0
        .quad    0

#

#  ****************
#  *   MAX-USER   *
#  ****************
#
        .balign    8,0x00
N_MAXUSER:
        .quad      8
        .ASCII      "MAX-USER"
        .balign    8,0x00
MAXUSER:
        .quad    DOUSE
        .quad    (CW*(11))
        .quad    0x0
        .quad    VOCL
        .quad    N_MAXUSER
        .quad    0
        .quad    0

#
#
#

#  *************
#  *   WHERE   *
#  *************
#
        .balign    8,0x00
N_LWHERE:
        .quad      5
        .ASCII      "WHERE"
        .balign    8,0x00
LWHERE:
        .quad    DOUSE
        .quad    (CW*(12))
        .quad    0x0
        .quad    MAXUSER
        .quad    N_LWHERE
        .quad    0
        .quad    0
    #  Occupies two CELLS! 
#

#  ***********
#  *   SCR   *
#  ***********
#
        .balign    8,0x00
N_SCR:
        .quad      3
        .ASCII      "SCR"
        .balign    8,0x00
SCR:
        .quad    DOUSE
        .quad    (CW*(33))
        .quad    0x0
        .quad    LWHERE
        .quad    N_SCR
        .quad    0
        .quad    0

#

#  *************
#  *   STATE   *
#  *************
#
        .balign    8,0x00
N_STATE:
        .quad      5
        .ASCII      "STATE"
        .balign    8,0x00
STATE:
        .quad    DOUSE
        .quad    (CW*(18))
        .quad    0x0
        .quad    SCR
        .quad    N_STATE
        .quad    0
        .quad    0

#

#  ************
#  *   BASE   *
#  ************
#
        .balign    8,0x00
N_BASE:
        .quad      4
        .ASCII      "BASE"
        .balign    8,0x00
BASE:
        .quad    DOUSE
        .quad    (CW*(19))
        .quad    0x0
        .quad    STATE
        .quad    N_BASE
        .quad    0
        .quad    0

#

#  ***********
#  *   DPL   *
#  ***********
#
        .balign    8,0x00
N_DPL:
        .quad      3
        .ASCII      "DPL"
        .balign    8,0x00
DPL:
        .quad    DOUSE
        .quad    (CW*(20))
        .quad    0x0
        .quad    BASE
        .quad    N_DPL
        .quad    0
        .quad    0

#

#  ***********
#  *   ECL   *
#  ***********
#
        .balign    8,0x00
N_ECL:
        .quad      3
        .ASCII      "ECL"
        .balign    8,0x00
ECL:
        .quad    DOUSE
        .quad    (CW*(38))
        .quad    0x0
        .quad    DPL
        .quad    N_ECL
        .quad    0
        .quad    0

#

#  ***********
#  *   FLD   *
#  ***********
#
        .balign    8,0x00
N_LFLD:
        .quad      3
        .ASCII      "FLD"
        .balign    8,0x00
LFLD:
        .quad    DOUSE
        .quad    (CW*(21))
        .quad    0x0
        .quad    ECL
        .quad    N_LFLD
        .quad    0
        .quad    0

#


#  ***********
#  *   CSP   *
#  ***********
#
        .balign    8,0x00
N_LCSP:
        .quad      3
        .ASCII      "CSP"
        .balign    8,0x00
LCSP:
        .quad    DOUSE
        .quad    (CW*(22))
        .quad    0x0
        .quad    LFLD
        .quad    N_LCSP
        .quad    0
        .quad    0

#
#

#  **********
#  *   R#   *
#  **********
#
        .balign    8,0x00
N_RNUM:
        .quad      2
        .ASCII      "R#"
        .balign    8,0x00
RNUM:
        .quad    DOUSE
        .quad    (CW*(23))
        .quad    0x0
        .quad    LCSP
        .quad    N_RNUM
        .quad    0
        .quad    0

#

#  ***********
#  *   HLD   *
#  ***********
#
        .balign    8,0x00
N_HLD:
        .quad      3
        .ASCII      "HLD"
        .balign    8,0x00
HLD:
        .quad    DOUSE
        .quad    (CW*(24))
        .quad    0x0
        .quad    RNUM
        .quad    N_HLD
        .quad    0
        .quad    0

#

#  ***********
#  *   OUT   *
#  ***********
#
        .balign    8,0x00
N_LOUT:
        .quad      3
        .ASCII      "OUT"
        .balign    8,0x00
LOUT:
        .quad    DOUSE
        .quad    (CW*(25))
        .quad    0x0
        .quad    HLD
        .quad    N_LOUT
        .quad    0
        .quad    0

#

#  *************
#  *   (BLK)   *
#  *************
#
        .balign    8,0x00
N_PBLK:
        .quad      5
        .ASCII      "(BLK)"
        .balign    8,0x00
PBLK:
        .quad    DOUSE
        .quad    (CW*(26))
        .quad    0x0
        .quad    LOUT
        .quad    N_PBLK
        .quad    0
        .quad    0

#

#  **********
#  *   PP   *
#  **********
#
        .balign    8,0x00
N_PP:
        .quad      2
        .ASCII      "PP"
        .balign    8,0x00
PP:
        .quad    DOUSE
        .quad    (CW*(29))
        .quad    0x0
        .quad    PBLK
        .quad    N_PP
        .quad    0
        .quad    0

#


#  *************
#  *   (>IN)   *
#  *************
#
        .balign    8,0x00
N_PIIN:
        .quad      5
        .ASCII      "(>IN)"
        .balign    8,0x00
PIIN:
        .quad    DOUSE
        .quad    (CW*(30))
        .quad    0x0
        .quad    PP
        .quad    N_PIIN
        .quad    0
        .quad    0

#
#

#  ************
#  *   ARGS   *
#  ************
#
        .balign    8,0x00
N_ARGS:
        .quad      4
        .ASCII      "ARGS"
        .balign    8,0x00
ARGS:
        .quad    DOUSE
        .quad    (CW*(31))
        .quad    0x0
        .quad    PIIN
        .quad    N_ARGS
        .quad    0
        .quad    0

#

#  ***************
#  *   HANDLER   *
#  ***************
#
        .balign    8,0x00
N_HANDLER:
        .quad      7
        .ASCII      "HANDLER"
        .balign    8,0x00
HANDLER:
        .quad    DOUSE
        .quad    (CW*(32))
        .quad    0x0
        .quad    ARGS
        .quad    N_HANDLER
        .quad    0
        .quad    0

#

#  ***************
#  *   CURRENT   *
#  ***************
#
        .balign    8,0x00
N_CURR:
        .quad      7
        .ASCII      "CURRENT"
        .balign    8,0x00
CURR:
        .quad    DOUSE
        .quad    (CW*(34))
        .quad    0x0
        .quad    HANDLER
        .quad    N_CURR
        .quad    0
        .quad    0

#

#  *****************
#  *   REMAINDER   *
#  *****************
#
        .balign    8,0x00
N_REMAIND:
        .quad      9
        .ASCII      "REMAINDER"
        .balign    8,0x00
REMAIND:
        .quad    DOUSE
        .quad    (CW*(14))
        .quad    0x0
        .quad    CURR
        .quad    N_REMAIND
        .quad    0
        .quad    0

#      IMPORTANT
# REQUIRES ONE MORE CELL!
#
#

#  **************
#  *   OFFSET   *
#  **************
#
        .balign    8,0x00
N_LOFFSET:
        .quad      6
        .ASCII      "OFFSET"
        .balign    8,0x00
LOFFSET:
        .quad    DOUSE
        .quad    (CW*(37))
        .quad    0x0
        .quad    REMAIND
        .quad    N_LOFFSET
        .quad    0
        .quad    0

#
#
#

#  ***************
#  *   CONTEXT   *
#  ***************
#
        .balign    8,0x00
N_CONTEXT:
        .quad      7
        .ASCII      "CONTEXT"
        .balign    8,0x00
CONTEXT:
        .quad    DOUSE
        .quad    (CW*(39))
        .quad    0x0
        .quad    LOFFSET
        .quad    N_CONTEXT
        .quad    0
        .quad    0
 # Up to  39+16
#      IMPORTANT
#     16 USER SPACE CELLS MUST BE KEPT FREE
#     IN ADDITION TO THE ONE FOR CONTEXT
#
#========== END USER VARIABLES =============
#

#  **********
#  *   1+   *
#  **********
#
        .balign    8,0x00
N_ONEP:
        .quad      2
        .ASCII      "1+"
        .balign    8,0x00
ONEP:
        .quad    DOCOL
        .quad    ONEP+HEADSIZE
        .quad    0x0
        .quad    CONTEXT
        .quad    N_ONEP
        .quad    0
        .quad    0

        .quad      ONE
        .quad      PLUS
        .quad      SEMIS
#

#  *************
#  *   CELL+   *
#  *************
#
        .balign    8,0x00
N_CELLP:
        .quad      5
        .ASCII      "CELL+"
        .balign    8,0x00
CELLP:
        .quad    DOCOL
        .quad    CELLP+HEADSIZE
        .quad    0x0
        .quad    ONEP
        .quad    N_CELLP
        .quad    0
        .quad    0

        .quad      LIT, CW
        .quad      PLUS
        .quad      SEMIS
#

#
#  *************
#  *   CELLS   *
#  *************
#
        .balign    8,0x00
N_LCELLS:
        .quad      5
        .ASCII      "CELLS"
        .balign    8,0x00
LCELLS:
        .quad    DOCOL
        .quad    LCELLS+HEADSIZE
        .quad    0x0
        .quad    CELLP
        .quad    N_LCELLS
        .quad    0
        .quad    0

        .quad        LIT, 3
        .quad      LSHIFT
        .quad      SEMIS
#

#  *************
#  *   CHAR+   *
#  *************
#
        .balign    8,0x00
N_CHARP:
        .quad      5
        .ASCII      "CHAR+"
        .balign    8,0x00
CHARP:
        .quad    DOCOL
        .quad    (ONEP+HEADSIZE)
        .quad    0x0
        .quad    LCELLS
        .quad    N_CHARP
        .quad    0
        .quad    0

#

#  *************
#  *   CHARS   *
#  *************
#
        .balign    8,0x00
N_CHARS:
        .quad      5
        .ASCII      "CHARS"
        .balign    8,0x00
CHARS:
        .quad    DOCOL 
        .quad    CHARS+HEADSIZE
        .quad    0x0
        .quad    CHARP
        .quad    N_CHARS
        .quad    0
        .quad    0

        .quad      SEMIS
#

#  *************
#  *   ALIGN   *
#  *************
#
        .balign    8,0x00
N_LALIGN:
        .quad      5
        .ASCII      "ALIGN"
        .balign    8,0x00
LALIGN:
        .quad    DOCOL 
        .quad    LALIGN+HEADSIZE
        .quad    0x0
        .quad    CHARS
        .quad    N_LALIGN
        .quad    0
        .quad    0


        .quad      LDP, FETCH
        .quad      ALIGNED
        .quad      LDP, STOR
#
        .quad      SEMIS
#

#  ***************
#  *   ALIGNED   *
#  ***************
#
        .balign    8,0x00
N_ALIGNED :
        .quad      7
        .ASCII      "ALIGNED"
        .balign    8,0x00
ALIGNED :
        .quad    ALIGNED +HEADSIZE
        .quad    ALIGNED +HEADSIZE
        .quad    0x0
        .quad    LALIGN
        .quad    N_ALIGNED 
        .quad    0
        .quad    0


        POP     %RAX
        DEC     %RAX
        OR      %RAX, OFFSET (CW*(1))-1
        INC     %RAX
        PUSH    %RAX
#
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ************
#  *   HERE   *
#  ************
#
        .balign    8,0x00
N_HERE:
        .quad      4
        .ASCII      "HERE"
        .balign    8,0x00
HERE:
        .quad    DOCOL
        .quad    HERE+HEADSIZE
        .quad    0x0
        .quad    ALIGNED 
        .quad    N_HERE
        .quad    0
        .quad    0

        .quad      LDP
        .quad      FETCH
        .quad      SEMIS
#

#  *************
#  *   ALLOT   *
#  *************
#
        .balign    8,0x00
N_ALLOT:
        .quad      5
        .ASCII      "ALLOT"
        .balign    8,0x00
ALLOT:
        .quad    DOCOL
        .quad    ALLOT+HEADSIZE
        .quad    0x0
        .quad    HERE
        .quad    N_ALLOT
        .quad    0
        .quad    0

        .quad      LDP
        .quad      PSTOR
        .quad      SEMIS
#

#  *********
#  *   ,   *
#  *********
#
        .balign    8,0x00
N_COMMA:
        .quad      1
        .ASCII      ","
        .balign    8,0x00
COMMA:
        .quad    DOCOL
        .quad    COMMA+HEADSIZE
        .quad    0x0
        .quad    ALLOT
        .quad    N_COMMA
        .quad    0
        .quad    0

        .quad      HERE
        .quad      LIT
        .quad      CW
        .quad      ALLOT
        .quad      STOR
        .quad      SEMIS
#

#  **********
#  *   C,   *
#  **********
#
        .balign    8,0x00
N_CCOMM:
        .quad      2
        .ASCII      "C,"
        .balign    8,0x00
CCOMM:
        .quad    DOCOL
        .quad    CCOMM+HEADSIZE
        .quad    0x0
        .quad    COMMA
        .quad    N_CCOMM
        .quad    0
        .quad    0

        .quad      HERE
        .quad      ONE
        .quad      ALLOT
        .quad      CSTOR
        .quad      SEMIS
#

#  **********
#  *   2,   *
#  **********
#
        .balign    8,0x00
N_TCOMM:
        .quad      2
        .ASCII      "2,"
        .balign    8,0x00
TCOMM:
        .quad    DOCOL
        .quad    TCOMM+HEADSIZE
        .quad    0x0
        .quad    CCOMM
        .quad    N_TCOMM
        .quad    0
        .quad    0

        .quad      HERE
        .quad      LIT
        .quad      CW*2
        .quad      ALLOT
        .quad      TSTOR
        .quad      SEMIS
#

#  *********
#  *   -   *
#  *********
#
        .balign    8,0x00
N_LSUB:
        .quad      1
        .ASCII      "-"
        .balign    8,0x00
LSUB:
        .quad    LSUB+HEADSIZE
        .quad    LSUB+HEADSIZE
        .quad    0x0
        .quad    TCOMM
        .quad    N_LSUB
        .quad    0
        .quad    0

        POP     %RDX      #S1
        POP     %RAX
        SUB     %RAX,%RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]      #S1 = S2 - S1
#

#  *********
#  *   =   *
#  *********
#
        .balign    8,0x00
N_EQUAL:
        .quad      1
        .ASCII      "="
        .balign    8,0x00
EQUAL:
        .quad    EQUAL+HEADSIZE
        .quad    EQUAL+HEADSIZE
        .quad    0x0
        .quad    LSUB
        .quad    N_EQUAL
        .quad    0
        .quad    0

         POP     %RAX
         POP     %RBX
         CMP     %RAX,%RBX
         SETZ    %AL
         MOVZX   %RAX,%AL
         NEG     %RAX
         PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *********
#  *   <   *
#  *********
#
        .balign    8,0x00
N_LESS:
        .quad      1
        .ASCII      "<"
        .balign    8,0x00
LESS:
        .quad    LESS+HEADSIZE
        .quad    LESS+HEADSIZE
        .quad    0x0
        .quad    EQUAL
        .quad    N_LESS
        .quad    0
        .quad    0

        POP     %RAX
        POP     %RBX
        CMP     %RBX,%RAX
        SETL    %AL
        MOVZX   %RAX,%AL
        NEG     %RAX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   U<   *
#  **********
#
        .balign    8,0x00
N_ULESS:
        .quad      2
        .ASCII      "U<"
        .balign    8,0x00
ULESS:
        .quad    ULESS+HEADSIZE
        .quad    ULESS+HEADSIZE
        .quad    0x0
        .quad    LESS
        .quad    N_ULESS
        .quad    0
        .quad    0

       POP     %RAX
               POP     %RDX
               SUB     %RDX,%RAX
               SBB     %RAX,%RAX
               PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *********
#  *   >   *
#  *********
#
        .balign    8,0x00
N_GREAT:
        .quad      1
        .ASCII      ">"
        .balign    8,0x00
GREAT:
        .quad    DOCOL
        .quad    GREAT+HEADSIZE
        .quad    0x0
        .quad    ULESS
        .quad    N_GREAT
        .quad    0
        .quad    0

        .quad      SWAP
        .quad      LESS
        .quad      SEMIS
#

#  **********
#  *   <>   *
#  **********
#
        .balign    8,0x00
N_UNEQ:
        .quad      2
        .ASCII      "<>"
        .balign    8,0x00
UNEQ:
        .quad    UNEQ+HEADSIZE
        .quad    UNEQ+HEADSIZE
        .quad    0x0
        .quad    GREAT
        .quad    N_UNEQ
        .quad    0
        .quad    0

         POP     %RAX
         POP     %RBX
         CMP     %RAX,%RBX
         SETNZ    %AL
         MOVZX   %RAX,%AL
         NEG     %RAX
         PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ***********
#  *   ROT   *
#  ***********
#
        .balign    8,0x00
N_ROT:
        .quad      3
        .ASCII      "ROT"
        .balign    8,0x00
ROT:
        .quad    ROT+HEADSIZE
        .quad    ROT+HEADSIZE
        .quad    0x0
        .quad    UNEQ
        .quad    N_ROT
        .quad    0
        .quad    0

        POP     %RDX      #S1
        POP     %RBX      #S2
        POP     %RAX      #S3
        PUSH    %RBX
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *************
#  *   SPACE   *
#  *************
#
        .balign    8,0x00
N_SPACE:
        .quad      5
        .ASCII      "SPACE"
        .balign    8,0x00
SPACE:
        .quad    DOCOL
        .quad    SPACE+HEADSIZE
        .quad    0x0
        .quad    ROT
        .quad    N_SPACE
        .quad    0
        .quad    0

        .quad      LBL
        .quad      EMIT
        .quad      SEMIS
#

#  ************
#  *   ?DUP   *
#  ************
#
        .balign    8,0x00
N_QDUP:
        .quad      4
        .ASCII      "?DUP"
        .balign    8,0x00
QDUP:
        .quad    DOCOL
        .quad    QDUP+HEADSIZE
        .quad    0x0
        .quad    SPACE
        .quad    N_QDUP
        .quad    0
        .quad    0

        .quad      LDUP
        .quad      ZBRAN
        .quad      QDUP1-.-CW # IF
        .quad      LDUP    #THEN
QDUP1:  .quad      SEMIS
#

#  **************
#  *   LATEST   *
#  **************
#
        .balign    8,0x00
N_LATEST:
        .quad      6
        .ASCII      "LATEST"
        .balign    8,0x00
LATEST:
        .quad    DOCOL
        .quad    LATEST+HEADSIZE
        .quad    0x0
        .quad    QDUP
        .quad    N_LATEST
        .quad    0
        .quad    0

        .quad      CURR
        .quad      FETCH
        .quad      TLFA
        .quad      FETCH
        .quad      SEMIS
#

#  ************
#  *   >CFA   *
#  ************
#
        .balign    8,0x00
N_TCFA:
        .quad      4
        .ASCII      ">CFA"
        .balign    8,0x00
TCFA:
        .quad    DOCOL
        .quad    TCFA+HEADSIZE
        .quad    0x0
        .quad    LATEST
        .quad    N_TCFA
        .quad    0
        .quad    0

        .quad      LIT, (CW*(C_HOFFSET))
        .quad      PLUS
        .quad      SEMIS
#

#  ************
#  *   >DFA   *
#  ************
#
        .balign    8,0x00
N_TDFA:
        .quad      4
        .ASCII      ">DFA"
        .balign    8,0x00
TDFA:
        .quad    DOCOL
        .quad    TDFA+HEADSIZE
        .quad    0x0
        .quad    TCFA
        .quad    N_TDFA
        .quad    0
        .quad    0

        .quad      LIT, (CW*(D_HOFFSET))
        .quad      PLUS
        .quad      SEMIS
#

#  ************
#  *   >FFA   *
#  ************
#
        .balign    8,0x00
N_TFFA:
        .quad      4
        .ASCII      ">FFA"
        .balign    8,0x00
TFFA:
        .quad    DOCOL
        .quad    TFFA+HEADSIZE
        .quad    0x0
        .quad    TDFA
        .quad    N_TFFA
        .quad    0
        .quad    0

        .quad      LIT, (CW*(F_HOFFSET))
        .quad      PLUS
        .quad      SEMIS
#

#  ************
#  *   >LFA   *
#  ************
#
        .balign    8,0x00
N_TLFA:
        .quad      4
        .ASCII      ">LFA"
        .balign    8,0x00
TLFA:
        .quad    DOCOL
        .quad    TLFA+HEADSIZE
        .quad    0x0
        .quad    TFFA
        .quad    N_TLFA
        .quad    0
        .quad    0

        .quad      LIT, (CW*(L_HOFFSET))
        .quad      PLUS
        .quad      SEMIS
#

#  ************
#  *   >NFA   *
#  ************
#
        .balign    8,0x00
N_TNFA:
        .quad      4
        .ASCII      ">NFA"
        .balign    8,0x00
TNFA:
        .quad    DOCOL
        .quad    TNFA+HEADSIZE
        .quad    0x0
        .quad    TLFA
        .quad    N_TNFA
        .quad    0
        .quad    0

        .quad      LIT,(CW*(N_HOFFSET))
        .quad      PLUS
        .quad      SEMIS
#


#
#  ************
#  *   >SFA   *
#  ************
#
        .balign    8,0x00
N_TSFA:
        .quad      4
        .ASCII      ">SFA"
        .balign    8,0x00
TSFA:
        .quad    DOCOL
        .quad    TSFA+HEADSIZE
        .quad    0x0
        .quad    TNFA
        .quad    N_TSFA
        .quad    0
        .quad    0

        .quad      LIT,(CW*(S_HOFFSET))
        .quad      PLUS
        .quad      SEMIS
#
#


#
#  ************
#  *   >XFA   *
#  ************
#
        .balign    8,0x00
N_TXFA:
        .quad      4
        .ASCII      ">XFA"
        .balign    8,0x00
TXFA:
        .quad    DOCOL
        .quad    TXFA+HEADSIZE
        .quad    0x0
        .quad    TSFA
        .quad    N_TXFA
        .quad    0
        .quad    0

        .quad      LIT,(CW*(X_HOFFSET))
        .quad      PLUS
        .quad      SEMIS
#
#

#  ************
#  *   >PHA   *
#  ************
#
        .balign    8,0x00
N_TPHA:
        .quad      4
        .ASCII      ">PHA"
        .balign    8,0x00
TPHA:
        .quad    DOCOL
        .quad    TPHA+HEADSIZE
        .quad    0x0
        .quad    TXFA
        .quad    N_TPHA
        .quad    0
        .quad    0

        .quad      LIT,(CW*(PH_OFFSET))
        .quad      PLUS
        .quad      SEMIS
#

#  *************
#  *   >BODY   *
#  *************
#
        .balign    8,0x00
N_TOBODY:
        .quad      5
        .ASCII      ">BODY"
        .balign    8,0x00
TOBODY:
        .quad    DOCOL
        .quad    TOBODY+HEADSIZE
        .quad    0x0
        .quad    TPHA
        .quad    N_TOBODY
        .quad    0
        .quad    0

        .quad      TDFA, FETCH
        .quad      CELLP           # Skip DOES> pointer.
        .quad      SEMIS
#

#  *************
#  *   BODY>   *
#  *************
#
        .balign    8,0x00
N_BODYF:
        .quad      5
        .ASCII      "BODY>"
        .balign    8,0x00
BODYF:
        .quad    DOCOL
        .quad    BODYF+HEADSIZE
        .quad    0x0
        .quad    TOBODY
        .quad    N_BODYF
        .quad    0
        .quad    0

        .quad      LIT,(CW*(BD_OFFSET))
        .quad      LSUB
        .quad      SEMIS
#

#  ************
#  *   >WID   *
#  ************
#
        .balign    8,0x00
N_TWID:
        .quad      4
        .ASCII      ">WID"
        .balign    8,0x00
TWID:
        .quad    DOCOL
        .quad    TWID+HEADSIZE
        .quad    0x0
        .quad    BODYF
        .quad    N_TWID
        .quad    0
        .quad    0

        .quad      TOBODY
        .quad      CELLP # Skip vfa link.
        .quad      SEMIS
#

#  ************
#  *   >VFA   *
#  ************
#
        .balign    8,0x00
N_TVFA:
        .quad      4
        .ASCII      ">VFA"
        .balign    8,0x00
TVFA:
        .quad    DOCOL
        .quad    TVFA+HEADSIZE
        .quad    0x0
        .quad    TWID
        .quad    N_TVFA
        .quad    0
        .quad    0

        .quad      TOBODY
        .quad      SEMIS
#


#  ************
#  *   !CSP   *
#  ************
#
        .balign    8,0x00
N_SCSP:
        .quad      4
        .ASCII      "!CSP"
        .balign    8,0x00
SCSP:
        .quad    DOCOL
        .quad    SCSP+HEADSIZE
        .quad    0x0
        .quad    TVFA
        .quad    N_SCSP
        .quad    0
        .quad    0

        .quad      SPFET
        .quad      LCSP
        .quad      STOR
        .quad      SEMIS
#
#

#  **************
#  *   ?ERROR   *
#  **************
#
        .balign    8,0x00
N_QERR:
        .quad      6
        .ASCII      "?ERROR"
        .balign    8,0x00
QERR:
        .quad    DOCOL
        .quad    QERR+HEADSIZE
        .quad    0x0
        .quad    SCSP
        .quad    N_QERR
        .quad    0
        .quad    0

        .quad      SWAP
        .quad      ZBRAN
        .quad      QERR1-.-CW #IF
        .quad      PP, FETCH
        .quad      SRC, FETCH
        .quad      LWHERE, TSTOR
        .quad      THROW
        .quad      BRAN
        .quad      QERR2-.-CW  #ELSE
QERR1:  .quad      DROP    #THEN
QERR2:  .quad      SEMIS
#

#  **************
#  *   ?ERRUR   *
#  **************
#
        .balign    8,0x00
N_QERRUR:
        .quad      6
        .ASCII      "?ERRUR"
        .balign    8,0x00
QERRUR:
        .quad    DOCOL
        .quad    QERRUR+HEADSIZE
        .quad    0x0
        .quad    QERR
        .quad    N_QERRUR
        .quad    0
        .quad    0

        .quad      ZERO, MIN, LDUP, QERR
        .quad      SEMIS
#


#  **************
#  *   ?DELIM   *
#  **************
#
        .balign    8,0x00
N_QDELIM:
        .quad      6
        .ASCII      "?DELIM"
        .balign    8,0x00
QDELIM:
        .quad    DOCOL
        .quad    QDELIM+HEADSIZE
        .quad    0x0
        .quad    QERRUR
        .quad    N_QDELIM
        .quad    0
        .quad    0

        .quad      PPFET
        .quad      QBL
        .quad      ZEQU
        .quad      LIT, 10, QERR
        .quad      DROP
        .quad      SEMIS
#

#  ************
#  *   ?CSP   *
#  ************
#
        .balign    8,0x00
N_QCSP:
        .quad      4
        .ASCII      "?CSP"
        .balign    8,0x00
QCSP:
        .quad    DOCOL
        .quad    QCSP+HEADSIZE
        .quad    0x0
        .quad    QDELIM
        .quad    N_QCSP
        .quad    0
        .quad    0

        .quad      SPFET
        .quad      LCSP
        .quad      FETCH
        .quad      LSUB
        .quad      LIT, 20, QERR
        .quad      SEMIS
#

#  *************
#  *   ?COMP   *
#  *************
#
        .balign    8,0x00
N_QCOMP:
        .quad      5
        .ASCII      "?COMP"
        .balign    8,0x00
QCOMP:
        .quad    DOCOL
        .quad    QCOMP+HEADSIZE
        .quad    0x0
        .quad    QCSP
        .quad    N_QCOMP
        .quad    0
        .quad    0

        .quad      STATE
        .quad      FETCH
        .quad      ZEQU
        .quad      LIT, 17, QERR
        .quad      SEMIS
#

# 

#  **************
#  *   ?PAIRS   *
#  **************
#
        .balign    8,0x00
N_QPAIR:
        .quad      6
        .ASCII      "?PAIRS"
        .balign    8,0x00
QPAIR:
        .quad    DOCOL
        .quad    QPAIR+HEADSIZE
        .quad    0x0
        .quad    QCOMP
        .quad    N_QPAIR
        .quad    0
        .quad    0

        .quad      LSUB
        .quad      LIT, 19, QERR
        .quad      SEMIS
#


# 
#
#
#
#

#  *********
#  *   [   *
#  *********
#
        .balign    8,0x00
N_LBRAC:
        .quad      1
        .ASCII      "["
        .balign    8,0x00
LBRAC:
        .quad    DOCOL
        .quad    LBRAC+HEADSIZE
        .quad    B_IMMED
        .quad    QPAIR
        .quad    N_LBRAC
        .quad    0
        .quad    0

        .quad      ZERO
        .quad      STATE
        .quad      STOR
        .quad      SEMIS
#

#  *********
#  *   ]   *
#  *********
#
        .balign    8,0x00
N_RBRAC:
        .quad      1
        .ASCII      "]"
        .balign    8,0x00
RBRAC:
        .quad    DOCOL
        .quad    RBRAC+HEADSIZE
        .quad    0x0
        .quad    LBRAC
        .quad    N_RBRAC
        .quad    0
        .quad    0

        .quad      ONE
        .quad      STATE
        .quad      STOR
        .quad      SEMIS
#

#  **************
#  *   HIDDEN   *
#  **************
#
        .balign    8,0x00
N_HIDDEN:
        .quad      6
        .ASCII      "HIDDEN"
        .balign    8,0x00
HIDDEN:
        .quad    DOCOL
        .quad    HIDDEN+HEADSIZE
        .quad    0x0
        .quad    RBRAC
        .quad    N_HIDDEN
        .quad    0
        .quad    0

        .quad      TFFA
        .quad      LIT,B_INVIS
        .quad      TOGGL
        .quad      SEMIS
#

#  ***********
#  *   HEX   *
#  ***********
#
        .balign    8,0x00
N_HEX:
        .quad      3
        .ASCII      "HEX"
        .balign    8,0x00
HEX:
        .quad    DOCOL
        .quad    HEX+HEADSIZE
        .quad    0x0
        .quad    HIDDEN
        .quad    N_HEX
        .quad    0
        .quad    0

        .quad      LIT,16
        .quad      BASE
        .quad      STOR
        .quad      SEMIS
#

#  ***************
#  *   DECIMAL   *
#  ***************
#
        .balign    8,0x00
N_DECA:
        .quad      7
        .ASCII      "DECIMAL"
        .balign    8,0x00
DECA:
        .quad    DOCOL
        .quad    DECA+HEADSIZE
        .quad    0x0
        .quad    HEX
        .quad    N_DECA
        .quad    0
        .quad    0

        .quad      LIT,10
        .quad      BASE
        .quad      STOR
        .quad      SEMIS
#

#  ***************
#  *   (;CODE)   *
#  ***************
#
        .balign    8,0x00
N_PSCOD:
        .quad      7
        .ASCII      "(;CODE)"
        .balign    8,0x00
PSCOD:
        .quad    DOCOL
        .quad    PSCOD+HEADSIZE
        .quad    0x0
        .quad    DECA
        .quad    N_PSCOD
        .quad    0
        .quad    0

        .quad      FROMR
        .quad      LATEST
        .quad      TCFA
        .quad      STOR
        .quad      SEMIS
#
# 

#  **************
#  *   CREATE   *
#  **************
#
        .balign    8,0x00
N_LCREATE:
        .quad      6
        .ASCII      "CREATE"
        .balign    8,0x00
LCREATE:
        .quad    DOCOL
        .quad    LCREATE+HEADSIZE
        .quad    0x0
        .quad    PSCOD
        .quad    N_LCREATE
        .quad    0
        .quad    0

        .quad      LNAME
        .quad      PCREAT
        .quad      LIT, HLNOOP, COMMA
        .quad      PSCOD
DODOE:  LEA     %RBP,[%RBP - (CW*(1))] #Push HIP.
        MOV     [%RBP],%RSI
        MOV     %RSI,[%RAX+(CW*((D_HOFFSET)))] #NEW IP 
        LEA     %RAX,[%RSI+(CW*(1))]
        MOV     %RSI,[%RSI]
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
        .quad      0       # In behalf of FIND-HEAD in decompilation
HLNOOP: .quad      SEMIS
#

#  *************
#  *   DOES>   *
#  *************
#
        .balign    8,0x00
N_DOES:
        .quad      5
        .ASCII      "DOES>"
        .balign    8,0x00
DOES:
        .quad    DOCOL
        .quad    DOES+HEADSIZE
        .quad    0x0
        .quad    LCREATE
        .quad    N_DOES
        .quad    0
        .quad    0

        .quad      FROMR
        .quad      LATEST
        .quad      TDFA
        .quad      FETCH
        .quad      STOR
        .quad      SEMIS
#

#  *************
#  *   COUNT   *
#  *************
#
        .balign    8,0x00
N_COUNT:
        .quad      5
        .ASCII      "COUNT"
        .balign    8,0x00
COUNT:
        .quad    DOCOL
        .quad    COUNT+HEADSIZE
        .quad    0x0
        .quad    DOES
        .quad    N_COUNT
        .quad    0
        .quad    0

        .quad      LDUP
        .quad      ONEP
        .quad      SWAP
        .quad      CFET
        .quad      SEMIS
#

#  *****************
#  *   -TRAILING   *
#  *****************
#
        .balign    8,0x00
N_DTRAI:
        .quad      9
        .ASCII      "-TRAILING"
        .balign    8,0x00
DTRAI:
        .quad    DOCOL
        .quad    DTRAI+HEADSIZE
        .quad    0x0
        .quad    COUNT
        .quad    N_DTRAI
        .quad    0
        .quad    0

        .quad      LDUP
        .quad      ZERO
        .quad     XQDO
        .quad      DTRA4-.-CW
DTRA1:  .quad      OVER
        .quad      OVER
        .quad      PLUS
        .quad      ONE
        .quad      LSUB
        .quad      CFET
        .quad      QBL
        .quad      ZEQU
        .quad      ZBRAN
        .quad      DTRA2-.-CW #IF
        .quad      LLEAV
DTRA2:  .quad      ONE
        .quad      LSUB    # THEN
        .quad     ONE, XPLOOP, ZBRAN
        .quad      DTRA1-.-CW
        .quad      UNLOOP     # LOOP
DTRA4:
        .quad      SEMIS
#


#  **********
#  *   S"   *
#  **********
#
        .balign    8,0x00
N_SQUOT:
        .quad      2
        .ASCII      "S\""
        .balign    8,0x00
SQUOT:
        .quad    DOCOL
        .quad    SQUOT+HEADSIZE
        .quad    B_IMMED
        .quad    DTRAI
        .quad    N_SQUOT
        .quad    0
        .quad    0

        .quad      DENQ
        .quad      SEMIS
#
#

#  **********
#  *   ."   *
#  **********
#
        .balign    8,0x00
N_DOTQ:
        .quad      2
        .ASCII      ".\""
        .balign    8,0x00
DOTQ:
        .quad    DOCOL
        .quad    DOTQ+HEADSIZE
        .quad    B_IMMED
        .quad    SQUOT
        .quad    N_DOTQ
        .quad    0
        .quad    0

        .quad      DENQ
        .quad      STATE
        .quad      FETCH
        .quad      ZBRAN
        .quad      DOTQ1-.-CW # IF
        .quad      LIT, LTYPE, COMMA
        .quad      BRAN
        .quad      DOTQ2-.-CW
DOTQ1:
        .quad      LTYPE
DOTQ2:
        .quad      SEMIS   # THEN
#

#  **********
#  *   .(   *
#  **********
#
        .balign    8,0x00
N_DOTP:
        .quad      2
        .ASCII      ".("
        .balign    8,0x00
DOTP:
        .quad    DOCOL
        .quad    DOTP+HEADSIZE
        .quad    B_IMMED
        .quad    DOTQ
        .quad    N_DOTP
        .quad    0
        .quad    0

        .quad      LIT, ')'
        .quad      PARSE
        .quad      LTYPE
        .quad      SEMIS
#

#  ***************
#  *   SET-SRC   *
#  ***************
#
        .balign    8,0x00
N_SETSRC:
        .quad      7
        .ASCII      "SET-SRC"
        .balign    8,0x00
SETSRC:
        .quad    DOCOL
        .quad    SETSRC+HEADSIZE
        .quad    0x0
        .quad    DOTP
        .quad    N_SETSRC
        .quad    0
        .quad    0

        .quad      OVER, PLUS
        .quad      OVER, SRC, TSTOR
        .quad      PP, STOR #  IN

#       DC      DOTS
        .quad      SEMIS
#

#  ****************
#  *   EVALUATE   *
#  ****************
#
        .balign    8,0x00
N_EVALUATE:
        .quad      8
        .ASCII      "EVALUATE"
        .balign    8,0x00
EVALUATE:
        .quad    DOCOL
        .quad    EVALUATE+HEADSIZE
        .quad    0x0
        .quad    SETSRC
        .quad    N_EVALUATE
        .quad    0
        .quad    0

        .quad      SAVE
        .quad      SETSRC
        .quad      LIT, INTER, CATCH
        .quad      RESTO
        .quad      THROW
        .quad      SEMIS
#

#  ************
#  *   FILL   *
#  ************
#
        .balign    8,0x00
N_FILL:
        .quad      4
        .ASCII      "FILL"
        .balign    8,0x00
FILL:
        .quad    FILL+HEADSIZE
        .quad    FILL+HEADSIZE
        .quad    0x0
        .quad    EVALUATE
        .quad    N_FILL
        .quad    0
        .quad    0

#       Assume the extra segment points to the data segment 
        POP     %RAX      # FILL CHAR
        POP     %RCX      # FILL COUNT
        POP     %RDI      # BEGIN ADDR
        CLD             # INC DIRECTION
        REP     STOSB   #STORE BYTE
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ************
#  *   CORA   *
#  ************
#
        .balign    8,0x00
N_CORA:
        .quad      4
        .ASCII      "CORA"
        .balign    8,0x00
CORA:
        .quad    CORA+HEADSIZE
        .quad    CORA+HEADSIZE
        .quad    0x0
        .quad    FILL
        .quad    N_CORA
        .quad    0
        .quad    0

#       Assume the extra segment points to the data segment 
        MOV     %RDX,%RSI   #SAVE
        XOR     %RAX,%RAX   # Result
        POP     %RCX      # count
        POP     %RDI      # addr2
        POP     %RSI      # addr1
        CLD             # INC DIRECTION
        REPZ    CMPSB   # Compare BYTE
        JZ      CORA3
        MOV     %AL,1    #Remainder is already 0
        JNC     CORA3
        NEG     %RAX
CORA3:
        MOV     %RSI,%RDX  #Restore
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   $^   *
#  **********
#
        .balign    8,0x00
N_SINDEX:
        .quad      2
        .ASCII      "$^"
        .balign    8,0x00
SINDEX:
        .quad    SINDEX+HEADSIZE
        .quad    SINDEX+HEADSIZE
        .quad    0x0
        .quad    CORA
        .quad    N_SINDEX
        .quad    0
        .quad    0

#       Assume the extra segment points to the data segment 
        POP     %RAX      # char
        POP     %RCX      # count
        POP     %RDI      # addr
        OR      %RSI,%RSI   #Clear zero flag.
        CLD             # INC DIRECTION
        REPNZ     SCASB   # Compare BYTE
        JZ      SINDEX1
        XOR     %RDI,%RDI    #Not found: 0
        INC     %RDI
SINDEX1:
        DEC     %RDI
        PUSH    %RDI
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   $/   *
#  **********
#
        .balign    8,0x00
N_SSLAS:
        .quad      2
        .ASCII      "$/"
        .balign    8,0x00
SSLAS:
        .quad    SSLAS+HEADSIZE
        .quad    SSLAS+HEADSIZE
        .quad    0x0
        .quad    SINDEX
        .quad    N_SSLAS
        .quad    0
        .quad    0

#       Assume the extra segment points to the data segment 
        POP     %RAX      # char
        POP     %RCX      # count
        MOV     %RBX,%RCX
        POP     %RDI      # addr
        OR      %RDI,%RDI   #Clear zero flag.
        MOV     %RDX,%RDI   # Copy
        CLD             # INC DIRECTION
        REPNZ     SCASB   # Compare BYTE
        JZ      SSLAS1
# Not present.
        PUSH    %RCX   # Nil pointer.
        JMP SHORT SSLAS2
SSLAS1:
        PUSH    %RDI
        SUB     %RBX,%RCX
        DEC     %RBX      #Delimiter is not part of first string.
SSLAS2:
        PUSH    %RCX   #Remaining length
        PUSH    %RDX   #Start of first string.
        PUSH    %RBX   #Skipped length.
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   $\   *
#  **********
#
        .balign    8,0x00
N_BSLAS:
        .quad      2
        .ASCII      "$\\"
        .balign    8,0x00
BSLAS:
        .quad    BSLAS+HEADSIZE
        .quad    BSLAS+HEADSIZE
        .quad    0x0
        .quad    SSLAS
        .quad    N_BSLAS
        .quad    0
        .quad    0

#       Assume the extra segment points to the data segment 
        POP     %RAX      # char
        POP     %RCX      # count
        MOV     %RBX,%RCX
        POP     %RDI      # addr
        MOV     %RDX,%RDI   # Copy
        ADD     %RDI,%RCX
        DEC     %RDI      #Last char & clear zero flag.
        STD    # DEC DIRECTION
        REPNZ     SCASB   # Compare BYTE
        JZ      BSLAS1
# Not present.
        PUSH    %RCX   # Nil pointer.
        INC     %RDI   #Start of end string
        JMP SHORT BSLAS2
BSLAS1:
        PUSH    %RDX   #Start of start string.
        INC     %RDI
        INC     %RDI   #Start of end string
        SUB     %RBX,%RCX
        DEC     %RBX      #Delimiter is not part of ending string.
BSLAS2:
        PUSH    %RCX   #Remaining length
        PUSH    %RDI
        PUSH    %RBX
        CLD
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *************
#  *   ERASE   *
#  *************
#
        .balign    8,0x00
N_LERASE:
        .quad      5
        .ASCII      "ERASE"
        .balign    8,0x00
LERASE:
        .quad    DOCOL
        .quad    LERASE+HEADSIZE
        .quad    0x0
        .quad    BSLAS
        .quad    N_LERASE
        .quad    0
        .quad    0

        .quad      ZERO
        .quad      FILL
        .quad      SEMIS
#


#  *************
#  *   BLANK   *
#  *************
#
        .balign    8,0x00
N_BLANK:
        .quad      5
        .ASCII      "BLANK"
        .balign    8,0x00
BLANK:
        .quad    DOCOL
        .quad    BLANK+HEADSIZE
        .quad    0x0
        .quad    LERASE
        .quad    N_BLANK
        .quad    0
        .quad    0

        .quad      LBL
        .quad      FILL
        .quad      SEMIS
#
#

#  ************
#  *   HOLD   *
#  ************
#
        .balign    8,0x00
N_HOLD:
        .quad      4
        .ASCII      "HOLD"
        .balign    8,0x00
HOLD:
        .quad    DOCOL
        .quad    HOLD+HEADSIZE
        .quad    0x0
        .quad    BLANK
        .quad    N_HOLD
        .quad    0
        .quad    0

        .quad      LIT,-1
        .quad      HLD
        .quad      PSTOR
        .quad      HLD
        .quad      FETCH
        .quad      CSTOR
        .quad      SEMIS
#

#  ***********
#  *   PAD   *
#  ***********
#
        .balign    8,0x00
N_PAD:
        .quad      3
        .ASCII      "PAD"
        .balign    8,0x00
PAD:
        .quad    DOCOL
        .quad    PAD+HEADSIZE
        .quad    0x0
        .quad    HOLD
        .quad    N_PAD
        .quad    0
        .quad    0

        .quad      HERE
# Allow for a one line name, a double binary number and some hold char's
        .quad      LIT,84+128+64
        .quad      PLUS
        .quad      SEMIS
#


# 
#
#

#  ************
#  *   CHAR   *
#  ************
#
        .balign    8,0x00
N_LCHAR:
        .quad      4
        .ASCII      "CHAR"
        .balign    8,0x00
LCHAR:
        .quad    DOCOL
        .quad    LCHAR+HEADSIZE
        .quad    0x0
        .quad    PAD
        .quad    N_LCHAR
        .quad    0
        .quad    0

        .quad      LNAME, DROP, CFET
        .quad      SEMIS
#

#  **************
#  *   [CHAR]   *
#  **************
#
        .balign    8,0x00
N_BCHAR:
        .quad      6
        .ASCII      "[CHAR]"
        .balign    8,0x00
BCHAR:
        .quad    DOCOL
        .quad    BCHAR+HEADSIZE
        .quad    B_IMMED
        .quad    LCHAR
        .quad    N_BCHAR
        .quad    0
        .quad    0

        .quad      LCHAR, LITER
        .quad      SEMIS
#

#  ****************
#  *   (NUMBER)   *
#  ****************
#
        .balign    8,0x00
N_PNUMB:
        .quad      8
        .ASCII      "(NUMBER)"
        .balign    8,0x00
PNUMB:
        .quad    DOCOL
        .quad    PNUMB+HEADSIZE
        .quad    0x0
        .quad    BCHAR
        .quad    N_PNUMB
        .quad    0
        .quad    0

        .quad      ZERO, ZERO
        .quad      ZERO, DPL, STOR
NPNUM1:  .quad      PPFET   # BEGIN
        .quad      LDUP, LIT, ADOT, EQUAL
        .quad      ZBRAN
        .quad      NPNUM2-.-CW # case 1 
        .quad      DROP, DPL, STOR
        .quad      BRAN
        .quad      NPNUM1-.-CW # continue 
NPNUM2:
        .quad      LDUP, LIT, ',', EQUAL
        .quad      ZBRAN
        .quad      NPNUM3-.-CW # case 2 
        .quad      TDROP
        .quad      BRAN
        .quad      NPNUM1-.-CW # continue 
NPNUM3:
        .quad      LDUP, QBL, ZEQU
        .quad      ZBRAN
        .quad      NPNUM5-.-CW  # while 
        .quad      NIP
        .quad      BASE, FETCH, DIGIT
        .quad      ZEQU
        .quad      LIT, 10, QERR

        .quad      SWAP
        .quad      BASE
        .quad      FETCH
        .quad      USTAR
        .quad      DROP
        .quad      ROT
        .quad      BASE
        .quad      FETCH
        .quad      USTAR
        .quad      DPLUS
        .quad      BRAN
        .quad      NPNUM1-.-CW # repeat 
NPNUM5:
        .quad      DROP, PP, STOR
        .quad      SEMIS
#

#  **************
#  *   NUMBER   *
#  **************
#
        .balign    8,0x00
N_NUMB:
        .quad      6
        .ASCII      "NUMBER"
        .balign    8,0x00
NUMB:
        .quad    DOCOL
        .quad    NUMB+HEADSIZE
        .quad    0x0
        .quad    PNUMB
        .quad    N_NUMB
        .quad    0
        .quad    0

LNUMB:
        .quad      LIT, -1, PP, PSTOR
        .quad      PNUMB, SDLITE
        .quad      SEMIS
#


#  ***************
#  *   >NUMBER   *
#  ***************
#
        .balign    8,0x00
N_TONUMB:
        .quad      7
        .ASCII      ">NUMBER"
        .balign    8,0x00
TONUMB:
        .quad    DOCOL
        .quad    TONUMB+HEADSIZE
        .quad    0x0
        .quad    NUMB
        .quad    N_TONUMB
        .quad    0
        .quad    0

        .quad      TDUP, PLUS, TOR     # End available on return stack.
        .quad      ZERO
        .quad     XQDO
        .quad      TONUM9-.-CW
TONUM1:
        .quad      LDUP, CFET, BASE, FETCH, DIGIT
        .quad      ZEQU
        .quad      ZBRAN
        .quad      TONUM4-.-CW # IF
        .quad      DROP
        .quad      LLEAV
TONUM4:
        .quad      SWAP, TOR # Address out of the way.
        .quad      SWAP
        .quad      BASE
        .quad      FETCH
        .quad      USTAR
        .quad      DROP
        .quad      ROT
        .quad      BASE
        .quad      FETCH
        .quad      USTAR
        .quad      DPLUS
        .quad      FROMR, ONEP     # Address back.
        .quad     ONE, XPLOOP, ZBRAN
        .quad      TONUM1-.-CW
        .quad      UNLOOP 
TONUM9:
        .quad      FROMR
        .quad      OVER, LSUB
        .quad      SEMIS
#
#

#  *************
#  *   FOUND   *
#  *************
#
        .balign    8,0x00
N_FOUND:
        .quad      5
        .ASCII      "FOUND"
        .balign    8,0x00
FOUND:
        .quad    DOCOL
        .quad    FOUND+HEADSIZE
        .quad    0x0
        .quad    TONUMB
        .quad    N_FOUND
        .quad    0
        .quad    0

        .quad      CONTEXT, TOR
FOUND1: .quad      RR, FETCH
#        DC      DOTS
        .quad      PFIND, LDUP, ZEQU
        .quad      ZBRAN
        .quad      FOUND3-.-CW
        .quad      DROP
        .quad      RR, FETCH, LIT, ONLYBODY, LSUB #Was this ONLY?
        .quad      ZBRAN
        .quad      FOUND2-.-CW
        .quad      FROMR, CELLP, TOR
        .quad      BRAN
        .quad      FOUND1-.-CW
FOUND2: .quad      ZERO
FOUND3: .quad      RDROP
        .quad      NIP,NIP
        .quad      SEMIS
#

#  ***************
#  *   PRESENT   *
#  ***************
#
        .balign    8,0x00
N_PRESENT:
        .quad      7
        .ASCII      "PRESENT"
        .balign    8,0x00
PRESENT:
        .quad    DOCOL
        .quad    PRESENT+HEADSIZE
        .quad    0x0
        .quad    FOUND
        .quad    N_PRESENT
        .quad    0
        .quad    0

        .quad      LDUP, TOR
        .quad      FOUND
        .quad      LDUP
        .quad      ZBRAN
        .quad      PRES1-.-CW
        .quad      LDUP
        .quad      TNFA, FETCH, FETCH #  Get precise length.
        .quad      RR, EQUAL
        .quad      LAND
PRES1:
        .quad      RDROP
        .quad      SEMIS
#


# 
#


#  ***********
#  *   OPT   *
#  ***********
#
        .balign    8,0x00
N_OPT:
        .quad      3
        .ASCII      "OPT"
        .balign    8,0x00
OPT:
        .quad    DOCOL
        .quad    OPT+HEADSIZE
        .quad    0x0
        .quad    PRESENT
        .quad    N_OPT
        .quad    0
        .quad    0

        .quad      SEMIS

#

#  **************
#  *   (FIND)   *
#  **************
#
        .balign    8,0x00
N_PFIND:
        .quad      6
        .ASCII      "(FIND)"
        .balign    8,0x00
PFIND:
        .quad    DOCOL
        .quad    PFIND+HEADSIZE
        .quad    0x0
        .quad    OPT
        .quad    N_PFIND
        .quad    0
        .quad    0

# The idea is to have a fast slim loop.
# The optimisation tries to skip, using the extra links.
# At all labels the stack is (sc, dea).
# PFIND0 : nothing known yet about dea
# PFCONTINUE : dea is disapproved, go on
# PFEXIT : dea is the match, or null.

PFIND0:                       #Start of loop.
        .quad      NMATCH
        .quad      ZEQU
        .quad      ZBRAN
        .quad      PFCONTINUE-.-CW
# ~MATCH is sure in determining a no-match,
# a possible match must be investigated closely.
#
# dea's name and sc have equal length
        .quad      TDUP, TNFA, FETCH, FETCH
        .quad      EQUAL
# dea is a prefix 
        .quad      OVER, TFFA, FETCH
        .quad      LIT, B_DENOT, LAND
        .quad      LOR             # One of those must apply.
        .quad      ZBRAN
        .quad      PFCONTINUE-.-CW

# Discard still, if invisible ("smudged") or dummy.
        .quad      LDUP, TFFA, FETCH
        .quad      LIT, B_INVIS | B_DUMMY, LAND
        .quad      ZEQU
        .quad      ZBRAN
        .quad      PFCONTINUE-.-CW
        .quad      BRAN
        .quad      PFEXIT-.-CW         # Match! 
PFCONTINUE:
        .quad      TLFA, FETCH
        .quad      LDUP, ZEQU
        .quad      ZBRAN
        .quad      PFIND0-.-CW      #End of loop.
# Fall through leaves zero, as required.

PFEXIT:
        .quad      SEMIS
#

#  *************
#  *   ERROR   *
#  *************
#
        .balign    8,0x00
N_LERROR:
        .quad      5
        .ASCII      "ERROR"
        .balign    8,0x00
LERROR:
        .quad    DOCOL
        .quad    LERROR+HEADSIZE
        .quad    0x0
        .quad    PFIND
        .quad    N_LERROR
        .quad    0
        .quad    0

# Make sure the whole word is shown in case of denotations. 
        .quad      LWHERE, TFET
        .quad      OVER
        .quad      ZBRAN
        .quad      ERR2-.-CW      # Virgin: print empty string.
        .quad      OVER, LIT, 20, LSUB
        .quad      MAX
        .quad      SWAP
        .quad      ONEM         #Backup for if we are at next word.
ERR1:   .quad      LDUP, CFET, QBL, ZEQU  #Show whole word!
        .quad      ZBRAN
        .quad      ERR2 -.-CW
        .quad      ONEP
        .quad      BRAN
        .quad      ERR1 -.-CW
ERR2:
        .quad      OVER, LSUB
        .quad      ETYPE
        .quad      SKIP
         .quad      19
SB3: .ASCII      " ? ciforth ERROR # "
       .balign    8,0x00
        .quad      LIT, SB3
        .quad      LIT, 19
        .quad      ETYPE
        .quad      BASE, FETCH
        .quad      DECA
        .quad      OVER
        .quad      STOD, ZERO, PDDOTR      #This is about (.) 
        .quad      ETYPE
        .quad      BASE, STOR
        .quad      LIT, -256, MAX
        .quad      LIT, 63, MIN
        .quad      LIT, MESS, CATCH, DROP  #Prevent error loops 
        .quad      SEMIS
#

#  *************
#  *   CATCH   *
#  *************
#
        .balign    8,0x00
N_CATCH:
        .quad      5
        .ASCII      "CATCH"
        .balign    8,0x00
CATCH:
        .quad    DOCOL
        .quad    CATCH+HEADSIZE
        .quad    0x0
        .quad    LERROR
        .quad    N_CATCH
        .quad    0
        .quad    0

        .quad      SPFET, CELLP, TOR
        .quad      HANDLER, FETCH, TOR
        .quad      RPFET, HANDLER, STOR
        .quad      EXEC
        .quad      FROMR, HANDLER, STOR
        .quad      RDROP, ZERO
        .quad      SEMIS
#

#  *************
#  *   THROW   *
#  *************
#
        .balign    8,0x00
N_THROW:
        .quad      5
        .ASCII      "THROW"
        .balign    8,0x00
THROW:
        .quad    DOCOL
        .quad    THROW+HEADSIZE
        .quad    0x0
        .quad    CATCH
        .quad    N_THROW
        .quad    0
        .quad    0

        .quad      LDUP
        .quad      ZBRAN
        .quad      THROW1-.-CW
        .quad      HANDLER, FETCH, ZEQU
        .quad      ZBRAN
        .quad      THROW2-.-CW
        .quad      LERROR
        .quad      CLS
        .quad      QUIT
THROW2:
        .quad      HANDLER, FETCH, RPSTO
        .quad      FROMR, HANDLER, STOR
        .quad      FROMR, SWAP, TOR
        .quad      SPSTO
        .quad      FROMR
        .quad      X
THROW1:
        .quad      DROP
        .quad      SEMIS
#


# 
#

# 

#

#  ***********
#  *   ID.   *
#  ***********
#
        .balign    8,0x00
N_IDDOT:
        .quad      3
        .ASCII      "ID."
        .balign    8,0x00
IDDOT:
        .quad    DOCOL
        .quad    IDDOT+HEADSIZE
        .quad    0x0
        .quad    THROW
        .quad    N_IDDOT
        .quad    0
        .quad    0

        .quad      LDUP, TFFA, FETCH
        .quad      LIT, B_DUMMY, LAND
        .quad      ZBRAN
        .quad      IDDOT1-.-CW
        .quad      DROP
        .quad      BRAN
        .quad      IDDOT2-.-CW
IDDOT1:
        .quad      TNFA
        .quad      FETCH
        .quad      SFET
        .quad      LTYPE
        .quad      SPACE
        .quad      SPACE
        .quad      SPACE
IDDOT2:
        .quad      SEMIS
#
#

#  **************
#  *   HEADER   *
#  **************
#
        .balign    8,0x00
N_LHEAD:
        .quad      6
        .ASCII      "HEADER"
        .balign    8,0x00
LHEAD:
        .quad    DOCOL
        .quad    LHEAD+HEADSIZE
        .quad    0x0
        .quad    IDDOT
        .quad    N_LHEAD
        .quad    0
        .quad    0

        .quad      LDUP
        .quad      ZEQU
        .quad      LIT, 5, QERR
        .quad      TDUP
        .quad      PRESENT
        .quad      LDUP
        .quad      ZBRAN
        .quad      CREA1-.-CW #IF
        .quad      TNFA, FETCH, SFET
        .quad      ETYPE
        .quad      LIT,4
        .quad      MESS
        .quad      X       #THEN
CREA1:  .quad      DROP
 .quad      LALIGN
        .quad      SCOMMA
 .quad      LALIGN
        .quad      HERE,TOR

        .quad      RR, TPHA, COMMA         #Code field.
        .quad      RR, TPHA, COMMA         #Data field.
        .quad      ZERO, COMMA #Flag field.
        .quad      ZERO, COMMA #Link field.
        .quad      COMMA   #Name field.


        .quad      BLK, FETCH, LDUP, ZEQU
        .quad      ZBRAN
        .quad      CREA2-.-CW
        .quad      DROP, PP, FETCH
CREA2:  .quad      COMMA  #Source field.

        .quad      ZERO, COMMA
        .quad      FROMR
        .quad      SEMIS
#

#  ************
#  *   LINK   *
#  ************
#
        .balign    8,0x00
N_LLINK:
        .quad      4
        .ASCII      "LINK"
        .balign    8,0x00
LLINK:
        .quad    DOCOL
        .quad    LLINK+HEADSIZE
        .quad    0x0
        .quad    LHEAD
        .quad    N_LLINK
        .quad    0
        .quad    0

        .quad      TLFA
        .quad      TDUP
        .quad      FETCH
        .quad      SWAP, TLFA, STOR
        .quad      STOR
        .quad      SEMIS
#

#  ****************
#  *   (CREATE)   *
#  ****************
#
        .balign    8,0x00
N_PCREAT:
        .quad      8
        .ASCII      "(CREATE)"
        .balign    8,0x00
PCREAT:
        .quad    DOCOL
        .quad    PCREAT+HEADSIZE
        .quad    0x0
        .quad    LLINK
        .quad    N_PCREAT
        .quad    0
        .quad    0

        .quad      LHEAD
        .quad      CURR, FETCH
        .quad      LLINK
        .quad      SEMIS
#

#  *****************
#  *   [COMPILE]   *
#  *****************
#
        .balign    8,0x00
N_BCOMP:
        .quad      9
        .ASCII      "[COMPILE]"
        .balign    8,0x00
BCOMP:
        .quad    DOCOL
        .quad    BCOMP+HEADSIZE
        .quad    B_IMMED
        .quad    PCREAT
        .quad    N_BCOMP
        .quad    0
        .quad    0

        .quad      LNAME
        .quad      PRESENT
        .quad      LDUP
        .quad      ZEQU
        .quad      LIT, 16, QERR
        .quad      TCFA
        .quad      COMMA
        .quad      SEMIS
#

#  ****************
#  *   POSTPONE   *
#  ****************
#
        .balign    8,0x00
N_POSTP:
        .quad      8
        .ASCII      "POSTPONE"
        .balign    8,0x00
POSTP:
        .quad    DOCOL
        .quad    POSTP+HEADSIZE
        .quad    B_IMMED
        .quad    BCOMP
        .quad    N_POSTP
        .quad    0
        .quad    0

        .quad      LNAME
        .quad      PRESENT
        .quad      LDUP
        .quad      ZEQU
        .quad      LIT, 15, QERR
        .quad      LDUP, TFFA, FETCH
        .quad      LIT, B_IMMED, LAND, ZEQU
        .quad      ZBRAN
        .quad      POSTP1-.-CW
         .quad      LIT, LIT, COMMA
         .quad      COMMA
         .quad      LIT, COMMA
POSTP1:
         .quad      COMMA
        .quad      SEMIS
#

#  ***************
#  *   LITERAL   *
#  ***************
#
        .balign    8,0x00
N_LITER:
        .quad      7
        .ASCII      "LITERAL"
        .balign    8,0x00
LITER:
        .quad    DOCOL
        .quad    LITER+HEADSIZE
        .quad    B_IMMED
        .quad    POSTP
        .quad    N_LITER
        .quad    0
        .quad    0

        .quad      STATE
        .quad      FETCH
        .quad      ZBRAN
        .quad      LITE1-.-CW #IF
        .quad      LIT, LIT, COMMA
        .quad      COMMA   #THEN
LITE1:  .quad      SEMIS
#

#  ****************
#  *   DLITERAL   *
#  ****************
#
        .balign    8,0x00
N_DLITE:
        .quad      8
        .ASCII      "DLITERAL"
        .balign    8,0x00
DLITE:
        .quad    DOCOL
        .quad    DLITE+HEADSIZE
        .quad    B_IMMED
        .quad    LITER
        .quad    N_DLITE
        .quad    0
        .quad    0

        .quad      STATE
        .quad      FETCH
        .quad      ZBRAN
        .quad      DLIT1-.-CW # IF
        .quad      SWAP
        .quad      LITER
        .quad      LITER   # THEN
DLIT1:  .quad      SEMIS
#
#

#  *****************
#  *   SDLITERAL   *
#  *****************
#
        .balign    8,0x00
N_SDLITE:
        .quad      9
        .ASCII      "SDLITERAL"
        .balign    8,0x00
SDLITE:
        .quad    DOCOL
        .quad    SDLITE+HEADSIZE
        .quad    B_IMMED
        .quad    DLITE
        .quad    N_SDLITE
        .quad    0
        .quad    0

        .quad      DPL
        .quad      FETCH
        .quad      ZBRAN
        .quad      SDLIT1-.-CW # IF
        .quad      DLITE
        .quad      BRAN
        .quad      SDLIT2-.-CW # IF
SDLIT1:
        .quad      DROP, LITER
SDLIT2:
        .quad      SEMIS
#


#  **************
#  *   ?STACK   *
#  **************
#
        .balign    8,0x00
N_QSTAC:
        .quad      6
        .ASCII      "?STACK"
        .balign    8,0x00
QSTAC:
        .quad    DOCOL
        .quad    QSTAC+HEADSIZE
        .quad    0x0
        .quad    SDLITE
        .quad    N_QSTAC
        .quad    0
        .quad    0

        .quad      SPFET
        .quad      SZERO
        .quad      FETCH
        .quad      SWAP
        .quad      ULESS
        .quad      ONE, QERR
        .quad      SPFET
        .quad      HERE
        .quad      LIT,0x80
        .quad      PLUS
        .quad      ULESS
        .quad      LIT, 7, QERR
        .quad      SEMIS
        #
#
#

#  *****************
#  *   INTERPRET   *
#  *****************
#
        .balign    8,0x00
N_INTER:
        .quad      9
        .ASCII      "INTERPRET"
        .balign    8,0x00
INTER:
        .quad    DOCOL
        .quad    INTER+HEADSIZE
        .quad    0x0
        .quad    QSTAC
        .quad    N_INTER
        .quad    0
        .quad    0

INTE1:
        .quad      LNAME
        .quad      LDUP      # Zero length.
        .quad      ZBRAN
        .quad      INTE8-.-CW #WHILE
#       DC      DOTS
#       DC      TDUP, LTYPE
        .quad      OVER, TOR       # Save old parse pointer.
        .quad      FOUND
        .quad      LDUP, ZEQU
        .quad      LIT, 12, QERR
        .quad      LDUP, TFFA, FETCH
        .quad      LDUP, LIT, B_DENOT, LAND #Retain copy of flags.
        .quad      ZBRAN
        .quad      INTE3B-.-CW #IF
        .quad      OVER, TNFA, FETCH, FETCH
        .quad      RR, PLUS, PP, STOR  #Skip over prefix.
INTE3B:                  #THEN 
        .quad      RDROP           # Drop old parse pointer.
        .quad      LIT, B_IMMED, LAND
        .quad      STATE, FETCH, ZEQU, LOR
        .quad      ZBRAN
        .quad      INTE3-.-CW #IF
        .quad      EXEC
        .quad      BRAN
        .quad      INTE4-.-CW #IF
INTE3:
        .quad      COMMA
                        #THEN
INTE4:
        .quad      QSTAC
        .quad      BRAN
        .quad      INTE1-.-CW  #AGAIN
INTE8:  .quad      DROP, DROP
        .quad      SEMIS
#

#  *****************
#  *   IMMEDIATE   *
#  *****************
#
        .balign    8,0x00
N_IMMED:
        .quad      9
        .ASCII      "IMMEDIATE"
        .balign    8,0x00
IMMED:
        .quad    DOCOL
        .quad    IMMED+HEADSIZE
        .quad    0x0
        .quad    INTER
        .quad    N_IMMED
        .quad    0
        .quad    0

        .quad      LATEST
        .quad      TFFA
        .quad      LIT, B_IMMED
        .quad      TOGGL
        .quad      SEMIS
#

#  **************
#  *   PREFIX   *
#  **************
#
        .balign    8,0x00
N_PREFX:
        .quad      6
        .ASCII      "PREFIX"
        .balign    8,0x00
PREFX:
        .quad    DOCOL
        .quad    PREFX+HEADSIZE
        .quad    0x0
        .quad    IMMED
        .quad    N_PREFX
        .quad    0
        .quad    0

        .quad      LATEST
        .quad      TFFA
        .quad      LIT, B_DENOT
        .quad      TOGGL
        .quad      SEMIS
#

#  *****************
#  *   NAMESPACE   *
#  *****************
#
        .balign    8,0x00
N_VOCAB:
        .quad      9
        .ASCII      "NAMESPACE"
        .balign    8,0x00
VOCAB:
        .quad    DOCOL
        .quad    VOCAB+HEADSIZE
        .quad    0x0
        .quad    PREFX
        .quad    N_VOCAB
        .quad    0
        .quad    0

        .quad      LCREATE
        .quad      LATEST   # Link this DEA into VOC-LINK chain.
        .quad      VOCL
        .quad      FETCH
        .quad      COMMA
        .quad      VOCL
        .quad      STOR
        .quad      WORDLIST, DROP
        .quad      DOES
DOVOC:
        .quad      ALSO
        .quad      CELLP   # Now points to WID. 
        .quad      CONTEXT
        .quad      STOR
        .quad      SEMIS
        #
#
#   The link to task is a cold start value only.
#   It is updated each time a definition is
#   appended to the 'FORTH' namespace.
#

#  ****************
#  *   WORDLIST   *
#  ****************
#
        .balign    8,0x00
N_WORDLIST:
        .quad      8
        .ASCII      "WORDLIST"
        .balign    8,0x00
WORDLIST:
        .quad    DOCOL
        .quad    WORDLIST+HEADSIZE
        .quad    0x0
        .quad    VOCAB
        .quad    N_WORDLIST
        .quad    0
        .quad    0

        .quad      HERE
        .quad      ZERO, COMMA   # Dummy code field
        .quad      ZERO, COMMA   # Dummy data field
        .quad      LIT, B_DUMMY, COMMA # Dummy flag field
        .quad      ZERO, COMMA #Link field: empty chain
        .quad      LIT, (ZERO+(CW*(D_HOFFSET))), COMMA #Empty string for name.
        .quad      ZERO, COMMA
        .quad      ZERO, COMMA
        .quad      SEMIS
        #
#

#

#  *******************
#  *   DEFINITIONS   *
#  *******************
#
        .balign    8,0x00
N_DEFIN:
        .quad      11
        .ASCII      "DEFINITIONS"
        .balign    8,0x00
DEFIN:
        .quad    DOCOL
        .quad    DEFIN+HEADSIZE
        .quad    0x0
        .quad    WORDLIST
        .quad    N_DEFIN
        .quad    0
        .quad    0

        .quad      CONTEXT
        .quad      FETCH
        .quad      CURR
        .quad      STOR
        .quad      SEMIS
#

#  ************
#  *   ALSO   *
#  ************
#
        .balign    8,0x00
N_ALSO:
        .quad      4
        .ASCII      "ALSO"
        .balign    8,0x00
ALSO:
        .quad    DOCOL
        .quad    ALSO+HEADSIZE
        .quad    0x0
        .quad    DEFIN
        .quad    N_ALSO
        .quad    0
        .quad    0

        .quad      CONTEXT, LDUP, CELLP
        .quad      LIT, (CW*(16-1))
        .quad      LMOVE
        .quad      LIT, ONLYBODY  #End sentinel for array of word lists.
        .quad      CONTEXT, LIT, (CW*(16)), PLUS
        .quad      STOR #Trim sets of wordset.
        .quad      SEMIS
#

#  ****************
#  *   PREVIOUS   *
#  ****************
#
        .balign    8,0x00
N_PREVI:
        .quad      8
        .ASCII      "PREVIOUS"
        .balign    8,0x00
PREVI:
        .quad    DOCOL
        .quad    PREVI+HEADSIZE
        .quad    0x0
        .quad    ALSO
        .quad    N_PREVI
        .quad    0
        .quad    0

        .quad      CONTEXT, LDUP, CELLP, SWAP
        .quad      LIT, (CW*(16))
        .quad      LMOVE
        .quad      SEMIS
#

#  *********
#  *   (   *
#  *********
#
        .balign    8,0x00
N_PAREN:
        .quad      1
        .ASCII      "("
        .balign    8,0x00
PAREN:
        .quad    DOCOL
        .quad    PAREN+HEADSIZE
        .quad    B_IMMED
        .quad    PREVI
        .quad    N_PAREN
        .quad    0
        .quad    0

        .quad      LIT,')'
        .quad      PARSE
        .quad      TDROP
        .quad      SEMIS
#
#

#  *********
#  *   \   *
#  *********
#
        .balign    8,0x00
N_BACKS:
        .quad      1
        .ASCII      "\\"
        .balign    8,0x00
BACKS:
        .quad    DOCOL
        .quad    BACKS+HEADSIZE
        .quad    B_IMMED
        .quad    PAREN
        .quad    N_BACKS
        .quad    0
        .quad    0

# Backup one character, just in case we are at the end of a line.
        .quad      LIT, -1, PP, PSTOR
        .quad      LIT,ALF
        .quad      PARSE
        .quad      TDROP
        .quad      SEMIS
#

#  ************
#  *   QUIT   *
#  ************
#
        .balign    8,0x00
N_QUIT:
        .quad      4
        .ASCII      "QUIT"
        .balign    8,0x00
QUIT:
        .quad    DOCOL
        .quad    QUIT+HEADSIZE
        .quad    0x0
        .quad    BACKS
        .quad    N_QUIT
        .quad    0
        .quad    0

        .quad      LBRAC
QUIT1:                  #BEGIN
        .quad      RZERO
        .quad      FETCH
        .quad      RPSTO
        .quad      LIT
        .quad      PACCEP
        .quad      CATCH
        .quad      LDUP, LIT, -EPIPE, EQUAL
        .quad      ZBRAN
        .quad      ENDIF7-.-CW
        .quad      BYE     #End of input, no error!
ENDIF7:
        .quad      QERRUR
        .quad      ONEP
        .quad      SETSRC
        .quad      INTER
        .quad      OK
        .quad      BRAN
        .quad      QUIT1-.-CW  #AGAIN
        .quad      SEMIS   #Unnecessary, but helpful for decompilation.
#

#  **********
#  *   OK   *
#  **********
#
        .balign    8,0x00
N_OK:
        .quad      2
        .ASCII      "OK"
        .balign    8,0x00
OK:
        .quad    DOCOL
        .quad    OK+HEADSIZE
        .quad    0x0
        .quad    QUIT
        .quad    N_OK
        .quad    0
        .quad    0

        .quad      STATE
        .quad      FETCH
        .quad      ZEQU
        .quad      ZBRAN
        .quad      OK2-.-CW #IF
        .quad      SKIP
         .quad      3
SB4: .ASCII      " OK"
       .balign    8,0x00
        .quad      LIT, SB4
        .quad      LIT, 3
        .quad      LTYPE
        .quad      CR
OK2:
        .quad      SEMIS
#

#  *************
#  *   ABORT   *
#  *************
#
        .balign    8,0x00
N_ABORT:
        .quad      5
        .ASCII      "ABORT"
        .balign    8,0x00
ABORT:
        .quad    DOCOL
        .quad    ABORT+HEADSIZE
        .quad    0x0
        .quad    OK
        .quad    N_ABORT
        .quad    0
        .quad    0

        .quad      SZERO, FETCH, SPSTO
        .quad      ZERO, HANDLER, STOR
        .quad      QUIT
        .quad      SEMIS   #Unnecessary, but helpful for decompilation.
#
#      WARM START VECTOR COMES HERE
#      For booting code we enter here, real mode and using the switchsegment.
#      BY control BREAK.
WARM_ENTRY:
# 

        
        JMP USINI+(CW*(-2))
#

#  ************
#  *   WARM   *
#  ************
#
        .balign    8,0x00
N_WARM:
        .quad      4
        .ASCII      "WARM"
        .balign    8,0x00
WARM:
        .quad    DOCOL
        .quad    WARM+HEADSIZE
        .quad    0x0
        .quad    ABORT
        .quad    N_WARM
        .quad    0
        .quad    0

        .quad      INIT
        .quad      SIGNON
        .quad      ABORT
        .quad      SEMIS   #Unnecessary, but helpful for decompilation.
#


#  ***************
#  *   OPTIONS   *
#  ***************
#
        .balign    8,0x00
N_OPTIONS:
        .quad      7
        .ASCII      "OPTIONS"
        .balign    8,0x00
OPTIONS:
        .quad    DOCOL
        .quad    OPTIONS+HEADSIZE
        .quad    0x0
        .quad    WARM
        .quad    N_OPTIONS
        .quad    0
        .quad    0

#       Execute option.
        .quad      ARGS, FETCH, CELLP, CELLP, FETCH, LDUP
        .quad      ZBRAN
        .quad      OPT4-.-CW # No options  



#Supposedly on the stack is now a pointer to the option.
        .quad      COUNT

        .quad      LIT, '-', UNEQ
        .quad      ZBRAN
        .quad      OPT3-.-CW
        .quad      LIT, 3, LDUP, LERROR
        .quad      XCODE, STOR, BYE
OPT3:
        .quad      CFET
        .quad      LIT, 0x1F, LAND
        .quad      LLOAD       #Supposedly stack-neutral.
        .quad      ZERO, SWAP # Sign on suppressed.
OPT4:
        .quad      DROP
        .quad      SEMIS
#


#  ************
#  *   COLD   *
#  ************
#
        .balign    8,0x00
N_COLD:
        .quad      4
        .ASCII      "COLD"
        .balign    8,0x00
COLD:
        .quad    DOCOL
        .quad    COLD5
        .quad    0x0
        .quad    OPTIONS
        .quad    N_COLD
        .quad    0
        .quad    0

# Fill user area for single task.
        .quad      LIT, USINI      # Fails if SP/RP are not usable!
        .quad      LIT, USINI+(CW*(1)), FETCH
        .quad      LIT, US
        .quad      LCMOVE
        .quad      INIT
COLD0:  .quad      ONE            # Sign on wanted.
#

        .quad      ZERO, LIT, TCGETS, TERMIO
        .quad      LIT, ioctl, XOS, ZLESS
        .quad      ZBRAN
        .quad      COLD1-.-CW
        # Not a terminal. Cannot set the terminal, get rid of "OK".
        .quad      DROP, ZERO      # Sign on suppressed.
        .quad      LIT,TASK  # Suppress OK for pipes.
        .quad      LIT,OK
        .quad      LIT, (CW*(3)), LCMOVE
COLD1:
#
        .quad      OPTIONS
        .quad      ZBRAN
        .quad      COLD5-.-CW
        .quad      SIGNON    # Suppressed for scripting! Or any options.
COLD5:
        .quad      ABORT
        .quad      BYE     # In case of turnkey programs.
        .quad      SEMIS   # Unnecessary, but helpful for decompilation.
#

#  *************
#  *   _INIT   *
#  *************
#
        .balign    8,0x00
N_INIT:
        .quad      5
        .ASCII      "_INIT"
        .balign    8,0x00
INIT:
        .quad    DOCOL
        .quad    INIT+HEADSIZE
        .quad    0x0
        .quad    COLD
        .quad    N_INIT
        .quad    0
        .quad    0

        .quad      SZERO, FETCH, SPSTO
        .quad      ZERO, HANDLER, STOR
        .quad      DECA
        .quad      ONLY, FORTH, DEFIN

        .quad      LIT, 0, BLINI  #Default, open library file read-only!#
#
        .quad      SEMIS
#
#

#  ***********
#  *   S>D   *
#  ***********
#
        .balign    8,0x00
N_STOD:
        .quad      3
        .ASCII      "S>D"
        .balign    8,0x00
STOD:
        .quad    STOD+HEADSIZE
        .quad    STOD+HEADSIZE
        .quad    0x0
        .quad    INIT
        .quad    N_STOD
        .quad    0
        .quad    0

        POP     %RDX      #S1
        SUB     %RAX,%RAX
        OR      %RDX,%RDX
        JNS     STOD1   #POS
        DEC     %RAX      #NEG
STOD1:
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ***********
#  *   ABS   *
#  ***********
#
        .balign    8,0x00
N_LABS:
        .quad      3
        .ASCII      "ABS"
        .balign    8,0x00
LABS:
        .quad    DOCOL
        .quad    LABS+HEADSIZE
        .quad    0x0
        .quad    STOD
        .quad    N_LABS
        .quad    0
        .quad    0

        .quad      LDUP
        .quad      ZLESS
        .quad      ZBRAN
        .quad      PM1-.-CW   #IF
        .quad      NEGATE   #THEN
PM1:
        .quad      SEMIS
#

#  ************
#  *   DABS   *
#  ************
#
        .balign    8,0x00
N_DABS:
        .quad      4
        .ASCII      "DABS"
        .balign    8,0x00
DABS:
        .quad    DOCOL
        .quad    DABS+HEADSIZE
        .quad    0x0
        .quad    LABS
        .quad    N_DABS
        .quad    0
        .quad    0

        .quad      LDUP
        .quad      ZLESS
        .quad      ZBRAN
        .quad      DPM1-.-CW  #IF
        .quad      DNEGA   #THEN
DPM1:
        .quad      SEMIS
#

#  ***********
#  *   MIN   *
#  ***********
#
        .balign    8,0x00
N_MIN:
        .quad      3
        .ASCII      "MIN"
        .balign    8,0x00
MIN:
        .quad    DOCOL
        .quad    MIN+HEADSIZE
        .quad    0x0
        .quad    DABS
        .quad    N_MIN
        .quad    0
        .quad    0

        .quad      TDUP
        .quad      GREAT
        .quad      ZBRAN
        .quad      MIN1-.-CW  #IF
        .quad      SWAP    #THEN
MIN1:   .quad      DROP
        .quad      SEMIS
#

#  ***********
#  *   MAX   *
#  ***********
#
        .balign    8,0x00
N_MAX:
        .quad      3
        .ASCII      "MAX"
        .balign    8,0x00
MAX:
        .quad    DOCOL
        .quad    MAX+HEADSIZE
        .quad    0x0
        .quad    MIN
        .quad    N_MAX
        .quad    0
        .quad    0

        .quad      TDUP
        .quad      LESS
        .quad      ZBRAN
        .quad      MAX1-.-CW  #IF
        .quad      SWAP    #THEN
MAX1:   .quad      DROP
        .quad      SEMIS
#

#  **************
#  *   LSHIFT   *
#  **************
#
        .balign    8,0x00
N_LSHIFT:
        .quad      6
        .ASCII      "LSHIFT"
        .balign    8,0x00
LSHIFT:
        .quad    LSHIFT+HEADSIZE
        .quad    LSHIFT+HEADSIZE
        .quad    0x0
        .quad    MAX
        .quad    N_LSHIFT
        .quad    0
        .quad    0

        POP     %RCX
        POP     %RAX
        SHL     %RAX,%CL
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **************
#  *   RSHIFT   *
#  **************
#
        .balign    8,0x00
N_RSHIFT:
        .quad      6
        .ASCII      "RSHIFT"
        .balign    8,0x00
RSHIFT:
        .quad    RSHIFT+HEADSIZE
        .quad    RSHIFT+HEADSIZE
        .quad    0x0
        .quad    LSHIFT
        .quad    N_RSHIFT
        .quad    0
        .quad    0

        POP     %RCX
        POP     %RAX
        SHR     %RAX,%CL
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   M*   *
#  **********
#
        .balign    8,0x00
N_MSTAR:
        .quad      2
        .ASCII      "M*"
        .balign    8,0x00
MSTAR:
        .quad    MSTAR+HEADSIZE
        .quad    MSTAR+HEADSIZE
        .quad    0x0
        .quad    RSHIFT
        .quad    N_MSTAR
        .quad    0
        .quad    0

        POP     %RAX
        POP     %RBX
        IMUL     %RBX      #SIGNED
        XCHG    %RAX,%RDX   #AX NOW = MSW
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]             #STORE DOUBLE CELL
#

#  **************
#  *   SM/REM   *
#  **************
#
        .balign    8,0x00
N_MSLAS:
        .quad      6
        .ASCII      "SM/REM"
        .balign    8,0x00
MSLAS:
        .quad    MSLAS+HEADSIZE
        .quad    MSLAS+HEADSIZE
        .quad    0x0
        .quad    MSTAR
        .quad    N_MSLAS
        .quad    0
        .quad    0

        POP     %RBX      #DIVISOR
        POP     %RDX      #MSW OF DIVIDEND
        POP     %RAX      #LSW OF DIVIDEND
        IDIV     %RBX      # 64 BIT DIVIDE
        PUSH    %RDX
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]             #STORE QUOT/REM
#

#
#  **********
#  *   2/   *
#  **********
#
        .balign    8,0x00
N_TWOSL:
        .quad      2
        .ASCII      "2/"
        .balign    8,0x00
TWOSL:
        .quad    TWOSL+HEADSIZE
        .quad    TWOSL+HEADSIZE
        .quad    0x0
        .quad    MSLAS
        .quad    N_TWOSL
        .quad    0
        .quad    0

        POP     %RAX      #(S1) <- (S1) + (S2)
        SAR     %RAX,1
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   

#

#
#  **********
#  *   2*   *
#  **********
#
        .balign    8,0x00
N_TWOST:
        .quad      2
        .ASCII      "2*"
        .balign    8,0x00
TWOST:
        .quad    TWOST+HEADSIZE
        .quad    TWOST+HEADSIZE
        .quad    0x0
        .quad    TWOSL
        .quad    N_TWOST
        .quad    0
        .quad    0

        POP     %RAX      #(S1) <- (S1) + (S2)
        SAL     %RAX,1
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  **********
#  *   1-   *
#  **********
#
        .balign    8,0x00
N_ONEM:
        .quad      2
        .ASCII      "1-"
        .balign    8,0x00
ONEM:
        .quad    DOCOL
        .quad    ONEM+HEADSIZE
        .quad    0x0
        .quad    TWOST
        .quad    N_ONEM
        .quad    0
        .quad    0

        .quad      ONE, LSUB
        .quad      SEMIS
#

#  **************
#  *   FM/MOD   *
#  **************
#
        .balign    8,0x00
N_FMSLAS:
        .quad      6
        .ASCII      "FM/MOD"
        .balign    8,0x00
FMSLAS:
        .quad    DOCOL
        .quad    FMSLAS+HEADSIZE
        .quad    0x0
        .quad    ONEM
        .quad    N_FMSLAS
        .quad    0
        .quad    0

        .quad      LDUP, TOR
        .quad      TDUP, LXOR, TOR
        .quad      MSLAS
        .quad      FROMR, ZLESS
        .quad      ZBRAN
        .quad      FMMOD1-.-CW
        .quad      OVER
        .quad      ZBRAN
        .quad      FMMOD1-.-CW
        .quad      ONE, LSUB
        .quad      SWAP, FROMR, PLUS, SWAP
        .quad      BRAN
        .quad      FMMOD2-.-CW
FMMOD1:
        .quad      RDROP
FMMOD2:
        .quad      SEMIS
#

#  *********
#  *   *   *
#  *********
#
        .balign    8,0x00
N_STAR:
        .quad      1
        .ASCII      "*"
        .balign    8,0x00
STAR:
        .quad    DOCOL
        .quad    STAR+HEADSIZE
        .quad    0x0
        .quad    FMSLAS
        .quad    N_STAR
        .quad    0
        .quad    0

        .quad      MSTAR
        .quad      DROP
        .quad      SEMIS
#

#  ************
#  *   /MOD   *
#  ************
#
        .balign    8,0x00
N_SLMOD:
        .quad      4
        .ASCII      "/MOD"
        .balign    8,0x00
SLMOD:
        .quad    DOCOL
        .quad    SLMOD+HEADSIZE
        .quad    0x0
        .quad    STAR
        .quad    N_SLMOD
        .quad    0
        .quad    0

        .quad      TOR
        .quad      STOD
        .quad      FROMR
        .quad      MSLAS
        .quad      SEMIS
#

#  *********
#  *   /   *
#  *********
#
        .balign    8,0x00
N_SLASH:
        .quad      1
        .ASCII      "/"
        .balign    8,0x00
SLASH:
        .quad    DOCOL
        .quad    SLASH+HEADSIZE
        .quad    0x0
        .quad    SLMOD
        .quad    N_SLASH
        .quad    0
        .quad    0

        .quad      SLMOD
        .quad      NIP
        .quad      SEMIS
#

#  ***********
#  *   MOD   *
#  ***********
#
        .balign    8,0x00
N_LMOD:
        .quad      3
        .ASCII      "MOD"
        .balign    8,0x00
LMOD:
        .quad    DOCOL
        .quad    LMOD+HEADSIZE
        .quad    0x0
        .quad    SLASH
        .quad    N_LMOD
        .quad    0
        .quad    0

        .quad      SLMOD
        .quad      DROP
        .quad      SEMIS
#

#  *************
#  *   */MOD   *
#  *************
#
        .balign    8,0x00
N_SSMOD:
        .quad      5
        .ASCII      "*/MOD"
        .balign    8,0x00
SSMOD:
        .quad    DOCOL
        .quad    SSMOD+HEADSIZE
        .quad    0x0
        .quad    LMOD
        .quad    N_SSMOD
        .quad    0
        .quad    0

        .quad      TOR
        .quad      MSTAR
        .quad      FROMR
        .quad      MSLAS
        .quad      SEMIS
#

#  **********
#  *   */   *
#  **********
#
        .balign    8,0x00
N_SSLA:
        .quad      2
        .ASCII      "*/"
        .balign    8,0x00
SSLA:
        .quad    DOCOL
        .quad    SSLA+HEADSIZE
        .quad    0x0
        .quad    SSMOD
        .quad    N_SSLA
        .quad    0
        .quad    0

        .quad      SSMOD
        .quad      NIP
        .quad      SEMIS
#


#  *************
#  *   M/MOD   *
#  *************
#
        .balign    8,0x00
N_MSMOD1:
        .quad      5
        .ASCII      "M/MOD"
        .balign    8,0x00
MSMOD1:
        .quad    DOCOL
        .quad    UDMSMOD 
        .quad    0x0
        .quad    SSLA
        .quad    N_MSMOD1
        .quad    0
        .quad    0

#  ***************
#  *   UDM/MOD   *
#  ***************
#
        .balign    8,0x00
N_MSMOD:
        .quad      7
        .ASCII      "UDM/MOD"
        .balign    8,0x00
MSMOD:
        .quad    DOCOL
        .quad    MSMOD+HEADSIZE
        .quad    0x0
        .quad    MSMOD1
        .quad    N_MSMOD
        .quad    0
        .quad    0

UDMSMOD:
        .quad      TOR
        .quad      ZERO
        .quad      RR
        .quad      USLAS
        .quad      FROMR
        .quad      SWAP
        .quad      TOR
        .quad      USLAS
        .quad      FROMR
        .quad      SEMIS
#

#  **************
#  *   (LINE)   *
#  **************
#
        .balign    8,0x00
N_PLINE:
        .quad      6
        .ASCII      "(LINE)"
        .balign    8,0x00
PLINE:
        .quad    DOCOL
        .quad    PLINE+HEADSIZE
        .quad    0x0
        .quad    MSMOD
        .quad    N_PLINE
        .quad    0
        .quad    0

        .quad      TOR
        .quad      LIT,64
        .quad      MSTAR
        .quad      BBUF
        .quad      FMSLAS
        .quad      FROMR # This blocks, so is screens.
        .quad      PLUS
        .quad      BLOCK
        .quad      PLUS
        .quad      LIT,63
        .quad      SEMIS
#

#  **************
#  *   ERRSCR   *
#  **************
#
        .balign    8,0x00
N_ERRSCR:
        .quad      6
        .ASCII      "ERRSCR"
        .balign    8,0x00
ERRSCR:
        .quad    DOVAR
        .quad    ERRSCR+HEADSIZE
        .quad    0x0
        .quad    PLINE
        .quad    N_ERRSCR
        .quad    0
        .quad    0

        .quad ERRORSCREEN
#

#  ***************
#  *   MESSAGE   *
#  ***************
#
        .balign    8,0x00
N_MESS:
        .quad      7
        .ASCII      "MESSAGE"
        .balign    8,0x00
MESS:
        .quad    DOCOL
        .quad    MESS+HEADSIZE
        .quad    0x0
        .quad    ERRSCR
        .quad    N_MESS
        .quad    0
        .quad    0

        .quad      LWARN
        .quad      FETCH
        .quad      ZBRAN
        .quad      MESS1-.-CW #IF
        .quad      ERRSCR, FETCH
        .quad      PLINE, ONEP     # Also print the '\n' !
        .quad      ETYPE
        .quad      X
MESS1:                  #THEN
        .quad      DROP
        .quad      SEMIS
#

#  ***********
#  *   PC@   *
#  ***********
#
        .balign    8,0x00
N_PCFET:
        .quad      3
        .ASCII      "PC@"
        .balign    8,0x00
PCFET:
        .quad    PCFET+HEADSIZE
        .quad    PCFET+HEADSIZE
        .quad    0x0
        .quad    MESS
        .quad    N_PCFET
        .quad    0
        .quad    0

# FETCH CHARACTER (BYTE) FROM PORT
        POP     %RDX      # PORT ADDR
        XOR     %RAX,%RAX
        IN      %AL,%DX  # BYTE INPUT
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ***********
#  *   PC!   *
#  ***********
#
        .balign    8,0x00
N_PCSTO:
        .quad      3
        .ASCII      "PC!"
        .balign    8,0x00
PCSTO:
        .quad    PCSTO+HEADSIZE
        .quad    PCSTO+HEADSIZE
        .quad    0x0
        .quad    PCFET
        .quad    N_PCSTO
        .quad    0
        .quad    0

        POP     %RDX      #PORT ADDR
        POP     %RAX      #DATA
        OUT     %DX,%AL   # BYTE OUTPUT
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ***********
#  *   PW@   *
#  ***********
#
        .balign    8,0x00
N_PFET:
        .quad      3
        .ASCII      "PW@"
        .balign    8,0x00
PFET:
        .quad    PFET+HEADSIZE
        .quad    PFET+HEADSIZE
        .quad    0x0
        .quad    PCSTO
        .quad    N_PFET
        .quad    0
        .quad    0

        POP     %RDX      #PORT ADDR
        IN      %AX,%DX  #WORD INPUT
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  ***********
#  *   PW!   *
#  ***********
#
        .balign    8,0x00
N_PSTO:
        .quad      3
        .ASCII      "PW!"
        .balign    8,0x00
PSTO:
        .quad    PSTO+HEADSIZE
        .quad    PSTO+HEADSIZE
        .quad    0x0
        .quad    PFET
        .quad    N_PSTO
        .quad    0
        .quad    0

        POP     %RDX      #PORT ADDR
        POP     %RAX      #DATA
        OUT     %DX,%AX   #WORD OUTPUT
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]   
#

#  *************
#  *   _PREV   *
#  *************
#
        .balign    8,0x00
N__PREV:
        .quad      5
        .ASCII      "_PREV"
        .balign    8,0x00
_PREV:
        .quad    DOVAR
        .quad    _PREV+HEADSIZE
        .quad    0x0
        .quad    PSTO
        .quad    N__PREV
        .quad    0
        .quad    0

        .quad      BUF1
#

#  *************
#  *   #BUFF   *
#  *************
#
        .balign    8,0x00
N_NOBUF:
        .quad      5
        .ASCII      "#BUFF"
        .balign    8,0x00
NOBUF:
        .quad    DOCON
        .quad    NBUF
        .quad    0x0
        .quad    _PREV
        .quad    N_NOBUF
        .quad    0
        .quad    0

#

#  ************
#  *   +BUF   *
#  ************
#
        .balign    8,0x00
N_PBUF:
        .quad      4
        .ASCII      "+BUF"
        .balign    8,0x00
PBUF:
        .quad    DOCOL
        .quad    PBUF+HEADSIZE
        .quad    0x0
        .quad    NOBUF
        .quad    N_PBUF
        .quad    0
        .quad    0

        .quad      BBUF, CELLP, CELLP
        .quad      PLUS,LDUP
        .quad      _LIMIT,EQUAL
        .quad      ZBRAN
        .quad      PBUF1-.-CW
        .quad      DROP,_FIRST
PBUF1:  .quad      LDUP, _PREV, FETCH, LSUB
        .quad      SEMIS
#

#  **************
#  *   UPDATE   *
#  **************
#
        .balign    8,0x00
N_UPDAT:
        .quad      6
        .ASCII      "UPDATE"
        .balign    8,0x00
UPDAT:
        .quad    DOCOL
        .quad    UPDAT+HEADSIZE
        .quad    0x0
        .quad    PBUF
        .quad    N_UPDAT
        .quad    0
        .quad    0

        .quad      _PREV, FETCH
        .quad      LDUP, CELLP,CELLP
        .quad      SWAP, FETCH
        .quad      LOFFSET,  FETCH, PLUS
        .quad      BLWRITE
        .quad      SEMIS
#

#  *********************
#  *   EMPTY-BUFFERS   *
#  *********************
#
        .balign    8,0x00
N_MTBUF:
        .quad      13
        .ASCII      "EMPTY-BUFFERS"
        .balign    8,0x00
MTBUF:
        .quad    DOCOL
        .quad    MTBUF+HEADSIZE
        .quad    0x0
        .quad    UPDAT
        .quad    N_MTBUF
        .quad    0
        .quad    0

        .quad      _FIRST
        .quad      _LIMIT,OVER
        .quad      LSUB,LERASE
        .quad      _FIRST, _PREV, STOR
        .quad      SEMIS
        #
#

#  ****************
#  *   (BUFFER)   *
#  ****************
#
        .balign    8,0x00
N_BUFFER:
        .quad      8
        .ASCII      "(BUFFER)"
        .balign    8,0x00
BUFFER:
        .quad    DOCOL
        .quad    BUFFER+HEADSIZE
        .quad    0x0
        .quad    MTBUF
        .quad    N_BUFFER
        .quad    0
        .quad    0

# Find the buffer, if it is already here.
    .quad      _PREV, FETCH
BUFFER1:
    .quad          TOR, RR, FETCH, OVER, EQUAL
    .quad      ZBRAN
        .quad      BUFFER3-.-CW
    .quad        DROP, FROMR, EXIT
BUFFER3:
    .quad          FROMR
    .quad      PBUF, ZEQU
    .quad      ZBRAN
        .quad      BUFFER1-.-CW
# We are left with the previous buffer.
BUFFER2:
    .quad       PBUF, ZEQU, LIT, 48, QERR  # No free buffers available.
    .quad       LDUP, CELLP, FETCH
    .quad       LIT, -1, GREAT        # Unlocked buffer?
    .quad      ZBRAN
        .quad      BUFFER2-.-CW
    .quad       TOR
# Fill in the house keeping.
    .quad       RR, STOR
    .quad       ZERO, RR, CELLP, STOR

    .quad       RR, _PREV, STOR
    .quad       FROMR
    .quad  SEMIS
#


#  *************
#  *   BLOCK   *
#  *************
#
        .balign    8,0x00
N_BLOCK:
        .quad      5
        .ASCII      "BLOCK"
        .balign    8,0x00
BLOCK:
        .quad    DOCOL
        .quad    BLOCK+HEADSIZE
        .quad    0x0
        .quad    BUFFER
        .quad    N_BLOCK
        .quad    0
        .quad    0


        .quad      BUFFER
        .quad      LDUP, CELLP, FETCH, ONE, LAND, ZEQU
        .quad      ZBRAN
        .quad      BLOCK1-.-CW
        .quad      LDUP, CELLP, CELLP
        .quad      OVER, FETCH
        .quad      LOFFSET,  FETCH, PLUS
        .quad      BLREAD
        .quad      LDUP, CELLP , ONE, TOGGL
BLOCK1:
        .quad      LDUP, _PREV, STOR
        .quad      CELLP, CELLP
        .quad      SEMIS
#

#  *************
#  *   FLUSH   *
#  *************
#
        .balign    8,0x00
N_FLUSH:
        .quad      5
        .ASCII      "FLUSH"
        .balign    8,0x00
FLUSH:
        .quad    DOCOL
        .quad    (MTBUF+HEADSIZE)
        .quad    0x0
        .quad    BLOCK
        .quad    N_FLUSH
        .quad    0
        .quad    0


# Unlock all buffers
        .quad      _LIMIT
        .quad      _FIRST, CELLP
        .quad     XDO
        .quad      FLUS2-.-CW
FLUS1:  .quad      ZERO, IDO, STOR
        .quad      LIT,(KBBUF+2*CW)
        .quad      PLOOP
        .quad      (FLUS1-.)
FLUS2:
        .quad      SEMIS
#

#  ************
#  *   SAVE   *
#  ************
#
        .balign    8,0x00
N_SAVE:
        .quad      4
        .ASCII      "SAVE"
        .balign    8,0x00
SAVE:
        .quad    DOCOL
        .quad    SAVE+HEADSIZE
        .quad    0x0
        .quad    FLUSH
        .quad    N_SAVE
        .quad    0
        .quad    0

        .quad      FROMR
        .quad      SRC, TFET
        .quad      PP, FETCH
        .quad      TOR, TOR, TOR
        .quad      TOR
        .quad SEMIS
#

#  ***************
#  *   RESTORE   *
#  ***************
#
        .balign    8,0x00
N_RESTO:
        .quad      7
        .ASCII      "RESTORE"
        .balign    8,0x00
RESTO:
        .quad    DOCOL
        .quad    RESTO+HEADSIZE
        .quad    0x0
        .quad    SAVE
        .quad    N_RESTO
        .quad    0
        .quad    0

        .quad      FROMR
        .quad      FROMR, FROMR, FROMR
        .quad      PP, STOR
        .quad      SRC, TSTOR
        .quad      TOR
        .quad SEMIS
#


# 
#

# 
#
#

#  ************
#  *   LOCK   *
#  ************
#
        .balign    8,0x00
N_LLOCK:
        .quad      4
        .ASCII      "LOCK"
        .balign    8,0x00
LLOCK:
        .quad    DOCOL
        .quad    LLOCK+HEADSIZE
        .quad    0x0
        .quad    RESTO
        .quad    N_LLOCK
        .quad    0
        .quad    0

        .quad      BUFFER
        .quad      CELLP
        .quad      LIT, -2, SWAP, PSTOR
        .quad      SEMIS
#

#  **************
#  *   UNLOCK   *
#  **************
#
        .balign    8,0x00
N_LUNLOCK:
        .quad      6
        .ASCII      "UNLOCK"
        .balign    8,0x00
LUNLOCK:
        .quad    DOCOL
        .quad    LUNLOCK+HEADSIZE
        .quad    0x0
        .quad    LLOCK
        .quad    N_LUNLOCK
        .quad    0
        .quad    0

        .quad      BUFFER
        .quad      CELLP
        .quad      TWO, SWAP, PSTOR
        .quad      SEMIS
#

#  ************
#  *   LOAD   *
#  ************
#
        .balign    8,0x00
N_LLOAD:
        .quad      4
        .ASCII      "LOAD"
        .balign    8,0x00
LLOAD:
        .quad    DOCOL
        .quad    LLOAD+HEADSIZE
        .quad    0x0
        .quad    LUNLOCK
        .quad    N_LLOAD
        .quad    0
        .quad    0

        .quad      SAVE
        .quad      TOR
        .quad      RR, LIT, LLOCK, CATCH  # Be careful about always unlocking.
        .quad      LDUP, ZEQU
        .quad      ZBRAN
        .quad      LOAD5-.-CW
        .quad      DROP
        .quad      RR, BLOCK     # Can't fail anymore. 
        .quad      BBUF
        .quad      SETSRC
        .quad      LIT, INTER, CATCH
        .quad      RR, LUNLOCK
LOAD5:
        .quad      RDROP
        .quad      RESTO
        .quad      THROW
        .quad      SEMIS
#

#  ************
#  *   THRU   *
#  ************
#
        .balign    8,0x00
N_THRU:
        .quad      4
        .ASCII      "THRU"
        .balign    8,0x00
THRU:
        .quad    DOCOL
        .quad    THRU+HEADSIZE
        .quad    0x0
        .quad    LLOAD
        .quad    N_THRU
        .quad    0
        .quad    0

        .quad      ONEP, SWAP
        .quad     XDO
        .quad      THRU2-.-CW
THRU1:
        .quad      IDO, LLOAD
        .quad     ONE, XPLOOP, ZBRAN
        .quad      THRU1-.-CW
        .quad      UNLOOP 
THRU2:
        .quad      SEMIS
#

#

#  ***********
#  *   BLK   *
#  ***********
#
        .balign    8,0x00
N_BLK:
        .quad      3
        .ASCII      "BLK"
        .balign    8,0x00
BLK:
        .quad    DOCOL
        .quad    BLK+HEADSIZE
        .quad    0x0
        .quad    THRU
        .quad    N_BLK
        .quad    0
        .quad    0

        .quad      PP, FETCH
        .quad      _FIRST, _LIMIT, WITHIN
        .quad      SRC, TFET, LSUB
        .quad      LIT, 1024, EQUAL, LAND
        .quad      ZBRAN
        .quad      BLK1-.-CW
        .quad      SRC, FETCH, TWO, LCELLS, LSUB, FETCH
        .quad      BRAN
        .quad      BLK2-.-CW
BLK1:
        .quad      ZERO
BLK2:
        .quad      PBLK, STOR
        .quad      PBLK
        .quad      SEMIS
#

#
#
# 



#  ***********
#  *   XOS   *
#  ***********
#
        .balign    8,0x00
N_XOS:
        .quad      3
        .ASCII      "XOS"
        .balign    8,0x00
XOS:
        .quad    XOS+HEADSIZE
        .quad    XOS+HEADSIZE
        .quad    0x0
        .quad    BLK
        .quad    N_XOS
        .quad    0
        .quad    0

#

#
#
        MOV     %R15,%RSI   # HIP is SI 
        POP     %RAX       # Function number              
        POP     %RDX       # Third parameter, or dummy    
        POP     %RSI       # Second parameter, or dummy   
        POP     %RDI       # First parameter.             
        SYSCALL          #  Generic call on LINUX       
        MOV     %RSI,%R15
#
        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]        # Positive means okay. Negative means -errno.
#
 # 
#


#  ************
#  *   XOS5   *
#  ************
#
        .balign    8,0x00
N_XOS5:
        .quad      4
        .ASCII      "XOS5"
        .balign    8,0x00
XOS5:
        .quad    XOS5+HEADSIZE
        .quad    XOS5+HEADSIZE
        .quad    0x0
        .quad    XOS
        .quad    N_XOS5
        .quad    0
        .quad    0

#

        MOV     %R15,%RSI   # HIP is SI 
        POP     %RAX        # Function number            
        POP     %R8       # 5th parameter, or dummy    
        POP     %R10      # 4th parameter, or dummy    
        POP     %RDX        # Third parameter, or dummy  
        POP     %RSI        # Second parameter, or dummy 
        POP     %RDI        # First parameter.           
        SYSCALL           # Generic call on LINUX      
        MOV     %RSI,%R15
#

        PUSH    %RAX
        LODSQ                  # NEXT
        JMP     QWORD PTR[%RAX]        # Positive means okay. Negative means -errno.
#
 # 
#

#  **********
#  *   MS   *
#  **********
#
        .balign    8,0x00
N_MS:
        .quad      2
        .ASCII      "MS"
        .balign    8,0x00
MS:
        .quad    DOCOL
        .quad    MS+HEADSIZE
        .quad    0x0
        .quad    XOS5
        .quad    N_MS
        .quad    0
        .quad    0

# Use select because nanosleep has a 20 MS resolution. 
        .quad      LIT, 1000, LIT, 1000000, SSMOD # (ms -- us s) 
        .quad      LIT, TV, TSTOR
        .quad      ZERO, ZERO
        .quad      ZERO, ZERO
        .quad      LIT, TV
       .quad      LIT, _newselect, XOS5

        .quad      QERRUR
        .quad      SEMIS
TV:     .SPACE   (CW*(2))    # A time_t and a long, both cells.
#
# 
# 
        #
#------------------------------------
#       CONSOLE RELEATED I/O         
#------------------------------------
#


# 
# 


#  *****************
#  *   RW-BUFFER   *
#  *****************
#
        .balign    8,0x00
N_RWBUF:
        .quad      9
        .ASCII      "RW-BUFFER"
        .balign    8,0x00
RWBUF:
        .quad    DOVAR
        .quad    RWBUF+HEADSIZE
        .quad    0x0
        .quad    MS
        .quad    N_RWBUF
        .quad    0
        .quad    0

        .SPACE   0x1000
# 
# 
#


#  ***********
#  *   ZEN   *
#  ***********
#
        .balign    8,0x00
N_ZEN:
        .quad      3
        .ASCII      "ZEN"
        .balign    8,0x00
ZEN:
        .quad    DOCOL
        .quad    ZEN+HEADSIZE
        .quad    0x0
        .quad    RWBUF
        .quad    N_ZEN
        .quad    0
        .quad    0

        .quad      RWBUF, SSTOR
        .quad      ZERO, RWBUF, CHAPP
        .quad      RWBUF, CELLP
        .quad      SEMIS
# 
# 
# 
# 
#
#


#  ******************
#  *   WRITE-FILE   *
#  ******************
#
        .balign    8,0x00
N_WFILE:
        .quad      10
        .ASCII      "WRITE-FILE"
        .balign    8,0x00
WFILE:
        .quad    DOCOL
        .quad    WFILE+HEADSIZE
        .quad    0x0
        .quad    ZEN
        .quad    N_WFILE
        .quad    0
        .quad    0

        .quad      ROT, ROT
        .quad      LIT, write, XOS
        .quad      ZERO, MIN
        .quad      SEMIS
# 
# 
# 
# 
#


#  *****************
#  *   OPEN-FILE   *
#  *****************
#
        .balign    8,0x00
N_OFILE:
        .quad      9
        .ASCII      "OPEN-FILE"
        .balign    8,0x00
OFILE:
        .quad    DOCOL
        .quad    OFILE+HEADSIZE
        .quad    0x0
        .quad    WFILE
        .quad    N_OFILE
        .quad    0
        .quad    0

        .quad      TOR, ZEN, FROMR
#
        .quad      X
        .quad      LIT, open, XOS
        .quad      LDUP, ZERO, MIN
        .quad      SEMIS
#
#
#
#


#  ******************
#  *   CLOSE-FILE   *
#  ******************
#
        .balign    8,0x00
N_CFILE:
        .quad      10
        .ASCII      "CLOSE-FILE"
        .balign    8,0x00
CFILE:
        .quad    DOCOL
        .quad    CFILE+HEADSIZE
        .quad    0x0
        .quad    OFILE
        .quad    N_CFILE
        .quad    0
        .quad    0

        .quad      X, X
        .quad      LIT, close, XOS
        .quad      SEMIS
#
#
#
#
#


#  *******************
#  *   CREATE-FILE   *
#  *******************
#
        .balign    8,0x00
N_CREATEF:
        .quad      11
        .ASCII      "CREATE-FILE"
        .balign    8,0x00
CREATEF:
        .quad    DOCOL
        .quad    CREATEF+HEADSIZE
        .quad    0x0
        .quad    CFILE
        .quad    N_CREATEF
        .quad    0
        .quad    0

        .quad      TOR, TDUP, DFILE, DROP, ZEN
        .quad      LIT, 0755, FROMR, LIT, 8, RSHIFT, LXOR
        .quad      X
        .quad      LIT, creat, XOS
        .quad      LDUP, ZERO, MAX, SWAP, ZERO, MIN
        .quad      SEMIS
#
#
#
#


#  *******************
#  *   DELETE-FILE   *
#  *******************
#
        .balign    8,0x00
N_DFILE:
        .quad      11
        .ASCII      "DELETE-FILE"
        .balign    8,0x00
DFILE:
        .quad    DOCOL
        .quad    DFILE+HEADSIZE
        .quad    0x0
        .quad    CREATEF
        .quad    N_DFILE
        .quad    0
        .quad    0

        .quad      ZEN, X, X
        .quad      LIT, unlink, XOS
        .quad      SEMIS
#
#
#
#


#  *****************
#  *   READ-FILE   *
#  *****************
#
        .balign    8,0x00
N_RFILE:
        .quad      9
        .ASCII      "READ-FILE"
        .balign    8,0x00
RFILE:
        .quad    DOCOL
        .quad    RFILE+HEADSIZE
        .quad    0x0
        .quad    DFILE
        .quad    N_RFILE
        .quad    0
        .quad    0

        .quad      ROT, ROT
        .quad      LIT, read, XOS
        .quad      LDUP, ZERO, MAX, SWAP, ZERO, MIN
        .quad      SEMIS
# 
# 
# 
# 
#

#

#  *********************
#  *   FILE-POSITION   *
#  *********************
#
        .balign    8,0x00
N_FPFILE:
        .quad      13
        .ASCII      "FILE-POSITION"
        .balign    8,0x00
FPFILE:
        .quad    DOCOL
        .quad    FPFILE+HEADSIZE
        .quad    0x0
        .quad    RFILE
        .quad    N_FPFILE
        .quad    0
        .quad    0

        .quad      ZERO
        .quad      LIT, SEEK_CUR
        .quad      LIT, lseek, XOS
        .quad      ZERO     #Double precision return result
        .quad      OVER, LDUP
        .quad      NEGATE, LIT, 256, ULESS, LAND # Heuristic 
        .quad      SEMIS
 # 
#
#
#


#  ***********************
#  *   REPOSITION-FILE   *
#  ***********************
#
        .balign    8,0x00
N_PFILE:
        .quad      15
        .ASCII      "REPOSITION-FILE"
        .balign    8,0x00
PFILE:
        .quad    DOCOL
        .quad    PFILE+HEADSIZE
        .quad    0x0
        .quad    FPFILE
        .quad    N_PFILE
        .quad    0
        .quad    0

        .quad      TOR, DROP, FROMR   #Convert to single precision.
        .quad      SWAP
        .quad      LIT, SEEK_SET
        .quad      LIT, lseek, XOS
        .quad      ZERO, MIN
        .quad      SEMIS
 # 
#
#
#
#
# 

#  ****************
#  *   GET-FILE   *
#  ****************
#
        .balign    8,0x00
N_GETFILE:
        .quad      8
        .ASCII      "GET-FILE"
        .balign    8,0x00
GETFILE:
        .quad    DOCOL
        .quad    GETFILE+HEADSIZE
        .quad    0x0
        .quad    PFILE
        .quad    N_GETFILE
        .quad    0
        .quad    0

    .quad LALIGN
        .quad      TDUP, SCOMMA, DROP
        .quad      LIT, 'F'+(0x100*('i'+0x100*('L'+0x100*'e'))), COMMA #Magic number.
        .quad      ZERO, OFILE, THROW, TOR
        .quad      HERE, LDUP
        .quad      SPFET, HERE, LSUB
        .quad      LIT, 6, SLASH, LDUP, ALLOT
        .quad      LIT, 1000, LSUB
        .quad      RR, RFILE, THROW
        .quad      FROMR, CFILE, THROW
        .quad      TDUP, PLUS, LDP, STOR        # No allocation if it fails.
    .quad LALIGN
        .quad      SEMIS
#

#  ****************
#  *   PUT-FILE   *
#  ****************
#
        .balign    8,0x00
N_PUTFILE:
        .quad      8
        .ASCII      "PUT-FILE"
        .balign    8,0x00
PUTFILE:
        .quad    DOCOL
        .quad    PUTFILE+HEADSIZE
        .quad    0x0
        .quad    GETFILE
        .quad    N_PUTFILE
        .quad    0
        .quad    0

        .quad      ZERO
        .quad      CREATEF, THROW
        .quad      LDUP, TOR
        .quad      WFILE, THROW
        .quad      FROMR, CFILE, THROW
        .quad      SEMIS
#

#  ****************
#  *   INCLUDED   *
#  ****************
#
        .balign    8,0x00
N_INCLUDED:
        .quad      8
        .ASCII      "INCLUDED"
        .balign    8,0x00
INCLUDED:
        .quad    DOCOL
        .quad    INCLUDED+HEADSIZE
        .quad    0x0
        .quad    PUTFILE
        .quad    N_INCLUDED
        .quad    0
        .quad    0

        .quad      HERE, TOR
        .quad      LIT, GETFILE, CATCH
        .quad      LDUP
        .quad      ZBRAN
        .quad      INCLUD1-.-CW
        .quad      FROMR, LDP, STOR
        .quad      THROW
        .quad      BRAN
        .quad      INCLUD2-.-CW
INCLUD1:
        .quad      RDROP, DROP
INCLUD2:
        .quad      EVALUATE
        .quad      SEMIS
#

#  ***************
#  *   INCLUDE   *
#  ***************
#
        .balign    8,0x00
N_LINCLUD:
        .quad      7
        .ASCII      "INCLUDE"
        .balign    8,0x00
LINCLUD:
        .quad    DOCOL
        .quad    LINCLUD+HEADSIZE
        .quad    0x0
        .quad    INCLUDED
        .quad    N_LINCLUD
        .quad    0
        .quad    0

        .quad      LNAME, INCLUDED
        .quad      SEMIS
#

#  ******************
#  *   REFILL-TIB   *
#  ******************
#
        .balign    8,0x00
N_REFTIB:
        .quad      10
        .ASCII      "REFILL-TIB"
        .balign    8,0x00
REFTIB:
        .quad    DOCOL
        .quad    REFTIB+HEADSIZE
        .quad    0x0
        .quad    LINCLUD
        .quad    N_REFTIB
        .quad    0
        .quad    0

        .quad      REMAIND, FETCH, TOR
        .quad      TIB, FETCH, RR, PLUS
        .quad      LIT, TIBSIZE, RR, LSUB
        .quad      ZERO
        .quad      RFILE
        .quad      QERRUR
        .quad      LDUP, ZEQU, LIT, -EPIPE, LAND # Presumably end of pipe.
        .quad      QERRUR
        .quad      TIB, FETCH, SWAP, FROMR, PLUS
        .quad      REMAIND, TSTOR
        .quad      SEMIS
#
#
#
#

# All I/O goes through the modern device (Unix-standard)
# device I/O. Code fields are filled in during bootup. 
# Lower case labels starting with "c_.." are c-supplied facilities.

#  **************
#  *   ACCEPT   *
#  **************
#
        .balign    8,0x00
N_ACCEP:
        .quad      6
        .ASCII      "ACCEPT"
        .balign    8,0x00
ACCEP:
        .quad    DOCOL
        .quad    ACCEP+HEADSIZE
        .quad    0x0
        .quad    REFTIB
        .quad    N_ACCEP
        .quad    0
        .quad    0

        .quad      PACCEP
        .quad      TSWAP, ROT, MIN
        .quad      LDUP, TOR, LMOVE, FROMR
        .quad      SEMIS
#

#  ****************
#  *   (ACCEPT)   *
#  ****************
#
        .balign    8,0x00
N_PACCEP:
        .quad      8
        .ASCII      "(ACCEPT)"
        .balign    8,0x00
PACCEP:
        .quad    DOCOL
        .quad    PACCEP+HEADSIZE
        .quad    0x0
        .quad    ACCEP
        .quad    N_PACCEP
        .quad    0
        .quad    0

PACCEP2:
#        DC      NOLF
#        DC       LIT, 'a', EMIT
        .quad      REMAIND
        .quad      TFET
        .quad      LIT, ALF, SINDEX
        .quad      ZEQU
        .quad      ZBRAN
        .quad      PACCEP1-.-CW
#        DC      RETOBO
        .quad      REMAIND, TFET
        .quad      TIB, FETCH
        .quad      SWAP, LMOVE
        .quad      TIB, FETCH
        .quad      REMAIND, CELLP, STOR
        .quad      REFTIB
        .quad      BRAN
        .quad      PACCEP2-.-CW
PACCEP1:
#        DC      SPLOFF
        .quad      REMAIND, TFET
        .quad      LIT, ALF, SSLAS
        .quad      TSWAP, REMAIND, TSTOR
        .quad      SEMIS


#  ***********
#  *   KEY   *
#  ***********
#
        .balign    8,0x00
N_KEY:
        .quad      3
        .ASCII      "KEY"
        .balign    8,0x00
KEY:
        .quad    DOCOL
        .quad    KEY+HEADSIZE
        .quad    0x0
        .quad    PACCEP
        .quad    N_KEY
        .quad    0
        .quad    0

        .quad      ONE, LIT, RAWIO, STTERM # Do not wait for CR
        .quad      ZERO, SPFET     # Expect single key on stack
        .quad      ZERO            # Standard input
        .quad      SWAP, ONE       # Buffer and length
        .quad      LIT, read, XOS
        .quad      LDUP, QERRUR
        .quad      ZEQU, LIT, -EPIPE, LAND, QERRUR # Presumably end of pipe.
        .quad      ONE, LIT, RAWIO, STTERM       # Toggle back
        .quad      SEMIS
#

#  ************
#  *   KEY?   *
#  ************
#
        .balign    8,0x00
N_KEYQ:
        .quad      4
        .ASCII      "KEY?"
        .balign    8,0x00
KEYQ:
        .quad    DOCOL
        .quad    KEYQ+HEADSIZE
        .quad    0x0
        .quad    KEY
        .quad    N_KEYQ
        .quad    0
        .quad    0

        .quad      ZERO, LIT, RAWIO, STTERM
        .quad      ZERO, ZERO     # Time out of zero. See MS.
        .quad    LIT, TV, LSTOR, LIT, TV+4, LSTOR
        
        .quad      ONE # Waiting for standard in.
        .quad      LIT, RFDS, LSTOR
        .quad      ONE     # # of highest channel to watch.
        .quad      LIT, RFDS
        .quad      ZERO, ZERO  # Not output, not events.
        .quad      LIT, TV
        .quad      LIT, _newselect, XOS5
        .quad      LDUP,  QERRUR
        .quad      NEGATE        # 1 -> flag.
        .quad      ZERO, LIT, RAWIO, STTERM
        .quad      SEMIS
        .balign    8,0x00
RFDS:   .SPACE   (CW*(32))     #32 channels maximum.
#

#  ************
#  *   TYPE   *
#  ************
#
        .balign    8,0x00
N_LTYPE:
        .quad      4
        .ASCII      "TYPE"
        .balign    8,0x00
LTYPE:
        .quad    DOCOL
        .quad    LTYPE+HEADSIZE
        .quad    0x0
        .quad    KEYQ
        .quad    N_LTYPE
        .quad    0
        .quad    0

        .quad      LDUP, LOUT, PSTOR
        .quad      ONE, WFILE, THROW
        .quad      SEMIS
#

#  *************
#  *   ETYPE   *
#  *************
#
        .balign    8,0x00
N_ETYPE:
        .quad      5
        .ASCII      "ETYPE"
        .balign    8,0x00
ETYPE:
        .quad    DOCOL
        .quad    ETYPE+HEADSIZE
        .quad    0x0
        .quad    LTYPE
        .quad    N_ETYPE
        .quad    0
        .quad    0

        .quad      TWO, WFILE, THROW
        .quad      SEMIS
#

#  ************
#  *   EMIT   *
#  ************
#
        .balign    8,0x00
N_EMIT:
        .quad      4
        .ASCII      "EMIT"
        .balign    8,0x00
EMIT:
        .quad    DOCOL
        .quad    EMIT+HEADSIZE
        .quad    0x0
        .quad    ETYPE
        .quad    N_EMIT
        .quad    0
        .quad    0

        .quad      SPFET, ONE, LTYPE
        .quad      DROP
        .quad      SEMIS
#

#  **************
#  *   TERMIO   *
#  **************
#
        .balign    8,0x00
N_TERMIO:
        .quad      6
        .ASCII      "TERMIO"
        .balign    8,0x00
TERMIO:
        .quad    DOVAR
        .quad    TERMIO+HEADSIZE
        .quad    0x0
        .quad    EMIT
        .quad    N_TERMIO
        .quad    0
        .quad    0

        .SPACE   SIZE_TERMIO     # Filled in during cold boot.
#

#  ****************
#  *   SET-TERM   *
#  ****************
#
        .balign    8,0x00
N_STTERM:
        .quad      8
        .ASCII      "SET-TERM"
        .balign    8,0x00
STTERM:
        .quad    DOCOL
        .quad    STTERM+HEADSIZE
        .quad    0x0
        .quad    TERMIO
        .quad    N_STTERM
        .quad    0
        .quad    0

SIZEL   = 4     # Also for 64 bits. 
        .quad      LIT, (TERMIO+HEADSIZE)+SIZEL*3
        .quad      SWAP, TOGGL
        .quad      LIT, (TERMIO+HEADSIZE)+SIZEL*4+7
        .quad      CSTOR
        .quad      ZERO, LIT, TCSETS, TERMIO
        .quad      LIT, ioctl, XOS, QERRUR
        .quad      SEMIS
#
# 
#
#
#
#
#
#

        #
#------------------------------------
#       SYSTEM DEPENDANT DISK I/O
#------------------------------------

#  ******************
#  *   DISK-ERROR   *
#  ******************
#
        .balign    8,0x00
N_DERR:
        .quad      10
        .ASCII      "DISK-ERROR"
        .balign    8,0x00
DERR:
        .quad    DOVAR
        .quad    DERR+HEADSIZE
        .quad    0x0
        .quad    STTERM
        .quad    N_DERR
        .quad    0
        .quad    0

        .quad      -1
#


#  ******************
#  *   BLOCK-FILE   *
#  ******************
#
        .balign    8,0x00
N_BLFL:
        .quad      10
        .ASCII      "BLOCK-FILE"
        .balign    8,0x00
BLFL:
        .quad    DOVAR
        .quad    BLFL+HEADSIZE
        .quad    0x0
        .quad    DERR
        .quad    N_BLFL
        .quad    0
        .quad    0

        # Allow for some path, at most 80 char's
        .quad      80
        .ASCII      "forth.lab                                                                       "

#  ********************
#  *   BLOCK-HANDLE   *
#  ********************
#
        .balign    8,0x00
N_BHAN:
        .quad      12
        .ASCII      "BLOCK-HANDLE"
        .balign    8,0x00
BHAN:
        .quad    DOVAR
        .quad    BHAN+HEADSIZE
        .quad    0x0
        .quad    BLFL
        .quad    N_BHAN
        .quad    0
        .quad    0

        .quad      -1
#

#  *******************
#  *   ?DISK-ERROR   *
#  *******************
#
        .balign    8,0x00
N_QDSKER:
        .quad      11
        .ASCII      "?DISK-ERROR"
        .balign    8,0x00
QDSKER:
        .quad    DOCOL
        .quad    QDSKER+HEADSIZE
        .quad    0x0
        .quad    BHAN
        .quad    N_QDSKER
        .quad    0
        .quad    0

        .quad      LIT, 8, QERR
        .quad      SEMIS
#
#


#  ******************
#  *   BLOCK-INIT   *
#  ******************
#
        .balign    8,0x00
N_BLINI:
        .quad      10
        .ASCII      "BLOCK-INIT"
        .balign    8,0x00
BLINI:
        .quad    DOCOL
        .quad    BLINI+HEADSIZE
        .quad    0x0
        .quad    QDSKER
        .quad    N_BLINI
        .quad    0
        .quad    0

        .quad      BLFL, SFET, DTRAI
        .quad      ROT
        .quad      OFILE
        .quad      ZEQU, NEGATE  # 0 if disk problems, 1 if not.
        .quad      LWARN, FETCH, MIN # AND but WARNING is 0/1.
        .quad      LWARN, STOR
        .quad      BHAN, STOR
        .quad      MTBUF
        .quad      SEMIS
#

#  ******************
#  *   BLOCK-EXIT   *
#  ******************
#
        .balign    8,0x00
N_BLEXI:
        .quad      10
        .ASCII      "BLOCK-EXIT"
        .balign    8,0x00
BLEXI:
        .quad    DOCOL
        .quad    BLEXI+HEADSIZE
        .quad    0x0
        .quad    BLINI
        .quad    N_BLEXI
        .quad    0
        .quad    0

        .quad      FLUSH
        .quad      BHAN, FETCH
        .quad      CFILE
        .quad      ZERO, LWARN, STOR
        .quad      LIT, -1, BHAN, STOR    #Regardless of close errors.
        .quad      QDSKER
        .quad      SEMIS
#

#  **************
#  *   BLSEEK   *
#  **************
#
        .balign    8,0x00
N_BLSEEK:
        .quad      6
        .ASCII      "BLSEEK"
        .balign    8,0x00
BLSEEK:
        .quad    DOCOL
        .quad    BLSEEK+HEADSIZE
        .quad    0x0
        .quad    BLEXI
        .quad    N_BLSEEK
        .quad    0
        .quad    0

        .quad      BBUF
        .quad      USTAR
        .quad      BHAN, FETCH
        .quad      PFILE           # Disk position.
        .quad      QDSKER
        .quad      SEMIS
#

#  ******************
#  *   BLOCK-READ   *
#  ******************
#
        .balign    8,0x00
N_BLREAD:
        .quad      10
        .ASCII      "BLOCK-READ"
        .balign    8,0x00
BLREAD:
        .quad    DOCOL
        .quad    BLREAD+HEADSIZE
        .quad    0x0
        .quad    BLSEEK
        .quad    N_BLREAD
        .quad    0
        .quad    0

        .quad      BLSEEK # That's done
        .quad      BBUF
        .quad      BHAN, FETCH
        .quad      RFILE           # Disk read 
        .quad      SWAP, BBUF, UNEQ
        .quad      LOR, QDSKER
        .quad      SEMIS
#

#  *******************
#  *   BLOCK-WRITE   *
#  *******************
#
        .balign    8,0x00
N_BLWRITE:
        .quad      11
        .ASCII      "BLOCK-WRITE"
        .balign    8,0x00
BLWRITE:
        .quad    DOCOL
        .quad    BLWRITE+HEADSIZE
        .quad    0x0
        .quad    BLREAD
        .quad    N_BLWRITE
        .quad    0
        .quad    0

        .quad      BLSEEK # That's done
        .quad      BBUF
        .quad      BHAN, FETCH
        .quad      WFILE           # Disk write
        .quad      QDSKER
        .quad      SEMIS
#
#

#  *************
#  *   SHELL   *
#  *************
#
        .balign    8,0x00
N_SHELL:
        .quad      5
        .ASCII      "SHELL"
        .balign    8,0x00
SHELL:
        .quad    DOVAR
        .quad    SHELL+HEADSIZE
        .quad    0x0
        .quad    BLWRITE
        .quad    N_SHELL
        .quad    0
        .quad    0

         .quad      7
        .ASCII      "/bin/sh"
        
        
        .balign    8,0x00
        .SPACE   252# Allow for some path

#
#


#  **************
#  *   SYSTEM   *
#  **************
#
        .balign    8,0x00
N_SYSTEM:
        .quad      6
        .ASCII      "SYSTEM"
        .balign    8,0x00
SYSTEM:
        .quad    DOCOL
        .quad    SYSTEM+HEADSIZE
        .quad    0x0
        .quad    SHELL
        .quad    N_SYSTEM
        .quad    0
        .quad    0

        .quad      LIT, COMBUF, SSTOR, ZERO, LIT, COMBUF, CHAPP
        .quad      ZERO, SHELL, CHAPP, LIT, -1, SHELL, PSTOR
        .quad      X, X, X, LIT, fork, XOS
        .quad      LDUP, QERRUR
        .quad      LDUP, ZEQU
        .quad      ZBRAN
        .quad      SYSTEM1-.-CW
        .quad      SHELL, CELLP, LIT, SYSARGS
#  Get environment vector
      .quad      ARGS, FETCH, SFET, ONEP, LCELLS, PLUS
        .quad      LIT, execve, XOS
        .quad      LIT, 49, LERROR, BYE   # Returned, this is always wrong.
SYSTEM1:
        .quad      LDUP
        .quad      LIT, STATUS, ZERO, LIT, waitpid, XOS
        .quad      LDUP
        .quad      LIT, EINTR, EQUAL
        .quad      BRAN
        .quad      SYSTEM2-.-CW
        .quad      DROP
        .quad      ZBRAN
        .quad      SYSTEM1-.-CW
SYSTEM2:
        .quad      QERRUR
        .quad      TDROP
        .quad      SEMIS
#
        .balign    8,0x00
STATUS:  .quad     0
SYSARG2: .ASCII     "-c"
         .byte      0
        .balign    8,0x00
COMBUF:  .SPACE   CW+256  #One cell for high level string manipulation.
        .balign    8,0x00
SYSARGS:.quad   (SHELL+HEADSIZE)+CW, SYSARG2, COMBUF + CW, 0
#
 # 
#
#
#
#
# 
#
#
#
# 
# 
#


#  *********
#  *   '   *
#  *********
#
        .balign    8,0x00
N_ITICK:
        .quad      1
        .ASCII      "'"
        .balign    8,0x00
ITICK:
        .quad    DOCOL 
        .quad    ITICK+HEADSIZE
        .quad    0x0
        .quad    SYSTEM
        .quad    N_ITICK
        .quad    0
        .quad    0

        .quad      LNAME, PRESENT
        .quad      LDUP, ZEQU
        .quad      LIT, 11, QERR
        .quad      SEMIS
#

#  ***********
#  *   [']   *
#  ***********
#
        .balign    8,0x00
N_BTICK:
        .quad      3
        .ASCII      "[']"
        .balign    8,0x00
BTICK:
        .quad    DOCOL
        .quad    (TICK+HEADSIZE)
        .quad    B_IMMED
        .quad    ITICK
        .quad    N_BTICK
        .quad    0
        .quad    0

#
#

#  ******************
#  *   FORGET-VOC   *
#  ******************
#
        .balign    8,0x00
N_FORGV:
        .quad      10
        .ASCII      "FORGET-VOC"
        .balign    8,0x00
FORGV:
        .quad    DOCOL
        .quad    FORGV+HEADSIZE
        .quad    0x0
        .quad    BTICK
        .quad    N_FORGV
        .quad    0
        .quad    0

        .quad      TDUP
        .quad      SWAP
        .quad      ULESS
        .quad      ZBRAN
        .quad      FORGV1-.-CW
#  Forget part of contents.
        .quad      SWAP
        .quad      TOR
        .quad      TWID
FORGV0:
        .quad      LDUP
        .quad      LDUP
FORGV3:
        .quad      TLFA,FETCH
        .quad      LDUP
        .quad      RR
        .quad      ULESS
        .quad      ZBRAN
        .quad      FORGV3-.-CW
        .quad      SWAP            #  Not to be forgotten entry found.
        .quad      TLFA
        .quad      STOR           #  Short other entries out.
        .quad      TLFA,FETCH
        .quad      LDUP
        .quad      ZEQU
        .quad      ZBRAN
        .quad      FORGV0-.-CW        #  Repeat until end of wordlist.
        .quad      DROP
        .quad      FROMR
        .quad      BRAN
        .quad      FORGV2-.-CW
FORGV1:
#       { Vocabulary itself is also forgotten.}
        .quad      TVFA
        .quad      FETCH     # Unlink by linking next namespace.
        .quad      VOCL
        .quad      STOR
        .quad      ONLY, FORTH
        .quad      DEFIN
FORGV2: .quad      SEMIS
#

#  **************
#  *   FORGET   *
#  **************
#
        .balign    8,0x00
N_FORG:
        .quad      6
        .ASCII      "FORGET"
        .balign    8,0x00
FORG:
        .quad    DOCOL
        .quad    FORG+HEADSIZE
        .quad    0x0
        .quad    FORGV
        .quad    N_FORG
        .quad    0
        .quad    0

        .quad      TICK
        .quad      LDUP
        .quad      FENCE
        .quad      FETCH
        .quad      LESS
        .quad      LIT, 21, QERR
        .quad      LIT,FORGV
        .quad      FORV
        .quad      TNFA, FETCH, LDP, STOR
        .quad      SEMIS
#

#  *************
#  *   (BACK   *
#  *************
#
        .balign    8,0x00
N_PBACK:
        .quad      5
        .ASCII      "(BACK"
        .balign    8,0x00
PBACK:
        .quad    DOCOL
        .quad    PBACK+HEADSIZE
        .quad    0x0
        .quad    FORG
        .quad    N_PBACK
        .quad    0
        .quad    0

        .quad      HERE
        .quad      SEMIS
#

#  *************
#  *   BACK)   *
#  *************
#
        .balign    8,0x00
N_BACKP:
        .quad      5
        .ASCII      "BACK)"
        .balign    8,0x00
BACKP:
        .quad    DOCOL
        .quad    BACKP+HEADSIZE
        .quad    0x0
        .quad    PBACK
        .quad    N_BACKP
        .quad    0
        .quad    0

        .quad      HERE
        .quad      CELLP
        .quad      LSUB
        .quad      COMMA
        .quad      SEMIS
#

#  ****************
#  *   (FORWARD   *
#  ****************
#
        .balign    8,0x00
N_PFORWARD:
        .quad      8
        .ASCII      "(FORWARD"
        .balign    8,0x00
PFORWARD:
        .quad    DOCOL
        .quad    PFORWARD+HEADSIZE
        .quad    0x0
        .quad    BACKP
        .quad    N_PFORWARD
        .quad    0
        .quad    0

        .quad      HERE
        .quad      X
        .quad      COMMA
        .quad      SEMIS
#

#  ****************
#  *   FORWARD)   *
#  ****************
#
        .balign    8,0x00
N_FORWARDP:
        .quad      8
        .ASCII      "FORWARD)"
        .balign    8,0x00
FORWARDP:
        .quad    DOCOL
        .quad    FORWARDP+HEADSIZE
        .quad    0x0
        .quad    PFORWARD
        .quad    N_FORWARDP
        .quad    0
        .quad    0

        .quad      HERE
        .quad      OVER
        .quad      CELLP
        .quad      LSUB
        .quad      SWAP
        .quad      STOR
        .quad      SEMIS
#

#  *************
#  *   BEGIN   *
#  *************
#
        .balign    8,0x00
N_BEGIN:
        .quad      5
        .ASCII      "BEGIN"
        .balign    8,0x00
BEGIN:
        .quad    DOCOL
        .quad    BEGIN+HEADSIZE
        .quad    B_IMMED
        .quad    FORWARDP
        .quad    N_BEGIN
        .quad    0
        .quad    0

        .quad      PBACK
        .quad      QCOMP, ONE
        .quad      SEMIS
#

#  ************
#  *   THEN   *
#  ************
#
        .balign    8,0x00
N_THEN:
        .quad      4
        .ASCII      "THEN"
        .balign    8,0x00
THEN:
        .quad    DOCOL
        .quad    THEN+HEADSIZE
        .quad    B_IMMED
        .quad    BEGIN
        .quad    N_THEN
        .quad    0
        .quad    0

        .quad      QCOMP, TWO, QPAIR
        .quad      FORWARDP
        .quad      SEMIS
#

#  **********
#  *   DO   *
#  **********
#
        .balign    8,0x00
N_DO:
        .quad      2
        .ASCII      "DO"
        .balign    8,0x00
DO:
        .quad    DOCOL
        .quad    DO+HEADSIZE
        .quad    B_IMMED
        .quad    THEN
        .quad    N_DO
        .quad    0
        .quad    0

         .quad      LIT, XDO, COMMA, PFORWARD, PBACK
        .quad      QCOMP, LIT,3    # Magic number
        .quad      SEMIS
#

#  ***********
#  *   ?DO   *
#  ***********
#
        .balign    8,0x00
N_QDO:
        .quad      3
        .ASCII      "?DO"
        .balign    8,0x00
QDO:
        .quad    DOCOL
        .quad    QDO+HEADSIZE
        .quad    B_IMMED
        .quad    DO
        .quad    N_QDO
        .quad    0
        .quad    0

         .quad      LIT, XQDO, COMMA, PFORWARD, PBACK
        .quad      QCOMP, LIT,3    # Magic number
        .quad      SEMIS
#

#  ************
#  *   LOOP   *
#  ************
#
        .balign    8,0x00
N_LLOOP:
        .quad      4
        .ASCII      "LOOP"
        .balign    8,0x00
LLOOP:
        .quad    DOCOL
        .quad    LLOOP+HEADSIZE
        .quad    B_IMMED
        .quad    QDO
        .quad    N_LLOOP
        .quad    0
        .quad    0

        .quad      LIT, ONE, COMMA
        .quad      PLOOP
        .quad      SEMIS
#

#  *************
#  *   +LOOP   *
#  *************
#
        .balign    8,0x00
N_PLOOP:
        .quad      5
        .ASCII      "+LOOP"
        .balign    8,0x00
PLOOP:
        .quad    DOCOL
        .quad    PLOOP+HEADSIZE
        .quad    B_IMMED
        .quad    LLOOP
        .quad    N_PLOOP
        .quad    0
        .quad    0

        .quad      QCOMP, LIT, 3, QPAIR
        .quad      LIT, XPLOOP, COMMA
        .quad      LIT, ZBRAN, COMMA, BACKP     # Until 
        .quad      LIT, UNLOOP, COMMA
        .quad      FORWARDP # For DO to push the leave address.
        .quad      SEMIS
#

#  *************
#  *   UNTIL   *
#  *************
#
        .balign    8,0x00
N_UNTIL:
        .quad      5
        .ASCII      "UNTIL"
        .balign    8,0x00
UNTIL:
        .quad    DOCOL
        .quad    UNTIL+HEADSIZE
        .quad    B_IMMED
        .quad    PLOOP
        .quad    N_UNTIL
        .quad    0
        .quad    0

        .quad      QCOMP, ONE, QPAIR
        .quad      LIT, ZBRAN, COMMA, BACKP
        .quad      SEMIS
#

#  *************
#  *   AGAIN   *
#  *************
#
        .balign    8,0x00
N_AGAIN:
        .quad      5
        .ASCII      "AGAIN"
        .balign    8,0x00
AGAIN:
        .quad    DOCOL
        .quad    AGAIN+HEADSIZE
        .quad    B_IMMED
        .quad    UNTIL
        .quad    N_AGAIN
        .quad    0
        .quad    0

        .quad      QCOMP, ONE, QPAIR
        .quad      LIT, BRAN, COMMA, BACKP
        .quad      SEMIS
#

#  **************
#  *   REPEAT   *
#  **************
#
        .balign    8,0x00
N_REPEA:
        .quad      6
        .ASCII      "REPEAT"
        .balign    8,0x00
REPEA:
        .quad    DOCOL
        .quad    REPEA+HEADSIZE
        .quad    B_IMMED
        .quad    AGAIN
        .quad    N_REPEA
        .quad    0
        .quad    0

        .quad      QCOMP, ONE, QPAIR   # Matches BEGIN ?
        .quad      LIT, BRAN, COMMA, BACKP
        .quad      LIT, 4, QPAIR # Matches WHILE ?
        .quad      FORWARDP # WHILE target. 
        .quad      SEMIS
#

#  **********
#  *   IF   *
#  **********
#
        .balign    8,0x00
N_LIF:
        .quad      2
        .ASCII      "IF"
        .balign    8,0x00
LIF:
        .quad    DOCOL
        .quad    LIF+HEADSIZE
        .quad    B_IMMED
        .quad    REPEA
        .quad    N_LIF
        .quad    0
        .quad    0

        .quad      LIT, ZBRAN, COMMA, PFORWARD
        .quad      QCOMP, TWO     # Magic number
        .quad      SEMIS
#

#  ************
#  *   ELSE   *
#  ************
#
        .balign    8,0x00
N_LELSE:
        .quad      4
        .ASCII      "ELSE"
        .balign    8,0x00
LELSE:
        .quad    DOCOL
        .quad    LELSE+HEADSIZE
        .quad    B_IMMED
        .quad    LIF
        .quad    N_LELSE
        .quad    0
        .quad    0

        .quad      QCOMP, TWO, QPAIR
        .quad      LIT, BRAN, COMMA, PFORWARD
        .quad      SWAP
        .quad      FORWARDP
        .quad      TWO     # Magic number
        .quad      SEMIS
#

#  *************
#  *   WHILE   *
#  *************
#
        .balign    8,0x00
N_LWHILE:
        .quad      5
        .ASCII      "WHILE"
        .balign    8,0x00
LWHILE:
        .quad    DOCOL
        .quad    LWHILE+HEADSIZE
        .quad    B_IMMED
        .quad    LELSE
        .quad    N_LWHILE
        .quad    0
        .quad    0

        .quad      QCOMP, LDUP, ONE, QPAIR
        .quad      TOR    #  Save backward target. 
        .quad      TOR
        .quad      LIT, ZBRAN, COMMA, PFORWARD
        .quad      LIT, 4 # Magic number
        .quad      FROMR
        .quad      FROMR
        .quad      SEMIS
#

#  **************
#  *   SPACES   *
#  **************
#
        .balign    8,0x00
N_SPACES:
        .quad      6
        .ASCII      "SPACES"
        .balign    8,0x00
SPACES:
        .quad    DOCOL
        .quad    SPACES+HEADSIZE
        .quad    0x0
        .quad    LWHILE
        .quad    N_SPACES
        .quad    0
        .quad    0

        .quad      ZERO
        .quad      MAX
        .quad      ZERO
        .quad     XQDO
        .quad      SPAX1-.-CW
SPAX2:  .quad      SPACE
        .quad     ONE, XPLOOP, ZBRAN
        .quad      SPAX2-.-CW
        .quad      UNLOOP     #LOOP
SPAX1:
        .quad      SEMIS
#

#  **********
#  *   <#   *
#  **********
#
        .balign    8,0x00
N_BDIGS:
        .quad      2
        .ASCII      "<#"
        .balign    8,0x00
BDIGS:
        .quad    DOCOL
        .quad    BDIGS+HEADSIZE
        .quad    0x0
        .quad    SPACES
        .quad    N_BDIGS
        .quad    0
        .quad    0

        .quad      PAD
        .quad      HLD
        .quad      STOR
        .quad      SEMIS
#

#  **********
#  *   #>   *
#  **********
#
        .balign    8,0x00
N_EDIGS:
        .quad      2
        .ASCII      "#>"
        .balign    8,0x00
EDIGS:
        .quad    DOCOL
        .quad    EDIGS+HEADSIZE
        .quad    0x0
        .quad    BDIGS
        .quad    N_EDIGS
        .quad    0
        .quad    0

        .quad      DROP
        .quad      DROP
        .quad      HLD
        .quad      FETCH
        .quad      PAD
        .quad      OVER
        .quad      LSUB
        .quad      SEMIS
#

#  ************
#  *   SIGN   *
#  ************
#
        .balign    8,0x00
N_SIGN:
        .quad      4
        .ASCII      "SIGN"
        .balign    8,0x00
SIGN:
        .quad    DOCOL
        .quad    SIGN+HEADSIZE
        .quad    0x0
        .quad    EDIGS
        .quad    N_SIGN
        .quad    0
        .quad    0

        .quad      ZLESS
        .quad      ZBRAN
        .quad      SIGN1-.-CW #IF
        .quad      LIT, AMS
        .quad      HOLD    #THEN
SIGN1:  .quad      SEMIS
#

#  *********
#  *   #   *
#  *********
#
        .balign    8,0x00
N_DIG:
        .quad      1
        .ASCII      "#"
        .balign    8,0x00
DIG:
        .quad    DOCOL
        .quad    DIG+HEADSIZE
        .quad    0x0
        .quad    SIGN
        .quad    N_DIG
        .quad    0
        .quad    0

        .quad      BASE
        .quad      FETCH
        .quad      MSMOD
        .quad      ROT
        .quad      LIT,9
        .quad      OVER
        .quad      LESS
        .quad      ZBRAN
        .quad      DIG1-.-CW  #IF
        .quad      LIT,7
        .quad      PLUS    #THEN
DIG1:   .quad      LIT,0x30
        .quad      PLUS
        .quad      HOLD
        .quad      SEMIS
#

#  **********
#  *   #S   *
#  **********
#
        .balign    8,0x00
N_DIGS:
        .quad      2
        .ASCII      "#S"
        .balign    8,0x00
DIGS:
        .quad    DOCOL
        .quad    DIGS+HEADSIZE
        .quad    0x0
        .quad    DIG
        .quad    N_DIGS
        .quad    0
        .quad    0

DIGS1:  .quad      DIG     #BEGIN
        .quad      OVER
        .quad      OVER
        .quad      LOR
        .quad      ZEQU
        .quad      ZBRAN
        .quad      DIGS1-.-CW #UNTIL
        .quad      SEMIS
#

#  *************
#  *   (D.R)   *
#  *************
#
        .balign    8,0x00
N_PDDOTR:
        .quad      5
        .ASCII      "(D.R)"
        .balign    8,0x00
PDDOTR:
        .quad    DOCOL
        .quad    PDDOTR+HEADSIZE
        .quad    0x0
        .quad    DIGS
        .quad    N_PDDOTR
        .quad    0
        .quad    0

        .quad      TOR
        .quad      SWAP
        .quad      OVER
        .quad      DABS
        .quad      BDIGS
        .quad      DIGS
        .quad      ROT
        .quad      SIGN
        .quad      EDIGS
        .quad      FROMR
        .quad      OVER
        .quad      LSUB, ZERO, MAX
        .quad      ZERO
        .quad     XQDO
        .quad      PDDOT1-.-CW
PDDOT2:  .quad      LBL, HOLD  #WARNING: HOLD outside of #>.
        .quad     ONE, XPLOOP, ZBRAN
        .quad      PDDOT2-.-CW
        .quad      UNLOOP 
PDDOT1:
        .quad      EDIGS  #Drop string instead of number.
        .quad      SEMIS
#

#  ***********
#  *   D.R   *
#  ***********
#
        .balign    8,0x00
N_DDOTR:
        .quad      3
        .ASCII      "D.R"
        .balign    8,0x00
DDOTR:
        .quad    DOCOL
        .quad    DDOTR+HEADSIZE
        .quad    0x0
        .quad    PDDOTR
        .quad    N_DDOTR
        .quad    0
        .quad    0

        .quad      PDDOTR
        .quad      LTYPE
        .quad      SEMIS
#

#  **********
#  *   .R   *
#  **********
#
        .balign    8,0x00
N_DOTR:
        .quad      2
        .ASCII      ".R"
        .balign    8,0x00
DOTR:
        .quad    DOCOL
        .quad    DOTR+HEADSIZE
        .quad    0x0
        .quad    DDOTR
        .quad    N_DOTR
        .quad    0
        .quad    0

        .quad      TOR
        .quad      STOD
        .quad      FROMR
        .quad      DDOTR
        .quad      SEMIS
#

#  **********
#  *   D.   *
#  **********
#
        .balign    8,0x00
N_DDOT:
        .quad      2
        .ASCII      "D."
        .balign    8,0x00
DDOT:
        .quad    DOCOL
        .quad    DDOT+HEADSIZE
        .quad    0x0
        .quad    DOTR
        .quad    N_DDOT
        .quad    0
        .quad    0

        .quad      ZERO
        .quad      DDOTR
        .quad      SPACE
        .quad      SEMIS
#

#  *********
#  *   .   *
#  *********
#
        .balign    8,0x00
N_DOT:
        .quad      1
        .ASCII      "."
        .balign    8,0x00
DOT:
        .quad    DOCOL
        .quad    DOT+HEADSIZE
        .quad    0x0
        .quad    DDOT
        .quad    N_DOT
        .quad    0
        .quad    0

        .quad      STOD
        .quad      DDOT
        .quad      SEMIS
#

#  *********
#  *   ?   *
#  *********
#
        .balign    8,0x00
N_QUES:
        .quad      1
        .ASCII      "?"
        .balign    8,0x00
QUES:
        .quad    DOCOL
        .quad    QUES+HEADSIZE
        .quad    0x0
        .quad    DOT
        .quad    N_QUES
        .quad    0
        .quad    0

        .quad      FETCH
        .quad      DOT
        .quad      SEMIS
#

#  **********
#  *   U.   *
#  **********
#
        .balign    8,0x00
N_UDOT:
        .quad      2
        .ASCII      "U."
        .balign    8,0x00
UDOT:
        .quad    DOCOL
        .quad    UDOT+HEADSIZE
        .quad    0x0
        .quad    QUES
        .quad    N_UDOT
        .quad    0
        .quad    0

        .quad      ZERO
        .quad      DDOT
        .quad      SEMIS
#

#  *****************
#  *   FOR-WORDS   *
#  *****************
#
        .balign    8,0x00
N_FORW:
        .quad      9
        .ASCII      "FOR-WORDS"
        .balign    8,0x00
FORW:
        .quad    DOCOL
        .quad    FORW+HEADSIZE
        .quad    0x0
        .quad    UDOT
        .quad    N_FORW
        .quad    0
        .quad    0

        .quad      SWAP
        .quad      TOR
        .quad      TOR
FORW1:  .quad      FROMR
        .quad      RR
        .quad      OVER
        .quad      TLFA
        .quad      FETCH
        .quad      TOR
        .quad      EXEC
        .quad      RR
        .quad      ZEQU
        .quad      ZBRAN
        .quad      FORW1-.-CW
        .quad      RDROP
        .quad      RDROP
        .quad      SEMIS
#

#  ****************
#  *   FOR-VOCS   *
#  ****************
#
        .balign    8,0x00
N_FORV:
        .quad      8
        .ASCII      "FOR-VOCS"
        .balign    8,0x00
FORV:
        .quad    DOCOL
        .quad    FORV+HEADSIZE
        .quad    0x0
        .quad    FORW
        .quad    N_FORV
        .quad    0
        .quad    0

        .quad      TOR
        .quad      VOCL
        .quad      FETCH
        .quad      TOR
FORV1:  .quad      FROMR
        .quad      RR
        .quad      OVER
        .quad      TVFA
        .quad      FETCH
        .quad      TOR
        .quad      EXEC
        .quad      RR
        .quad      ZEQU
        .quad      ZBRAN
        .quad      FORV1-.-CW
        .quad      RDROP
        .quad      RDROP
        .quad      SEMIS
#

#  *************
#  *   WORDS   *
#  *************
#
        .balign    8,0x00
N_WORDS:
        .quad      5
        .ASCII      "WORDS"
        .balign    8,0x00
WORDS:
        .quad    DOCOL
        .quad    WORDS+HEADSIZE
        .quad    0x0
        .quad    FORV
        .quad    N_WORDS
        .quad    0
        .quad    0

        .quad      CSLL
        .quad      LOUT
        .quad      STOR
        .quad      ZERO            # End sentinel. 
        .quad      LIT, NOOP
        .quad      CONTEXT
        .quad      FETCH
        .quad      FORW
WORDS1:
        .quad      LDUP
        .quad      ZBRAN
        .quad      WORDS2-.-CW
        .quad      IDDOT
        .quad      BRAN
        .quad      WORDS1-.-CW
WORDS2:
        .quad DROP
        .quad      SEMIS
#
# 

#  *****************
#  *   EXIT-CODE   *
#  *****************
#
        .balign    8,0x00
N_XCODE:
        .quad      9
        .ASCII      "EXIT-CODE"
        .balign    8,0x00
XCODE:
        .quad    DOVAR
        .quad    XCODE+HEADSIZE
        .quad    0x0
        .quad    WORDS
        .quad    N_XCODE
        .quad    0
        .quad    0

        .quad      0
#
# 
# 


#  ***********
#  *   BYE   *
#  ***********
#
        .balign    8,0x00
N_BYE:
        .quad      3
        .ASCII      "BYE"
        .balign    8,0x00
BYE:
        .quad    DOCOL
        .quad    BYE+HEADSIZE
        .quad    0x0
        .quad    XCODE
        .quad    N_BYE
        .quad    0
        .quad    0

# Exit to linux, with status as stored. 
        .quad      XCODE, FETCH, X, X, LIT, exit, XOS
        .quad      SEMIS   #Unnecessary, but helpful for decompilation.
# 
#

#  ************
#  *   LIST   *
#  ************
#
        .balign    8,0x00
N_LLIST:
        .quad      4
        .ASCII      "LIST"
        .balign    8,0x00
LLIST:
        .quad    DOCOL
        .quad    LLIST+HEADSIZE
        .quad    0x0
        .quad    BYE
        .quad    N_LLIST
        .quad    0
        .quad    0

        .quad      BASE, FETCH, TOR
        .quad      DECA
        .quad      SCR,STOR

        .quad      SKIP
         .quad      6
SB5: .ASCII      "SCR # "
       .balign    8,0x00
        .quad      LIT, SB5
        .quad      LIT, 6
        .quad      LTYPE
        .quad      SCR, FETCH, DOT
        .quad      SCR, FETCH, BLOCK, BBUF

        .quad      LIT, 16, ZERO
        .quad     XDO
        .quad      LLIST9-.-CW
LLIST1: .quad      LIT, ALF, SSLAS
        .quad      CR, IDO, LIT, 2, DOTR
        .quad      SPACE, LTYPE
        .quad     ONE, XPLOOP, ZBRAN
        .quad      LLIST1-.-CW
        .quad      UNLOOP 
LLIST9:
        .quad      TDROP
        .quad      FROMR, BASE, STOR
        .quad      SEMIS
#

#  *************
#  *   INDEX   *
#  *************
#
        .balign    8,0x00
N_INDEX:
        .quad      5
        .ASCII      "INDEX"
        .balign    8,0x00
INDEX:
        .quad    DOCOL
        .quad    INDEX+HEADSIZE
        .quad    0x0
        .quad    LLIST
        .quad    N_INDEX
        .quad    0
        .quad    0

        .quad      LIT,AFF
        .quad      EMIT,CR
        .quad      ONEP,SWAP
        .quad     XDO
        .quad      INDE9-.-CW
INDE1:  .quad      CR,IDO
        .quad      LIT,3
        .quad      DOTR,SPACE
        .quad      ZERO,IDO
        .quad      PLINE, LTYPE
        .quad     ONE, XPLOOP, ZBRAN
        .quad      INDE1-.-CW
        .quad      UNLOOP 
INDE9:
        .quad      SEMIS
#

#  **********
#  *   .S   *
#  **********
#
        .balign    8,0x00
N_DOTS:
        .quad      2
        .ASCII      ".S"
        .balign    8,0x00
DOTS:
        .quad    DOCOL
        .quad    DOTS+HEADSIZE
        .quad    0x0
        .quad    INDEX
        .quad    N_DOTS
        .quad    0
        .quad    0

        .quad      CR
        .quad      LIT, 'S', EMIT
        .quad      LIT, ASO, EMIT
        .quad      SPACE
        .quad      SPFET, SZERO, FETCH
DOC2:   .quad      OVER, OVER,  LSUB, ZLESS
        .quad      ZBRAN
        .quad      DOC1-.-CW
        .quad      ZERO, CELLP, LSUB, LDUP, FETCH, DOT
        .quad      BRAN
        .quad      DOC2-.-CW
DOC1:    .quad DROP, DROP
        .quad      LIT, ASC, EMIT
        .quad SEMIS
#

#  ********************
#  *   ENVIRONMENT?   *
#  ********************
#
        .balign    8,0x00
N_ENVQ:
        .quad      12
        .ASCII      "ENVIRONMENT?"
        .balign    8,0x00
ENVQ:
        .quad    DOCOL
        .quad    ENVQ+HEADSIZE
        .quad    0x0
        .quad    DOTS
        .quad    N_ENVQ
        .quad    0
        .quad    0

        .quad      LIT, ENV, TWID, PFIND
        .quad      TOR, TDROP, FROMR
        .quad      LDUP
        .quad      ZBRAN
        .quad      ENVQ1-.-CW
        .quad      EXEC
        .quad      LIT, -1
ENVQ1:
        .quad      SEMIS
#


# 
#
#
# This word is not even fig!

#  ***************
#  *   .SIGNON   *
#  ***************
#
        .balign    8,0x00
N_SIGNON:
        .quad      7
        .ASCII      ".SIGNON"
        .balign    8,0x00
SIGNON:
        .quad    DOCOL
        .quad    SIGNON+HEADSIZE
        .quad    0x0
        .quad    ENVQ
        .quad    N_SIGNON
        .quad    0
        .quad    0

# PRINT CPU TYPE (8088)
        .quad      CR
        .quad      BASE,FETCH
        .quad      LIT,36, BASE,STOR
        .quad      LCPU, DDOT
        .quad      BASE,STOR
#
        .quad      LENAME, LTYPE, SPACE
        .quad      LVERSION, LTYPE, SPACE
        .quad      CR
        .quad      SEMIS
#
# 
#
#**** LAST DICTIONARY WORD ****

#  ************
#  *   TASK   *
#  ************
#
        .balign    8,0x00
N_TASK:
        .quad      4
        .ASCII      "TASK"
        .balign    8,0x00
TASK:
        .quad    DOCOL
        .quad    TASK+HEADSIZE
        .quad    0x0
        .quad    SIGNON
        .quad    N_TASK
        .quad    0
        .quad    0

        .quad      SEMIS
#
 #  

 /* 

The remaining memory ( up to 'EM' ) is
used for:

        1. EXTENSION DICTIONARY
        2. DATA STACK
        3. TERMINAL INPUT BUFFER
        4. RETURN STACK
        5. USER VARIABLE AREA
        6. BUFFERS FOR SCREENS/FILES


 */ 


#       This is the proper way to do it.
#       No memory addresses should be arrived at through equates.
#       However now we must teach the linker to keep the
#       two sections together.

FORTHSIZE       =     . - _main
            .section .dict,"awx",@nobits

INITDP:                 #  It may be that it is not consecutive with TASK.
                        #  Because of bad linking, resulting in a unusable Forth.
        BUFFERSIZE      =  (KBBUF+2*CW)*NBUF

# For more task the TAS area is duplicated; the remainder is the same.
        .SPACE   EM - FORTHSIZE - TAS - BUFFERSIZE 
# INITR1:                         Return stack for next task
#          .SPACE   US              #  For next task, if present. 
# The following framework may be repeated for more tasks.
# It is floating, i.e. it may be shifted up and down, in order
# to have INITR0 at a STACKSIZE boundary. 
        .SPACE   STACKSIZE   # Data stack, only limited if more tasks present.
INITS0:                         # Grows down.
STRTIB: .SPACE   TIBSIZE     # Terminal input buffer.
        .SPACE   STACKSIZE       # Return stack, grows down.
INITR0:                         # Grows down
STRUSA: .SPACE   US              # User area
        .SPACE   STACKSIZE - US   # Spare user area 
        .SPACE   STACKSIZE             # Possibly the framework is shifted up by this.
 BUF1:   .SPACE   BUFFERSIZE      # FIRST DISK BUFFER
ACTUAL_EM:  # Differs from EM if code is relocated.

# 
#

# 
        #
 /* 

  MISC. NOTES AND SCATTERED THOUGHTS

- Remember that all the FORTH words in this version are
  upper case letters.  Use <CAPS LOCK> when in FORTH.

# 

- Subscribe to FORTH Dimensions.  It is a valuable source
  of system and application ideas.  Talking with fellow
  FORTH programmers is sure to stir up some exciting ideas.
  Consider joining a FIG chapter.  See the back of FORTH
  Dimensions for more info.

 */ 

# Define the entry point, not valid for auto booting.
        
        # _ORIG


























#





