1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-05-28 13:41:31 +00:00

Documentation updates

This commit is contained in:
Karol Stasiak 2018-07-25 00:04:00 +02:00
parent 2ca30315ca
commit 27de426a38
6 changed files with 47 additions and 18 deletions

View File

@ -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.

View File

@ -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

View File

@ -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)

View File

@ -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`,

View File

@ -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.

View File

@ -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