Browse Source

camel Forth build changes and fixes

;   19-Oct 19 v1.02 Convert to zsm assembler which
;                   identified and fixed incorrect
;                   case conversion when lowercase
;                   keywords are being passed in a
;                   macro. Remove Z80MR assembler
pull/50/head
b1ackmai1er 6 years ago
parent
commit
1ee2167c2a
  1. 6
      Source/Forth/Build.cmd
  2. 2
      Source/Forth/Clean.cmd
  3. 69
      Source/Forth/camel80.azm
  4. 18
      Source/Forth/camel80d.azm
  5. 48
      Source/Forth/camel80h.azm
  6. BIN
      Tools/cpm/bin/Z80MR.COM
  7. BIN
      Tools/cpm/bin/ZSM.COM

6
Source/Forth/Build.cmd

@ -11,5 +11,7 @@ set ZXBINDIR=%TOOLS%/cpm/bin/
set ZXLIBDIR=%TOOLS%/cpm/lib/ set ZXLIBDIR=%TOOLS%/cpm/lib/
set ZXINCDIR=%TOOLS%/cpm/include/ set ZXINCDIR=%TOOLS%/cpm/include/
zx z80mr camel80
zx MLOAD25 -camel80.bin=camel80.hex
zx zsm =camel80.azm
zx link -CAMEL80.BIN=CAMEL80

2
Source/Forth/Clean.cmd

@ -5,3 +5,5 @@ if exist *.bin del *.bin
if exist *.lst del *.lst if exist *.lst del *.lst
if exist *.prn del *.prn if exist *.prn del *.prn
if exist *.hex del *.hex if exist *.hex del *.hex
if exist *.rel del *.rel
if exist *.sym del *.sym

69
Source/Forth/camel80.azm

@ -60,6 +60,12 @@ FTH_LOC EQU 0200h
; 05 Nov 18 v1.02 Initial ROMWBW HBIOS version. ; 05 Nov 18 v1.02 Initial ROMWBW HBIOS version.
; 10-Nov 18 v1.02 New org address. ; 10-Nov 18 v1.02 New org address.
; b1ackmai1er difficultylevelhigh@gmail.com ; b1ackmai1er difficultylevelhigh@gmail.com
; 19-Oct 19 v1.02 Convert to zsm assembler which
; identified and fixed incorrect
; case conversion when lowercase
; keywords are being passed in a
; macro.
; b1ackmai1er difficultylevelhigh@gmail.com
; =============================================== ; ===============================================
; Macros to define Forth headers ; Macros to define Forth headers
; HEAD label,length,name,action ; HEAD label,length,name,action
@ -75,25 +81,25 @@ FTH_LOC EQU 0200h
DOCODE EQU 0 ; flag to indicate CODE words DOCODE EQU 0 ; flag to indicate CODE words
link DEFL 0 ; link to previous Forth word link DEFL 0 ; link to previous Forth word
head MACRO #label,#length,#name,#action
head MACRO label,length,name,action
DW link DW link
DB 0 DB 0
link DEFL $ link DEFL $
DB #length,'#name'
#label:
IF .NOT.(#action=DOCODE)
call #action
DB length,"&name"
label:
IFF (action EQ DOCODE)
call action
ENDIF ENDIF
ENDM ENDM
immed MACRO #label,#length,#name,#action
immed MACRO label,length,name,action
DW link DW link
DB 1 DB 1
link DEFL $ link DEFL $
DB #length,'#name'
#label:
IF .NOT.(#action=DOCODE)
call #action
DB length,"&name"
label:
IFF (action EQ DOCODE)
call action
ENDIF ENDIF
ENDM ENDM
@ -123,8 +129,10 @@ nexthl MACRO
; ...are not used in the CP/M implementation ; ...are not used in the CP/M implementation
; Instead, we have the... ; Instead, we have the...
; CP/M ENTRY POINT
org FTH_LOC ; Execute address
; RELOCATED ENTRY POINT
.PHASE 0200H
reset: ld hl,0FDFFh ; HBIOS address, rounded down reset: ld hl,0FDFFh ; HBIOS address, rounded down
ld l,0 ; = end of avail.mem (EM) ld l,0 ; = end of avail.mem (EM)
dec h ; EM-100h dec h ; EM-100h
@ -384,7 +392,7 @@ poptos: pop bc
DW SWOP,OVER,EXIT DW SWOP,OVER,EXIT
;C >R x -- R: -- x push to return stack ;C >R x -- R: -- x push to return stack
head TOR,2,>R,docode
head TOR,2,!>R,docode
dec ix ; push TOS onto rtn stk dec ix ; push TOS onto rtn stk
ld (ix+0),b ld (ix+0),b
dec ix dec ix
@ -393,7 +401,7 @@ poptos: pop bc
next next
;C R> -- x R: x -- pop from return stack ;C R> -- x R: x -- pop from return stack
head RFROM,2,R>,docode
head RFROM,2,R!>,docode
push bc ; push old TOS push bc ; push old TOS
ld c,(ix+0) ; pop top rtn stk item ld c,(ix+0) ; pop top rtn stk item
inc ix ; to TOS inc ix ; to TOS
@ -418,7 +426,7 @@ poptos: pop bc
next next
;Z SP! a-addr -- set data stack pointer ;Z SP! a-addr -- set data stack pointer
head SPSTORE,3,SP!,docode
head SPSTORE,3,SP!!,docode
ld h,b ld h,b
ld l,c ld l,c
ld sp,hl ld sp,hl
@ -433,7 +441,7 @@ poptos: pop bc
next next
;Z RP! a-addr -- set return stack pointer ;Z RP! a-addr -- set return stack pointer
head RPSTORE,3,RP!,docode
head RPSTORE,3,RP!!,docode
push bc push bc
pop ix pop ix
pop bc pop bc
@ -442,7 +450,7 @@ poptos: pop bc
; MEMORY AND I/O OPERATIONS ===================== ; MEMORY AND I/O OPERATIONS =====================
;C ! x a-addr -- store cell in memory ;C ! x a-addr -- store cell in memory
head STORE,1,!,docode
head STORE,1,!!,docode
ld h,b ; address in hl ld h,b ; address in hl
ld l,c ld l,c
pop bc ; data in bc pop bc ; data in bc
@ -453,7 +461,7 @@ poptos: pop bc
next next
;C C! char c-addr -- store char in memory ;C C! char c-addr -- store char in memory
head CSTORE,2,C!,docode
head CSTORE,2,C!!,docode
ld h,b ; address in hl ld h,b ; address in hl
ld l,c ld l,c
pop bc ; data in bc pop bc ; data in bc
@ -478,7 +486,7 @@ poptos: pop bc
next next
;Z PC! char c-addr -- output char to port ;Z PC! char c-addr -- output char to port
head PCSTORE,3,PC!,docode
head PCSTORE,3,PC!!,docode
pop hl ; char in L pop hl ; char in L
out (c),l ; to port (BC) out (c),l ; to port (BC)
pop bc ; pop new TOS pop bc ; pop new TOS
@ -588,7 +596,7 @@ mplus1: pop de ; restore saved IP
next next
;Z >< x1 -- x2 swap bytes (not ANSI) ;Z >< x1 -- x2 swap bytes (not ANSI)
head swapbytes,2,><,docode
head swapbytes,2,!>!<,docode
ld a,b ld a,b
ld b,c ld b,c
ld c,a ld c,a
@ -632,7 +640,7 @@ rsh2: djnz rsh1
next next
;C +! n/u a-addr -- add cell to memory ;C +! n/u a-addr -- add cell to memory
head PLUSSTORE,2,+!,docode
head PLUSSTORE,2,+!!,docode
pop hl pop hl
ld a,(bc) ; low byte ld a,(bc) ; low byte
add a,l add a,l
@ -657,7 +665,7 @@ rsh2: djnz rsh1
next next
;C 0< n -- flag true if TOS negative ;C 0< n -- flag true if TOS negative
head ZEROLESS,2,0<,docode
head ZEROLESS,2,0!<,docode
sla b ; sign bit -> cy flag sla b ; sign bit -> cy flag
sbc a,a ; propagate cy through A sbc a,a ; propagate cy through A
ld b,a ; put 0000 or FFFF in TOS ld b,a ; put 0000 or FFFF in TOS
@ -674,11 +682,11 @@ tosfalse: ld bc,0
next next
;X <> x1 x2 -- flag test not eq (not ANSI) ;X <> x1 x2 -- flag test not eq (not ANSI)
head NOTEQUAL,2,<>,docolon
head NOTEQUAL,2,!<!>,docolon
DW EQUAL,ZEROEQUAL,EXIT DW EQUAL,ZEROEQUAL,EXIT
;C < n1 n2 -- flag test n1<n2, signed ;C < n1 n2 -- flag test n1<n2, signed
head LESS,1,<,docode
head LESS,1,!<,docode
pop hl pop hl
or a or a
sbc hl,bc ; n1-n2 in HL, SZVC valid sbc hl,bc ; n1-n2 in HL, SZVC valid
@ -695,11 +703,11 @@ revsense: jp m,tosfalse ; OV: if -ve, reslt false
jr tostrue ; if +ve, result true jr tostrue ; if +ve, result true
;C > n1 n2 -- flag test n1>n2, signed ;C > n1 n2 -- flag test n1>n2, signed
head GREATER,1,>,docolon
head GREATER,1,!>,docolon
DW SWOP,LESS,EXIT DW SWOP,LESS,EXIT
;C U< u1 u2 -- flag test u1<n2, unsigned ;C U< u1 u2 -- flag test u1<n2, unsigned
head ULESS,2,U<,docode
head ULESS,2,U!<,docode
pop hl pop hl
or a or a
sbc hl,bc ; u1-u2 in HL, SZVC valid sbc hl,bc ; u1-u2 in HL, SZVC valid
@ -709,7 +717,7 @@ revsense: jp m,tosfalse ; OV: if -ve, reslt false
next next
;X U> u1 u2 -- flag u1>u2 unsgd (not ANSI) ;X U> u1 u2 -- flag u1>u2 unsgd (not ANSI)
head UGREATER,2,U>,docolon
head UGREATER,2,U!>,docolon
DW SWOP,ULESS,EXIT DW SWOP,ULESS,EXIT
; LOOP AND BRANCH OPERATIONS ==================== ; LOOP AND BRANCH OPERATIONS ====================
@ -949,7 +957,7 @@ cmovedone: exx
;X CMOVE> c-addr1 c-addr2 u -- move from top ;X CMOVE> c-addr1 c-addr2 u -- move from top
; as defined in the ANSI optional String word set ; as defined in the ANSI optional String word set
head CMOVEUP,6,CMOVE>,docode
head CMOVEUP,6,CMOVE!>,docode
push bc push bc
exx exx
pop bc ; count pop bc ; count
@ -1048,8 +1056,8 @@ sdiff: ; mismatch! undo last 'cpi' increment
ld c,a ld c,a
snext: next snext: next
*INCLUDE camel80d.azm ; CPU Dependencies
*INCLUDE camel80h.azm ; High Level words
INCLUDE camel80d.azm ; CPU Dependencies
INCLUDE camel80h.azm ; High Level words
lastword EQU link ; nfa of last word in dict. lastword EQU link ; nfa of last word in dict.
enddict EQU $ ; user's code starts here enddict EQU $ ; user's code starts here
@ -1057,6 +1065,7 @@ enddict EQU $ ; user's code starts here
ds (FTH_SIZ-(enddict-reset)-1) ds (FTH_SIZ-(enddict-reset)-1)
nop nop
.DEPHASE
END END

18
Source/Forth/camel80d.azm

@ -74,7 +74,7 @@ noop: next
;C >BODY xt -- a-addr adrs of param field ;C >BODY xt -- a-addr adrs of param field
; 3 + ; Z80 (3 byte CALL) ; 3 + ; Z80 (3 byte CALL)
head TOBODY,5,>BODY,docolon
head TOBODY,5,!>BODY,docolon
DW LIT,3,PLUS,EXIT DW LIT,3,PLUS,EXIT
;X COMPILE, xt -- append execution token ;X COMPILE, xt -- append execution token
@ -82,7 +82,7 @@ noop: next
; it is defined in the ANSI standard as COMPILE,. ; it is defined in the ANSI standard as COMPILE,.
; On a DTC Forth this simply appends xt (like , ) ; On a DTC Forth this simply appends xt (like , )
; but on an STC Forth this must append 'CALL xt'. ; but on an STC Forth this must append 'CALL xt'.
head COMMAXT,8,'COMPILE,',docode
head COMMAXT,8,COMPILE!,,docode
jp COMMA jp COMMA
;Z !CF adrs cfa -- set code action of a word ;Z !CF adrs cfa -- set code action of a word
@ -90,13 +90,13 @@ noop: next
; 1+ ! ; Z80 VERSION ; 1+ ! ; Z80 VERSION
; Depending on the implementation this could ; Depending on the implementation this could
; append CALL adrs or JUMP adrs. ; append CALL adrs or JUMP adrs.
head STORECF,3,!CF,docolon
head STORECF,3,!!CF,docolon
DW LIT,0CDH,OVER,CSTORE DW LIT,0CDH,OVER,CSTORE
DW ONEPLUS,STORE,EXIT DW ONEPLUS,STORE,EXIT
;Z ,CF adrs -- append a code field ;Z ,CF adrs -- append a code field
; HERE !CF 3 ALLOT ; Z80 VERSION (3 bytes) ; HERE !CF 3 ALLOT ; Z80 VERSION (3 bytes)
head COMMACF,3,',CF',docolon
head COMMACF,3,!,CF,docolon
DW HERE,STORECF,LIT,3,ALLOT,EXIT DW HERE,STORECF,LIT,3,ALLOT,EXIT
;Z !COLON -- change code field to docolon ;Z !COLON -- change code field to docolon
@ -104,7 +104,7 @@ noop: next
; This should be used immediately after CREATE. ; This should be used immediately after CREATE.
; This is made a distinct word, because on an STC ; This is made a distinct word, because on an STC
; Forth, colon definitions have no code field. ; Forth, colon definitions have no code field.
head STORCOLON,6,'!COLON',docolon
head STORCOLON,6,!!COLON,docolon
DW LIT,-3,ALLOT DW LIT,-3,ALLOT
DW LIT,docolon,COMMACF,EXIT DW LIT,docolon,COMMACF,EXIT
@ -112,7 +112,7 @@ noop: next
; ['] EXIT ,XT ; ; ['] EXIT ,XT ;
; This is made a distinct word, because on an STC ; This is made a distinct word, because on an STC
; Forth, it appends a RET instruction, not an xt. ; Forth, it appends a RET instruction, not an xt.
head CEXIT,5,',EXIT',docolon
head CEXIT,5,!,EXIT,docolon
DW LIT,EXIT,COMMAXT,EXIT DW LIT,EXIT,COMMAXT,EXIT
; CONTROL STRUCTURES ============================ ; CONTROL STRUCTURES ============================
@ -123,21 +123,21 @@ noop: next
; xt is the branch operator to use, e.g. qbranch ; xt is the branch operator to use, e.g. qbranch
; or (loop). It does NOT append the destination ; or (loop). It does NOT append the destination
; address. On the Z80 this is equivalent to ,XT. ; address. On the Z80 this is equivalent to ,XT.
head COMMABRANCH,7,',BRANCH',docode
head COMMABRANCH,7,!,BRANCH,docode
jp COMMA jp COMMA
;Z ,DEST dest -- append a branch address ;Z ,DEST dest -- append a branch address
; This appends the given destination address to ; This appends the given destination address to
; the branch instruction. On the Z80 this is ',' ; the branch instruction. On the Z80 this is ','
; ...other CPUs may use relative addressing. ; ...other CPUs may use relative addressing.
head COMMADEST,5,',DEST',docode
head COMMADEST,5,!,DEST,docode
jp COMMA jp COMMA
;Z !DEST dest adrs -- change a branch dest'n ;Z !DEST dest adrs -- change a branch dest'n
; Changes the destination address found at 'adrs' ; Changes the destination address found at 'adrs'
; to the given 'dest'. On the Z80 this is '!' ; to the given 'dest'. On the Z80 this is '!'
; ...other CPUs may need relative addressing. ; ...other CPUs may need relative addressing.
head STOREDEST,5,'!DEST',docode
head STOREDEST,5,!!DEST,docode
jp STORE jp STORE
; HEADER STRUCTURE ============================== ; HEADER STRUCTURE ==============================

48
Source/Forth/camel80h.azm

@ -56,7 +56,7 @@
;C >IN -- a-addr holds offset into TIB ;C >IN -- a-addr holds offset into TIB
; 2 USER >IN ; 2 USER >IN
head TOIN,3,>IN,douser
head TOIN,3,!>IN,douser
dw 2 dw 2
;C BASE -- a-addr holds conversion radix ;C BASE -- a-addr holds conversion radix
@ -132,7 +132,7 @@ TICKSOURCE: call douser ; in name!
;C S>D n -- d single -> double prec. ;C S>D n -- d single -> double prec.
; DUP 0< ; ; DUP 0< ;
head STOD,3,S>D,docolon
head STOD,3,S!>D,docolon
dw DUP,ZEROLESS,EXIT dw DUP,ZEROLESS,EXIT
;Z ?NEGATE n1 n2 -- n3 negate n1 if n2 negative ;Z ?NEGATE n1 n2 -- n3 negate n1 if n2 negative
@ -254,7 +254,7 @@ MIN1: dw DROP,EXIT
;C 2! x1 x2 a-addr -- store 2 cells ;C 2! x1 x2 a-addr -- store 2 cells
; SWAP OVER ! CELL+ ! ; ; SWAP OVER ! CELL+ ! ;
; the top of stack is stored at the lower adrs ; the top of stack is stored at the lower adrs
head TWOSTORE,2,2!,docolon
head TWOSTORE,2,2!!,docolon
dw SWOP,OVER,STORE,CELLPLUS,STORE,EXIT dw SWOP,OVER,STORE,CELLPLUS,STORE,EXIT
;C 2DROP x1 x2 -- drop 2 cells ;C 2DROP x1 x2 -- drop 2 cells
@ -348,25 +348,25 @@ TYP5: DW EXIT
;Z (S") -- c-addr u run-time code for S" ;Z (S") -- c-addr u run-time code for S"
; R> COUNT 2DUP + ALIGNED >R ; ; R> COUNT 2DUP + ALIGNED >R ;
head XSQUOTE,4,(S"),docolon
head XSQUOTE,4,(S""!),docolon
DW RFROM,COUNT,TWODUP,PLUS,ALIGNED,TOR DW RFROM,COUNT,TWODUP,PLUS,ALIGNED,TOR
DW EXIT DW EXIT
;C S" -- compile in-line string ;C S" -- compile in-line string
; COMPILE (S") [ HEX ] ; COMPILE (S") [ HEX ]
; 22 WORD C@ 1+ ALIGNED ALLOT ; IMMEDIATE ; 22 WORD C@ 1+ ALIGNED ALLOT ; IMMEDIATE
immed SQUOTE,2,S",docolon
immed SQUOTE,2,S"",docolon
DW LIT,XSQUOTE,COMMAXT DW LIT,XSQUOTE,COMMAXT
DW LIT,22H,WORD,CFETCH,ONEPLUS DW LIT,22H,WORD,CFETCH,ONEPLUS
DW ALIGNED,ALLOT,EXIT DW ALIGNED,ALLOT,EXIT
;C ." -- compile string to print ;C ." -- compile string to print
; POSTPONE S" POSTPONE TYPE ; IMMEDIATE ; POSTPONE S" POSTPONE TYPE ; IMMEDIATE
immed DOTQUOTE,2,.",docolon
immed DOTQUOTE,2,."",docolon
DW SQUOTE DW SQUOTE
DW LIT,TYPE,COMMAXT DW LIT,TYPE,COMMAXT
DW EXIT DW EXIT
; NUMERIC OUTPUT ================================ ; NUMERIC OUTPUT ================================
; Numeric conversion is done l.s.digit first, so ; Numeric conversion is done l.s.digit first, so
; the output buffer is built backwards in memory. ; the output buffer is built backwards in memory.
@ -394,12 +394,12 @@ TYP5: DW EXIT
;C <# -- begin numeric conversion ;C <# -- begin numeric conversion
; PAD HP ! ; (initialize Hold Pointer) ; PAD HP ! ; (initialize Hold Pointer)
head LESSNUM,2,<#,docolon
head LESSNUM,2,!<#,docolon
DW PAD,HP,STORE,EXIT DW PAD,HP,STORE,EXIT
;Z >digit n -- c convert to 0..9A..Z ;Z >digit n -- c convert to 0..9A..Z
; [ HEX ] DUP 9 > 7 AND + 30 + ; ; [ HEX ] DUP 9 > 7 AND + 30 + ;
head TODIGIT,6,>DIGIT,docolon
head TODIGIT,6,!>DIGIT,docolon
DW DUP,LIT,9,GREATER,LIT,7,AND,PLUS DW DUP,LIT,9,GREATER,LIT,7,AND,PLUS
DW LIT,30H,PLUS,EXIT DW LIT,30H,PLUS,EXIT
@ -417,7 +417,7 @@ NUMS1: DW NUM,TWODUP,OR,ZEROEQUAL,qbranch,NUMS1
;C #> ud1 -- c-addr u end conv., get string ;C #> ud1 -- c-addr u end conv., get string
; 2DROP HP @ PAD OVER - ; ; 2DROP HP @ PAD OVER - ;
head NUMGREATER,2,#>,docolon
head NUMGREATER,2,#!>,docolon
DW TWODROP,HP,FETCH,PAD,OVER,MINUS,EXIT DW TWODROP,HP,FETCH,PAD,OVER,MINUS,EXIT
;C SIGN n -- add minus sign if n<0 ;C SIGN n -- add minus sign if n<0
@ -434,7 +434,7 @@ SIGN1: DW EXIT
;C . n -- display n signed ;C . n -- display n signed
; <# DUP ABS 0 #S ROT SIGN #> TYPE SPACE ; ; <# DUP ABS 0 #S ROT SIGN #> TYPE SPACE ;
head DOT,1,'.',docolon
head DOT,1,.,docolon
DW LESSNUM,DUP,ABS,LIT,0,NUMS DW LESSNUM,DUP,ABS,LIT,0,NUMS
DW ROT,SIGN,NUMGREATER,TYPE,SPACE,EXIT DW ROT,SIGN,NUMGREATER,TYPE,SPACE,EXIT
@ -465,12 +465,12 @@ SIGN1: DW EXIT
;C , x -- append cell to dict ;C , x -- append cell to dict
; HERE ! 1 CELLS ALLOT ; ; HERE ! 1 CELLS ALLOT ;
head COMMA,1,',',docolon
head COMMA,1,!,,docolon
dw HERE,STORE,lit,1,CELLS,ALLOT,EXIT dw HERE,STORE,lit,1,CELLS,ALLOT,EXIT
;C C, char -- append char to dict ;C C, char -- append char to dict
; HERE C! 1 CHARS ALLOT ; ; HERE C! 1 CHARS ALLOT ;
head CCOMMA,2,'C,',docolon
head CCOMMA,2,C!,,docolon
dw HERE,CSTORE,lit,1,CHARS,ALLOT,EXIT dw HERE,CSTORE,lit,1,CHARS,ALLOT,EXIT
; INTERPRETER =================================== ; INTERPRETER ===================================
@ -491,7 +491,7 @@ SIGN1: DW EXIT
;Z >counted src n dst -- copy to counted str ;Z >counted src n dst -- copy to counted str
; 2DUP C! CHAR+ SWAP CMOVE ; ; 2DUP C! CHAR+ SWAP CMOVE ;
head TOCOUNTED,8,>COUNTED,docolon
head TOCOUNTED,8,!>COUNTED,docolon
DW TWODUP,CSTORE,CHARPLUS,SWOP,CMOVE,EXIT DW TWODUP,CSTORE,CHARPLUS,SWOP,CMOVE,EXIT
;C WORD char -- c-addr n word delim'd by char ;C WORD char -- c-addr n word delim'd by char
@ -516,12 +516,12 @@ WORD1: DW RFROM,RFROM,ROT,MINUS,TOIN,PLUSSTORE
;Z NFA>LFA nfa -- lfa name adr -> link field ;Z NFA>LFA nfa -- lfa name adr -> link field
; 3 - ; ; 3 - ;
head NFATOLFA,7,NFA>LFA,docolon
head NFATOLFA,7,NFA!>LFA,docolon
DW LIT,3,MINUS,EXIT DW LIT,3,MINUS,EXIT
;Z NFA>CFA nfa -- cfa name adr -> code field ;Z NFA>CFA nfa -- cfa name adr -> code field
; COUNT 7F AND + ; mask off 'smudge' bit ; COUNT 7F AND + ; mask off 'smudge' bit
head NFATOCFA,7,NFA>CFA,docolon
head NFATOCFA,7,NFA!>CFA,docolon
DW COUNT,LIT,07FH,AND,PLUS,EXIT DW COUNT,LIT,07FH,AND,PLUS,EXIT
;Z IMMED? nfa -- f fetch immediate flag ;Z IMMED? nfa -- f fetch immediate flag
@ -599,7 +599,7 @@ QSIGN1: DW EXIT
; R> M+ 2SWAP ; R> M+ 2SWAP
; 1 /STRING ; 1 /STRING
; REPEAT ; ; REPEAT ;
head TONUMBER,7,>NUMBER,docolon
head TONUMBER,7,!>NUMBER,docolon
TONUM1: DW DUP,qbranch,TONUM3 TONUM1: DW DUP,qbranch,TONUM3
DW OVER,CFETCH,DIGITQ DW OVER,CFETCH,DIGITQ
DW ZEROEQUAL,qbranch,TONUM2,DROP,EXIT DW ZEROEQUAL,qbranch,TONUM2,DROP,EXIT
@ -701,7 +701,7 @@ QABO1: DW TWODROP,EXIT
;C ABORT" i*x 0 -- i*x R: j*x -- j*x x1=0 ;C ABORT" i*x 0 -- i*x R: j*x -- j*x x1=0
;C i*x x1 -- R: j*x -- x1<>0 ;C i*x x1 -- R: j*x -- x1<>0
; POSTPONE S" POSTPONE ?ABORT ; IMMEDIATE ; POSTPONE S" POSTPONE ?ABORT ; IMMEDIATE
immed ABORTQUOTE,6,ABORT",docolon
immed ABORTQUOTE,6,ABORT"",docolon
DW SQUOTE DW SQUOTE
DW LIT,QABORT,COMMAXT DW LIT,QABORT,COMMAXT
DW EXIT DW EXIT
@ -753,14 +753,14 @@ TICK: call docolon
; R> adrs of headless DOES> def'n ; R> adrs of headless DOES> def'n
; LATEST @ NFA>CFA code field to fix up ; LATEST @ NFA>CFA code field to fix up
; !CF ; ; !CF ;
head XDOES,7,(DOES>),docolon
head XDOES,7,(DOES!>),docolon
DW RFROM,LATEST,FETCH,NFATOCFA,STORECF DW RFROM,LATEST,FETCH,NFATOCFA,STORECF
DW EXIT DW EXIT
;C DOES> -- change action of latest def'n ;C DOES> -- change action of latest def'n
; COMPILE (DOES>) ; COMPILE (DOES>)
; dodoes ,CF ; IMMEDIATE ; dodoes ,CF ; IMMEDIATE
immed DOES,5,DOES>,docolon
immed DOES,5,DOES!>,docolon
DW LIT,XDOES,COMMAXT DW LIT,XDOES,COMMAXT
DW LIT,dodoes,COMMACF,EXIT DW LIT,dodoes,COMMACF,EXIT
@ -807,7 +807,7 @@ TICK: call docolon
;C ; ;C ;
; REVEAL ,EXIT ; REVEAL ,EXIT
; POSTPONE [ ; IMMEDIATE ; POSTPONE [ ; IMMEDIATE
immed SEMICOLON,1,';',docolon
immed SEMICOLON,1,!;,docolon
DW REVEAL,CEXIT DW REVEAL,CEXIT
DW LEFTBRACKET,EXIT DW LEFTBRACKET,EXIT
@ -911,12 +911,12 @@ POST2: DW EXIT
;Z >L x -- L: -- x move to leave stack ;Z >L x -- L: -- x move to leave stack
; CELL LP +! LP @ ! ; (L stack grows up) ; CELL LP +! LP @ ! ; (L stack grows up)
head TOL,2,>L,docolon
head TOL,2,!>L,docolon
DW CELL,LP,PLUSSTORE,LP,FETCH,STORE,EXIT DW CELL,LP,PLUSSTORE,LP,FETCH,STORE,EXIT
;Z L> -- x L: x -- move from leave stack ;Z L> -- x L: x -- move from leave stack
; LP @ @ CELL NEGATE LP +! ; ; LP @ @ CELL NEGATE LP +! ;
head LFROM,2,L>,docolon
head LFROM,2,L!>,docolon
DW LP,FETCH,FETCH DW LP,FETCH,FETCH
DW CELL,NEGATE,LP,PLUSSTORE,EXIT DW CELL,NEGATE,LP,PLUSSTORE,EXIT
@ -1020,7 +1020,7 @@ DOTS2: DW EXIT
DW UINIT,U0,NINIT,CMOVE DW UINIT,U0,NINIT,CMOVE
; DW LIT,80h,COUNT,INTERPRET ; DW LIT,80h,COUNT,INTERPRET
DW XSQUOTE DW XSQUOTE
DB 55,'Z80 CamelForth v1.02 25 Jan 1995, ROMWBW 10 Nov 2018'
DB 55,'Z80 CamelForth v1.02 25 Jan 1995, ROMWBW 19 Oct 2019'
DB 0dh,0ah DB 0dh,0ah
DW TYPE,ABORT ; ABORT never returns DW TYPE,ABORT ; ABORT never returns
; DON'T FORGET TO UPDATE THE BYTE COUNT IF YOU CHANCGE THE SIZE OF THE BOOT MSG ; DON'T FORGET TO UPDATE THE BYTE COUNT IF YOU CHANCGE THE SIZE OF THE BOOT MSG

BIN
Tools/cpm/bin/Z80MR.COM

Binary file not shown.

BIN
Tools/cpm/bin/ZSM.COM

Binary file not shown.
Loading…
Cancel
Save