Giter VIP home page Giter VIP logo

asmforth's Introduction

ASMFORTH

This is an experimental Machine Forth for the TI-99. It uses Forth-like syntax but is really an Assembler. Many of the words are just aliases of the Forth assembler in Camel99 Forth. Although the syntax looks like Forth the significant difference is that registers are referenced explicity for maximum performance. The data stack and return stack are still available to the programmer however.

This Assembler was created when comparing the performance on the Byte Magazine Sieve of Erasthones benchmark using conventional Forth and an 9900 Assembly language version. Camel99 Forth performed ten iterations in 120 seconds. Using a "just-in-time" compiler and a number of other optimizations the fastest speed I could achieve with Forth was 38 seconds.

A C program compiled with GCC clocked in at 13 seconds. An Assembly language version of program did the same job in 10 seconds.

So the stack VM paradigm just adds too many instructions to really fly on the old 9900. When each instruction can use 14 to 28 clock cycles, every extra instruction is a killer.

See the demo folder for an example of the sieve benchmark in Camel99 Forth and in ASMForth. The ASMForth version runs in 9.25 seconds.

Features

  • Used like a Forth Assembler but with Forth-like syntax
  • Seamless integration with the Camel99 Forth environment
  • Up to 12X speed-up over threaded Forth
  • Nestable sub-routines created with ASMForth versions of : and ;
  • Tail-call optimization
    • In the spirit of Moore's machine Forth this is manually invoked using -;

Future

We need the ability to create standalone binary programs.

asmforth's People

Contributors

bfox9900 avatar

Stargazers

helloitshecker avatar

Watchers

 avatar  avatar

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.