Skip to content

iri/fcc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A minimal and simple Forth compiler for a FASM-based tool chain.

FC is a minimal compiler that supports a Forth syntax.
Its initial purpose was to be a pedagogical tool for learning about compilers.
It has morphed into a serious attempt at a minimal but useful full-fledged compiler.
The compiler currently does a minimal amount of error checking.
It generates assembly code for the FASM assembler.

How it works

Since FC generates assembly code for FASM, forward branches are a non-issue.
FC breaks the input stream into a stream of tokens.
The parser generates a simple IRL.
The IRL is then used to generate assembly code.

fcc.c: the forth compiler

  • This takes a source file as the only argument.
  • If no argument is given, it reads the source from STDIN.
  • The output is FASM assembly, written to STDOUT.
  • Any fatal errors are written to STDERR.

Running:

make test 

About

FCC - A FASM compiler for Forth

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 86.4%
  • Assembly 10.3%
  • Makefile 3.3%