As with asm.py, the idea is that you use Python syntax as your front end notation. We experimented a bit so that we can now fake indentation, a well-known problem of using Python for this purpose. The extension for these programs is .vasm.py . As an example, here is Blinky2.vasm.py:
Code: Select all
# Please build this from the Makefile
from vasm import *
p=0x30 # User variables start from $30 in zero page
ORG(0x200) # User programs can start from $200
- LDWI(0x800) # Top left pixel
- STW(p) # Pointer variable p
L('Loop'); POKE(p) # Update pixel
- ADDI(1) # Increment vAC
- BRA('Loop') # Loop forever
END(0x200) # Execution start address
Code: Select all
$ make Apps/Blinky/Blinky2.gt1
Code: Select all
$ gt1dump.py -d Apps/Blinky/Blinky2.gt1
* file: Apps/Blinky/Blinky2.gt1
0200 11 00 08 [vCPU] LDWI $0800 |...|
0203 2b 30 STW $30 |+0|
0205 f0 30 POKE $30 |p0|
0207 e3 01 ADDI 1 |c.|
0209 90 03 BRA $0205 |..|
* 11 bytes
* start at $0200
Bug reports and feature requests through GitHub please. I can foresee some tweaks, but I don't aspire to turn this into a castle.