Simple graphics language

From ScienceZero
Revision as of 15:57, 14 April 2011 by Bjoern (Talk | contribs)

Jump to: navigation, search

A simple graphics language for microcontrollers

We start with a very simple reverse polish notation interpreter with a preprocessor stage

Sample code:

360 for 1 forward 1 right next

Registers:

0 X
1 Y
2 Angle
3 Colour
4 Pen up/down
5
6
7

Commands:

setpixel      ( x y -- )
readpixel     ( x y -- colour )
colour        (colour -- )
goto          (x y -- )
loops
conditionals
penup         ( -- )
pendown       ( -- )