GithubHelp home page GithubHelp logo

gmc4-as's Introduction

gmc4-as: Simple and non-optimizing assembler for GMC4.

Introduction
------------
This assembler is for the R-165 instruction set, as used for the GMC4 4-bit
microcomputer. This neat little toy was made by Gakken, and can be purchased
via MakerShed (http://www.makershed.com/ProductDetails.asp?ProductCode=MKGK21).

After the initial joy of puzzling a program together I figured I could use this
microcomputer to teach myself how to write a basic assembler.

gmc4-as is a naive (but not stupid) approach. It doesn't use a fully fletched
syntax tree, or a BNF grammer implemented in Yacc (although I wrote a BNF
grammer to help me handroll a parser). Essentially there are several passes over
the source code:

  - Strip comments, whitespace and remove empty lines
  - Four steps of syntax checking
  - Translating the validated opcodes and operands to instructions
  - Emit the instructions along with their memory addresses

I haven't done any benchmarking, but since programming the GMC4 easily takes a
few minutes, I didn't really bother yet optimizing the runtime of the assembler.

Todo
----
Apart from some bugs I'm aware of that need fixing, there are various things
I'd like to implement:

  - Symbolic label support for JUMP.
  - Better error reporting in case of syntax errors.
  - Better output and more options for formatting.
  - Add a Makefile so this can be installed (for the fool who wants that..)

Usage
-----
By default the memory addresses are printed in front of the instructions:

  gurthang:gmc4-as {2286} cat example/showkey.s
  ; Show the key entered on the display
  KA      ; Read the key
  TIY E
  AM
  TIY F
  TIA 0
  AM
  CAL SUND ; Display the key
  JUMP 00
  gurthang:gmc4-as {2287} perl gmc4-as.pl example/showkey.s
  0x00    0
  0x02    AE
  0x03    4
  0x05    AF
  0x07    80
  0x08    4
  0x09    EB
  0x0b    F0
  0x0c    0
  gurthang:gmc4-as {2288} 

Resources
----------
- Great site with the original CPU manual for the Tandy Microcomputer Trainer,
  upon which the GMC4 is based:
  http://www.polylith.com/~brendan/ClassicComputers/Tandy/uCptrTrainManual1.html
- Google Knol about the GMC4:
  http://knol.google.com/k/programming-the-gakken-gmc-4-microcomputer


Copyright and License
---------------------
Written by Jasper Lievisse Adriaanse <[email protected]>, released under the
terms of the liberal ISC license. For the license text please see LICENSE.

gmc4-as's People

Contributors

jasperla avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.