Jason (jcreed) wrote,
Jason
jcreed

Jonesforth is a very small forth interpreter written in about ~2k lines of x86 asm and ~2k lines of forth. The asm is actually overwhelmingly comments, with lovingly drawn ascii-art memory diagrams. It's a wonderful piece of literate programming.

You only really need the two files jonesforth.S and jonesforth.f, and then you do
$ gcc -m32 -nostdlib -static -Wl,--build-id=none -o jonesforth jonesforth.S
$ cat jonesforth.f - | ./jonesforth 
and you're good to go. Try typing
2 3 + .
and you should get [SPOILER WARNING!] 5.

The instructions in jonesforth.S itself say to also include the flag "-Wl,-Ttext,0" but when I do this, I get "Killed" immediately upon running ./jonesforth. Even when I gdb and breakpoint at _start. Anybody know why? Does this have to do with address space randomization or something?
Tags: forth, programming
Subscribe

  • (no subject)

    Cat vs. Fence. WHO WILL WIN? Cat is very agile, but... In other news, Lulu copy of thesis just arrived today, and it looks great! Score one more…

  • (no subject)

    Ok, kids, if you want to blow $40+shipping on a color* copy of my thesis I'm not stopping you. *The cover is color no matter what, but this version…

  • (no subject)

    Recently constructed things: First attempt at Lulu-ing thesis. I have ordered a copy for myself to make sure it looks ok. Made a song with tom7…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 8 comments