Cross-compiled 6502 Forth, using ACME assembler. Non-standard, but matches Forth 2012 when possible.
Usage: ./htfc code.fs ; acme code.asm
The resulting code.prg runs the user-defined word named start.
Since this is a cross-compiled Forth, rather than a true Forth, many important compiling words are missing:
[ ] ' find immediate literal postpone state does> >body evaluate source >in word
: ; :code ;code value hex
1+ 2+ 1- + -
= 0= and
! @ c! c@ fill
drop rot swap over dup 2dup
begin again if else then
- 1234 - decimal
- #1234 - decimal
- $d020 - hexadecimal
- MSB = top of MSB parameter stack
- LSB = top of LSB parameter stack
- W = zero-page work area cell
Code words are defined using ACME assembler:
:code incbg
- inc $d020
jmp - ;code