wip: a forth for linux x86_64 systems
Find a file
2026-02-17 02:28:42 +11:00
.gitattributes attempt at correct language detection 2026-01-20 19:28:56 +11:00
.gitignore gitignore, makefile 2026-01-19 23:26:42 +11:00
jefs.fs variable 2026-02-17 02:28:42 +11:00
jefs.s else 2026-02-17 02:15:22 +11:00
Makefile shut up error because i dont care 2026-02-14 02:15:58 +11:00
readme.md port some comparison n logic words from jf 2026-02-16 23:33:25 +11:00

jewelforth

it's a subroutine threaded forth for linux x86_64. mostly made for personal stuff. it does not conform to any standards, i just implement what i want. if you use it and it breaks, too bad

public domain

dictionary

the dictionary follows a fairly standard format.

field size forth name
link to previous 8 bytes LFA (link field address)
flag 1 byte FFA (flag field address)
string length 2 bytes NFA (name field address)
string variable length still NFA
code variable length CFA (code field address)

the one reserved register

the working stack pointer is r14. the other registers are used as general purpose registers; r11 in particular is the standard register used in compiling calls.

miscellaneous notes and stuff

COMPILE,

this is an STC forth so when we compile a call we have to write the bytes of a call in manually. x86_64 does not allow absolute jumps from an immediate address, so a wonky but hopefully not too slow solution is to compile literal address → W and then call W. It'll Be Fine?

  • mov r11, [cfa] = 94 BB [CFA]
  • call r11 = 41 FF D3

silly little plans

in-forth assembler

this would reap the most benefits from STC. probably look at dusk's assemblers for how it should look like or liek something liek dusk's lib/bm? idk something to do stuff Fast if u need. would be fun