Browse Source

Forth fixups, improvement and documentation updates

pull/242/head
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))
and the Forth Interest Group website [www.forth.org](www.forth.org)
Important things to know:
## Important things to know
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***
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
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
File | Description
@ -261,13 +257,22 @@ File | Description
camel80.azm | Code Primitives
camel80d.azm | CPU Dependencies
camel80h.azm | High Level words
camel80r.asm | ROMWBW additions
camel80r.azm | ROMWBW additions
glosshi.txt | Glossary of high 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)
Word | Syntax | Description

12
Source/Forth/camel80.azm

@ -1071,15 +1071,21 @@ snext: next
INCLUDE camel80d.azm ; CPU Dependencies
INCLUDE camel80h.azm ; High Level words
;INCLUDE camel80r.azm ; ROMWBW additions
INCLUDE camel80r.azm ; ROMWBW additions
;INCLUDE cameltst.azm ; Test Functions
lastword EQU link ; nfa of last word in dict.
enddict EQU $ ; user's code starts here
; 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
END

4
Source/Forth/cameltst.azm

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

Loading…
Cancel
Save