1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-06-02 03:41:28 +00:00

Documentation updates.

This commit is contained in:
Chris Pressey 2018-03-26 13:16:53 +01:00
parent ceaae962d5
commit 7f38d04536
4 changed files with 41 additions and 12 deletions

View File

@ -6,13 +6,13 @@ History of SixtyPical
* Added the so-called "open-faced `for` loop", which spans a loop
variable over a range, the end of which is fixed.
* `--origin` and `--output-format` options added to reference compiler.
* "Tail position" is now more correctly determined for the purposes of
insisting that `goto` only appears in it.
* New `--origin` and `--output-format` options added to the compiler.
* Fixed bug when `--prelude` option was missing.
* Fixed bug when reporting line numbers of scanner-level syntax errors.
* Translated the small demo project Ribos and "The PETulant Cursor"
to SixtyPical and added them to the `eg/c64/` section of the repo.
* Translated the small demo projects Ribos and "The PETulant Cursor" to
SixtyPical, and added them to the `eg/c64/` section of the repo.
0.13
----

View File

@ -3,10 +3,10 @@ SixtyPical
_Version 0.14. Work-in-progress, everything is subject to change._
**SixtyPical** is a 6502-assembly-like programming language with advanced
**SixtyPical** is a 6502-like programming language with advanced
static analysis.
"6502-assembly-like" means that it has similar restrictions as programming
"6502-like" means that it has similar restrictions as programming
in 6502 assembly (e.g. the programmer must choose the registers that
values will be stored in) and is concomitantly easy for a compiler to
translate it to 6502 machine language code.
@ -15,8 +15,8 @@ translate it to 6502 machine language code.
go through the program step by step, tracking not just the changes that
happen during a _specific_ execution of the program, but _sets_ of changes
that could _possibly_ happen in any run of the program. This lets us
determine that certain things can never happen, which we can present as
safety guarantees.
determine that certain things can never happen, which we can then formulate
as safety checks.
In practice, this means it catches things like
@ -51,7 +51,8 @@ automatically start it in the `x64` emulator, and you should see:
![Screenshot of result of running hearts.60p](https://raw.github.com/catseye/SixtyPical/master/images/hearts.png)
You can try the `loadngo.sh` script on other sources in the `eg` directory
tree. There is an entire small game(-like program) in [demo-game.60p](eg/c64/demo-game/demo-game.60p).
tree, which contains more extensive examples, including an entire
game(-like program); see [eg/README.md](eg/README.md) for a listing.
Documentation
-------------

View File

@ -1,7 +1,7 @@
SixtyPical
==========
This document describes the SixtyPical programming language version 0.11,
This document describes the SixtyPical programming language version 0.14,
both its static semantics (the capabilities and limits of the static
analyses it defines) and its runtime semantics (with reference to the
semantics of 6502 machine code.)
@ -234,9 +234,12 @@ changed by this instruction; they must be named in the WRITES, and they
are considered initialized after it has executed.
If and only if src is a byte table, the index-memory-location must be given.
In this case, it is illegal if the value of the index-memory-location falls
outside of the range of the table.
Some combinations, such as `ld x, y`, are illegal because they do not map to
underlying opcodes.
underlying opcodes. (For an instruction which maps more flexibly to underlying
opcodes, see `copy`.)
There is another mode of `ld` which reads into `a` indirectly through a pointer.
@ -265,6 +268,8 @@ After execution, dest is considered initialized. No flags are
changed by this instruction (unless of course dest is a flag.)
If and only if dest is a byte table, the index-memory-location must be given.
In this case, it is illegal if the value of the index-memory-location falls
outside of the range of the table.
There is another mode of `st` which write `a` into memory, indirectly through
a pointer.
@ -571,9 +576,10 @@ Grammar
LocExpr ::= Register | Flag | Literal | Ident.
Register::= "a" | "x" | "y".
Flag ::= "c" | "z" | "n" | "v".
Literal ::= LitByte | LitWord.
Literal ::= LitByte | LitWord | LitBit.
LitByte ::= "0" ... "255".
LitWord ::= "0" ... "65535".
LitBit ::= "on" | "off".
Block ::= "{" {Instr} "}".
Instr ::= "ld" LocExpr "," LocExpr ["+" LocExpr]
| "st" LocExpr "," LocExpr ["+" LocExpr]
@ -589,7 +595,9 @@ Grammar
| "dec" LocExpr
| "call" Ident<routine>
| "goto" Ident<executable>
| "copy" LocExpr "," LocExpr ["+" LocExpr]
| "if" ["not"] LocExpr Block ["else" Block]
| "repeat" Block ("until" ["not"] LocExpr | "forever")
| "copy" LocExpr "," LocExpr ["+" LocExpr]
| "for" LocExpr ("up"|"down") "to" Literal Block
| "with" "interrupts" LitBit Block
.

20
eg/README.md Normal file
View File

@ -0,0 +1,20 @@
This directory contains SixtyPical example programs, categorized
in subdirectories by the machine architecture.
In the [c64](c64/) directory are programs that run on the Commodore 64:
* [demo-game](c64/demo-game/): a little game-like program written as a
"can we write something you'd see in practice?" test case for SixtyPical.
* [ribos](c64/ribos/): a well-commented example of a C64 raster interrupt
routine. Originally written with the P65 assembler (now Ophis).
The second version of it has been translated to SixtyPical.
* [petulant](c64/petulant/) -- "The PETulant Cursor", a tiny (44 bytes)
"display hack". Originally written in the late 80's. Rewritten with
the P65 assembler (now Ophis) and re-released April 1, 2008 (a
hint as to its nature). Translated to SixtyPical, it's 48 bytes.
In the [rudiments](rudiments/) directory are programs which are not for
any particular machine, but meant to demonstrate the features of SixtyPical.
Some are meant to fail and produce an error message. Others can run on
any architecture where there is a routine at 65490 which outputs the value
of the accumulator as an ASCII character.