Code Monkey home page Code Monkey logo

subleq's Introduction

16-bit SUBLEQ eForth

If you feel like supporting the project you can buy a book from Amazon, available here that describes how the project works and how to port a Forth to a new platform.

This project contains a working (self-hosting) Forth interpreter that runs on top of a SUBLEQ 16-bit machine. SUBLEQ machines belong to the class of One Instruction Set Computers, they only execute a single instruction but are still Turing Complete. The Forth system, specifically a variant of eForth, is provided as subleq.dec, passing this image to the tiny (~ 600 bytes) SUBLEQ C virtual machine allows you to run eForth on the machine. For a list of commands type "words" and hit enter, numbers are entered using Reverse Polish Notation, eg. "2 2 + . cr" prints "4", and new functions can be defined like so:

: hello cr ." Hello, World" ;

Be careful with the spaces, they matter, after typing that in, type "hello" and hit enter. A Forth tutorial will not be provided here. Many Forth words are defined including the bitwise words.

To build and run you will need a C compiler and Make, type "make run", failing that:

cc subleq.c -o subleq
./subleq subleq.dec

The system is self hosting, that is it can generate new eForth images using the current eForth image and the eForth source code. This is done like so:

./subleq subleq.dec < subleq.fth > new-image.dec

There is a website available that runs an interactive SUBLEQ interpreter in the browser in case you do not want to both compiling things, it is available at https://github.com/howerj/subleq-js. Or if you just want to try it out directly https://howerj.github.io/subleq.htm.

Happy hacking, and a shiny penny for anyone that manages to do something useful with this project!

Other SUBLEQ projects

References

subleq's People

Contributors

howerj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

subleq's Issues

Bootable subleq eForth

Hi, as an exercice to port a more complete colorForth to bare metal x86, I managed to embed (really easily) and boot subleq eForth in qemu-x86.

The embedded version is here: https://github.com/pbrochard/subleq/tree/subleq-eForthOS/embed (not very interesting but it was the first step before booting subleq eForth).

The bootable version is here: https://github.com/pbrochard/subleq/tree/subleq-eForthOS/boot

It's more an assembler exercice than a subleq/eForth one.
Feel free to ask for or create a pull request if you think it's valuable (same licence as subleq eForth).

Many many thanks for your book. It's pure poetry!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.