From 27de426a38a1343a3dff952fb54fdae71f5d30fa Mon Sep 17 00:00:00 2001 From: Karol Stasiak Date: Wed, 25 Jul 2018 00:04:00 +0200 Subject: [PATCH] Documentation updates --- CHANGELOG.md | 4 +++- README.md | 17 +++++++++++++---- docs/README.md | 19 ++++++++++++++++++- docs/api/custom-platform.md | 2 +- docs/api/target-platforms.md | 7 ++++--- docs/lang/assemblyz80.md | 16 ++++++++-------- 6 files changed, 47 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbdfe07a..1949156f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Current version -* A very incomplete support for the Z80 microprocessor. +* Almost complete support for the Z80 microprocessor. * A very incomplete support for NEC PC-88 and ZX Spectrum. @@ -27,6 +27,8 @@ Code that uses a custom platform definitions will cause extra warnings until fix * Fixed emitting constant decimal expressions. +* Fixed decimal subtraction. + * Parser performance improvement. * Standard libraries improvements. diff --git a/README.md b/README.md index 6b707f89..f280dd7a 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,10 @@ # Millfork -A middle-level programming language targeting 6502-based microcomputers. +A middle-level programming language targeting 6502-based and Z80-based microcomputers. -For binary releases, see: https://github.com/KarolS/millfork/releases (latest: 0.3.0) +For binary releases, see: https://github.com/KarolS/millfork/releases +(latest: 0.3.0, doesn't support Z80 yet) ## Features @@ -33,6 +34,10 @@ For binary releases, see: https://github.com/KarolS/millfork/releases (latest: 0 * BBC Micro * Apple II+/IIe/Enhanced IIe + + * ZX Spectrum 48k + + * NEC PC-88 * inline assembly @@ -59,8 +64,12 @@ Therefore, no attribution is needed if you are developing and distributing Millf ## Planned features -* Z80 support, targetting PC-88, ZX Spectrum, later also maybe Armstrad CPC, MSX, TI-83 (this is already work-in-progress) +* stdlib improvements * more 6502 targets: Oric computers, PC-Engine/Turbografx-16, Atari Lynx + +* more Z80 targets: Armstrad CPC, MSX, TI-83, Sega Master System -* support for 65816, SuperFamicom/SNES and Apple IIgs +* support for 65816, Intel 8080, Sharp LR35902 and eZ80 + +* support for CP/M, Gameboy, SuperFamicom/SNES and Apple IIgs diff --git a/docs/README.md b/docs/README.md index a21740b0..0ff81f09 100644 --- a/docs/README.md +++ b/docs/README.md @@ -11,8 +11,12 @@ * [Target platform reference](api/target-platforms.md) +* [Defining a custom platform](api/custom-platform.md) + ## Language reference +* [Preprocessor](lang/preprocessor.md) + * [Syntax](lang/syntax.md) * [Types](lang/types.md) @@ -21,15 +25,28 @@ * [Functions](lang/functions.md) -* [Inline assembly syntax](lang/assembly.md) +* [Inline 6502 assembly syntax](lang/assembly.md) + +* [Inline Z80 assembly syntax](lang/assemblyz80.md) * [Important guidelines regarding reentrancy](lang/reentrancy.md) +## Library reference + +* [`stdlib` module](stdlib/stdlib.md) + +* [Other cross-platform modules](stdlib/other.md) + +* [C64-only modules](stdlib/c64.md) + +* [NES-only modules](stdlib/nes.md) ## Implementation details * [Variable storage](abi/variable-storage.md) +* [Calling convention](abi/calling-convention.md) + * [Undefined behaviour](abi/undefined-behaviour.md) * [Undocumented instruction support](abi/undocumented.md) diff --git a/docs/api/custom-platform.md b/docs/api/custom-platform.md index ffede18b..47070702 100644 --- a/docs/api/custom-platform.md +++ b/docs/api/custom-platform.md @@ -24,7 +24,7 @@ Every platform is defined in an `.ini` file with an appropriate name. * `65816` (WDC 65816/65802; experimental; currently only programs that use only 16-bit addressing are supported) - * `z80` (Zilog Z80; experimental and very incomplete) + * `z80` (Zilog Z80; experimental and slightly incomplete) * `encoding` – default encoding for console I/O, one of `ascii`, `pet`/`petscii`, `petscr`/`cbmscr`, `atascii`, `bbc`, `jis`/`jisx`, `apple2`, diff --git a/docs/api/target-platforms.md b/docs/api/target-platforms.md index 9f4a018b..4d192d4a 100644 --- a/docs/api/target-platforms.md +++ b/docs/api/target-platforms.md @@ -2,7 +2,8 @@ # Target platforms -Currently, Millfork supports creating disk- or tape-based programs for Commodore, Apple, BBC and Atari 8-bit computers +Currently, Millfork supports creating disk- or tape-based programs +for Commodore, Apple, BBC and Atari 8-bit computers, NEC PC-88, ZX Spectrum 48k, and cartridge-based programs for Famicom/NES and Atari 2600, but it may be expanded to support other 6502-based and Z80-based platforms in the future. @@ -54,9 +55,9 @@ Read [the BBC Micro programming guide](./bbcmicro-programming-guide.md) for more The compiler only emits raw binaries, not disk images. Read [the Apple 2 programming guide](./apple2-programming-guide.md) for more info. -* `pc88` – NEC PC-88 (very incomplete and not usable for anything yet) +* `pc88` – NEC PC-88 (no ROM routines are mapped yet) -* `zxspectrum` – Sinclair ZX Spectrum 48k (very incomplete and not usable for anything yet) +* `zxspectrum` – Sinclair ZX Spectrum 48k The primary and most tested platform is Commodore 64. diff --git a/docs/lang/assemblyz80.md b/docs/lang/assemblyz80.md index 03908a7f..68e57f29 100644 --- a/docs/lang/assemblyz80.md +++ b/docs/lang/assemblyz80.md @@ -1,8 +1,6 @@ [< back to index](../index.md) -# Using Z80 assembly within Millfork programs - -The compiler supports Z80 assembly only partially. This will be remedied in the future. +# Using Intel8080/Z80 assembly within Millfork programs There are two ways to include raw assembly code in your Millfork programs: @@ -12,12 +10,11 @@ There are two ways to include raw assembly code in your Millfork programs: ## Assembly syntax -Millfork inline assembly uses the same three-letter opcodes as most other 6502 assemblers. -Indexing syntax is also the same. Only instructions available on the current CPU architecture are available. - -**Work in progress**: -Currently, `RES/SET/BIT` and some few more instructions are not supported yet. +Millfork uses Zilog syntax for Intel 8080 and Z80 assembly. Intel syntax is not supported. +Indexing via the IX/IY register uses the following syntax: `IX(1)` + +Only instructions available on the current CPU architecture are available. Undocumented instructions are not supported, except for `SLL`. Labels have to be followed by a colon and they can optionally be on a separate line. @@ -138,6 +135,9 @@ it should abide to the following rules: * don't change the IX register +* don't change the IY register if the target platform doesn't allow it +(for example: ZX Spectrum in interrupt mode 1) + * don't jump between functions if either of functions has stack variables * don't do `RET`, `RETI` or `RETN` if the function has stack variables