Skip to content

martihomssoler/goburin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Goburin

My personal family of "goblin" programming languages and systems.

Caution

This projects is not stable yet!

Previous Code

Right now I'm following a different path and overhauling the whole project. If you want to take a look at the old Rust code, check-out Rust Branch.

Bootstrapping Goburin Forth

Primitives

  • :: start a word definition
  • ;: end a word definition
  • +: add two integers
  • -: subtract two integers
  • *: multiply two integers
  • /: divide two integers
  • @: read the value of a cell (8 bytes) from memory
  • !: write a value to a cell (8 bytes) in memory
  • <0: put true (1) on the stack if current top of the stack is equal to zero, otherwise put false (0).
  • ps@: get the current value of the parameter stack pointer
  • ps!: write a new address to the parameter stack pointer
  • rs@: get the current value of the return stack pointer
  • rs!: write a new address to the parameter stack pointer
  • lsr: logical right shift an integer
  • and: bitwise AND two integers
  • mem: give the pointer to the start of user memory
  • ?exit: exit current word if the top of stack is true (non zero)
  • syscall0-syscall6: perform a Linux system call with 0 to 6 arguments.

All primitives have been implemented in Assembly, right now I'm working on bootstrapping the project in Forth.

Two Stacks

  • rbp and rsp: hold the data stack and the address stack
  • r15: holds the pointer to the memory block

Info Links

Inspiration

Other Links

About

My personal family of "goblin" programming languages and systems.

Resources

Stars

Watchers

Forks