Forth Word - ;CODE

  Some parts of this page/site are currently incomplete & will be updated asap
  Other parts will change continually so use “Refresh” in your browser !!
  There is extensive use of “Tooltips” text to support learning which do not seem to render on a Smartphone. This site is best viewed via a computer’s HD monitor


;CODE P,C

Used in the form:

cccc …. ;CODE

assembly mnemonics Stop compilation and terminate a new defining word cccc by compiling (;CODE). Set the CONTEXT vocabulary to ASSEMBLER, assembling to machine code the following mnemonics

When cccc later executes in the form:

cccc nnnn

the word nnnn will be created with its execution procedure given by the machine code following cccc

That is, when nnnn is executed, it does so by jumping to the code after nnnn. An existing defining word must exist in cc prior to ;CODE

NFA:    006BA3 C5               DB   0C5H
        006BA4 3B434F44         DB   ";COD"
        006BA8 C5               DB   'E'+80H
LFA:    006BA9 8B6B             DW   PSCOD-10
CFA:    006BAB 3C28      SEMIC: DW   DOCOL
PFA:    006BAD EF6A             DW   QCSP		;   ?CSP
        006BAF 0B6B             DW   COMP		;   COMPILE
        006BB1 956B             DW   PSCOD		;   (;CODE)
        006BB3 236B             DW   LBRAC		;   [
        006BB5 6528             DW   NOOP		;   NOOP	     (patch with assembler voc)
        006BB7 1725             DW   SEMIS

The Meaning of the Dictionary Fields:

NFALFACFAPFA

(;CODE)
“The run-time procedure, compiled by ;CODE, that rewrites the code field of the most recently defined word to point to the following machine code sequence. See ;CODE” below

NFA:    006B8B 87               DB   87H
        006B8C 283B434F 4445    DB   "(;CODE"
        006B92 A9               DB   ')'+80H
LFA:    006B93 786B             DW   BIN-9
CFA:    006B95 3C28      PSCOD:	DW   DOCOL
PFA:    006B97 C925             DW	FROMR		;   R>
        006B99 2F6A             DW	LATES		;   LATEST
        006B9B 6D6A 4D6A        DW	PFA,CFA		;   PFA CFA
        006B9F F027             DW	STORE		;   !
        006BA1 1725             DW	SEMIS

jjkhnj

;CODE                                P,C
        Used in the form:

        : cccc .... ;CODE  assembly mnemonics

        Stop compilation and terminate a new defining word cccc by compiling (;CODE)
        Set the CONTEXT vocabulary to ASSEMBLER, assembling to machine code the following mnemonics.

        When cccc later executes in the form:

                cccc nnnn

        the word nnnn will be created with its execution procedure given by the machine code following
        cccc. That is, when nnnn is executed, it does so jumping to the code after nnnn
        An existing defining word must exist in cccc prior to ;CODE

;CODE P,C

Used in the form:
ecce •••• ;CODE assembly mnemonics Stop compilation and terminate a new defining word ecce by compiling (;CODE). Set the CONTEXT vocabulary to ASSEMBLER, assembling to machine code the following mnemonics. When ecce later executes in the form: ecce nnnn th word nnnn will be created with its execution cedure given by the machine code following c. That is, when nnnn is executed, it does so jumping to the code after nnnn. An existing ining word must exist in ecce prior to ;CODE.

Example: USER CONSTANT ;CODE D INX XCHG ME MOV 0 D MVI UP LHLD D DAD HPUSH JMP END-CODE In this example, after the USER variable is given a name in a colon definition, we switch to the ASSEMBLER which is not included in this implementation but is referenced by the C R 0 ss-e 0 M PILE R. This begins the specification of the run-time activity for USER variables. Comment: This ideogram functions like DOES>, except that the generated offspring’s code address is redirected to usable machine c:ode rather than to a call to the subroutine, DODOES. It should be included as part of an ASSEMBLER vocabulary


Updated: 31st August 2022 by David Husband
© 2021 David Husband, a.k.a. Baremetal Engineer Extraordinaire
All Rights Reserved – All Trademarks & Copyrights Acknowledged
All personal information is subject to the Data Protection Act 2018 & the UK GDPR
“ad auxilium aliis ad auxilium sibi”