2015-10-17 11:28:39 +00:00
|
|
|
Sixtypical Compilation
|
|
|
|
======================
|
|
|
|
|
|
|
|
This is a test suite, written in [Falderal][] format, for compiling
|
|
|
|
Sixtypical to 6502 machine code.
|
|
|
|
|
|
|
|
[Falderal]: http://catseye.tc/node/Falderal
|
|
|
|
|
|
|
|
-> Functionality "Compile Sixtypical program" is implemented by
|
|
|
|
-> shell command "bin/sixtypical --compile %(test-body-file) | fa-bin-to-hex"
|
|
|
|
|
|
|
|
-> Tests for functionality "Compile Sixtypical program"
|
|
|
|
|
|
|
|
Null program.
|
|
|
|
|
|
|
|
| routine main
|
|
|
|
| {
|
|
|
|
| }
|
|
|
|
= 00c060
|
|
|
|
|
|
|
|
Rudimentary program.
|
|
|
|
|
|
|
|
| routine main
|
|
|
|
| inputs a
|
|
|
|
| outputs a
|
|
|
|
| trashes c, z, n, v
|
|
|
|
| {
|
|
|
|
| st off, c
|
|
|
|
| add a, 4
|
|
|
|
| }
|
|
|
|
= 00c018690460
|
2015-10-17 12:50:21 +00:00
|
|
|
|
|
|
|
Call extern.
|
|
|
|
|
|
|
|
| routine chrout
|
|
|
|
| inputs a
|
|
|
|
| trashes a
|
|
|
|
| @ 65490
|
|
|
|
|
|
|
|
|
| routine main
|
|
|
|
| inputs a
|
2015-10-17 13:54:28 +00:00
|
|
|
| trashes a, z, n
|
2015-10-17 12:50:21 +00:00
|
|
|
| {
|
|
|
|
| ld a, 65
|
|
|
|
| call chrout
|
|
|
|
| }
|
2015-10-17 14:06:50 +00:00
|
|
|
= 00c0a94120d2ff60
|
2015-10-17 14:23:00 +00:00
|
|
|
|
|
|
|
Call defined routine.
|
|
|
|
|
|
|
|
| routine foo
|
|
|
|
| outputs a, x, y
|
|
|
|
| trashes z, n
|
|
|
|
| {
|
|
|
|
| ld a, 0
|
|
|
|
| ld x, 0
|
|
|
|
| ld y, 0
|
|
|
|
| }
|
|
|
|
|
|
|
|
|
| routine main
|
|
|
|
| trashes a, x, y, z, n
|
|
|
|
| {
|
|
|
|
| call foo
|
|
|
|
| }
|
|
|
|
= 00c02004c060a900a200a00060
|