Browse Source

Forth fixups, improvement and documentation updates

patch
b1ackmai1er 4 years ago
parent
commit
6d1b61c7a3
  1. 25
      Source/Doc/ROM_Applications.md
  2. 12
      Source/Forth/camel80.azm
  3. 4
      Source/Forth/cameltst.azm

25
Source/Doc/ROM_Applications.md

@ -234,7 +234,7 @@ For those are who are not familiar with Forth, I recommend the
wikipedia article (en.wikipedia.org/wiki/Forth_(programming_language)) wikipedia article (en.wikipedia.org/wiki/Forth_(programming_language))
and the Forth Interest Group website [www.forth.org](www.forth.org) and the Forth Interest Group website [www.forth.org](www.forth.org)
Important things to know:
## Important things to know
Forth is case sensitive. Forth is case sensitive.
@ -244,16 +244,12 @@ To get a list of available words type ***WORDS***
To reset Forth to its initial state type ***COLD*** To reset Forth to its initial state type ***COLD***
Most code you will find on the internet will not run without modification.
Most of the code you find on the internet will not run unless modified or additional Forth
words are added to the dictionary.
This implementation does not support loading or saving of programs. All programs This implementation does not support loading or saving of programs. All programs
need to be typed in. Additionally, screen editing and code blocks are not supported. need to be typed in. Additionally, screen editing and code blocks are not supported.
Extensions and changes to this implementation compared to the original distribution are:
Source code has been converted from Z80mr assembler to Hector Peraza's zsm.
## Structure of Forth source files ## Structure of Forth source files
File | Description File | Description
@ -261,13 +257,22 @@ File | Description
camel80.azm | Code Primitives camel80.azm | Code Primitives
camel80d.azm | CPU Dependencies camel80d.azm | CPU Dependencies
camel80h.azm | High Level words camel80h.azm | High Level words
camel80r.asm | ROMWBW additions
camel80r.azm | ROMWBW additions
glosshi.txt | Glossary of high level words glosshi.txt | Glossary of high level words
glosslo.txt | Glossary of low level words glosslo.txt | Glossary of low level words
## ROMWBW Additons
## ROMWBW Additions
Extensions and changes to this implementation compared to the original distribution are:
The source code has been converted from Z80mr assembler to Hector Peraza's zsm.
An additional file camel80r.azm has been added for including additional words to
the dictionary at build time. However, as currently configured there is very little space
allocated for addition words. Exceeding the allocated ROM space will generate an error
message when building.
James Bowman's Double precision words have been added from his RC2014 version:
James Bowman's double precision words have been added from his RC2014 version:
(https://github.com/jamesbowman/camelforth-z80) (https://github.com/jamesbowman/camelforth-z80)
Word | Syntax | Description Word | Syntax | Description

12
Source/Forth/camel80.azm

@ -1071,15 +1071,21 @@ snext: next
INCLUDE camel80d.azm ; CPU Dependencies INCLUDE camel80d.azm ; CPU Dependencies
INCLUDE camel80h.azm ; High Level words INCLUDE camel80h.azm ; High Level words
;INCLUDE camel80r.azm ; ROMWBW additions
INCLUDE camel80r.azm ; ROMWBW additions
;INCLUDE cameltst.azm ; Test Functions ;INCLUDE cameltst.azm ; Test Functions
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
; force padding to page boundary ; force padding to page boundary
ds (FTH_SIZ-(enddict-reset)-1)
nop
IF ((enddict-reset) GT FTH_SIZ)
IF2
FORTH SIZE ERROR
ENDIF
ELSE
ds (FTH_SIZ-(enddict-reset)-1)
nop
ENDIF
.DEPHASE .DEPHASE
END END

4
Source/Forth/cameltst.azm

@ -18,7 +18,7 @@
; =============================================== ; ===============================================
;Z >< u1 -- u2 swap the bytes of TOS ;Z >< u1 -- u2 swap the bytes of TOS
head SWAB,2,><,docode
head SWAB,2,!>!<,docode
ld a,b ld a,b
ld b,c ld b,c
ld c,a ld c,a
@ -45,7 +45,7 @@
next next
;Z >HEX c1 -- c2 convert nybble to hex char ;Z >HEX c1 -- c2 convert nybble to hex char
head TOHEX,4,>HEX,docode
head TOHEX,4,!>HEX,docode
ld a,c ld a,c
sub 0ah sub 0ah
jr c,numeric jr c,numeric

Loading…
Cancel
Save