mirror of
https://github.com/KarolS/millfork.git
synced 2026-04-19 10:42:10 +00:00
Almost full LR35902 opcode space coverage
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@
|
||||
|
||||
* [Inline 6502 assembly syntax](lang/assembly.md)
|
||||
|
||||
* [Inline Z80 assembly syntax](lang/assemblyz80.md)
|
||||
* [Inline 8080/LR35902/Z80 assembly syntax](lang/assemblyz80.md)
|
||||
|
||||
* [Important guidelines regarding reentrancy](lang/reentrancy.md)
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ even up to hardware damage.
|
||||
|
||||
* on ROM-based platforms: using global variables with an initial value (they will not be initialized!)
|
||||
|
||||
* violating the [safe assembly rules](../lang/assembly.md)
|
||||
* violating the safe assembly rules ([6502](../lang/assembly.md), [8080/LR35902/Z80](../lang/assemblyz80.md))
|
||||
|
||||
* violating the [safe reentrancy rules](../lang/reentrancy.md)
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
# Undocumented opcodes
|
||||
|
||||
## 6502
|
||||
|
||||
Original 6502 processors accidentally supported a bunch of extra undocumented instructions.
|
||||
Millfork can emit them if so desired.
|
||||
|
||||
@@ -61,3 +63,9 @@ and either it must appear in an assembly block or it may be a result of optimiza
|
||||
|
||||
Optimization will never emit any of the following opcodes due to their instability and/or uselessness:
|
||||
AHX, LAS, LXA, SHX, SHY, TAS, XAA.
|
||||
|
||||
## Z80
|
||||
|
||||
Original Z80 processors accidentally supported a bunch of extra undocumented instructions.
|
||||
Millfork will not emit them.
|
||||
The only exception is SLL, which will be emitted if it occurs in a handwritten assembly block.
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
|
||||
* [Inline 6502 assembly syntax](lang/assembly.md)
|
||||
|
||||
* [Inline Z80 assembly syntax](lang/assemblyz80.md)
|
||||
* [Inline 8080/LR35902/Z80 assembly syntax](lang/assemblyz80.md)
|
||||
|
||||
* [Important guidelines regarding reentrancy](lang/reentrancy.md)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[< back to index](../index.md)
|
||||
|
||||
# Using Intel8080/Z80 assembly within Millfork programs
|
||||
# Using 8080/LR35902/Z80 assembly within Millfork programs
|
||||
|
||||
There are two ways to include raw assembly code in your Millfork programs:
|
||||
|
||||
@@ -10,13 +10,18 @@ There are two ways to include raw assembly code in your Millfork programs:
|
||||
|
||||
## Assembly syntax
|
||||
|
||||
Millfork uses Zilog syntax for Intel 8080 and Z80 assembly. Intel syntax is not supported.
|
||||
Millfork uses Zilog syntax for Intel 8080, Z80 and LR35902 assembly. Intel syntax is not supported.
|
||||
|
||||
Indexing via the IX/IY register uses the following syntax: `IX(1)`
|
||||
|
||||
LR35902 instructions that load/store the accumulator indirectly via HL and then increment/decrement HL are written
|
||||
`LD A,(HLI)`, `LD, A,(HLD)`, `LD (HLI),A` and `LD (HLD),A`
|
||||
|
||||
Only instructions available on the current CPU architecture are available.
|
||||
Undocumented instructions are not supported, except for `SLL`.
|
||||
|
||||
LR35902 instructions for faster access to the $FFxx addresses are not available yet.
|
||||
|
||||
Labels have to be followed by a colon and they can optionally be on a separate line.
|
||||
Indentation is not important:
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ For more details about how to pass parameters to `asm` functions, see:
|
||||
|
||||
* for 6502: [Using 6502 assembly within Millfork programs#Assembly functions](./assembly.md#assembly-functions).
|
||||
|
||||
* for Z80: [Using Z80 assembly within Millfork programs#Assembly functions](./assembly.md#assembly-functions).
|
||||
* for Z80: [Using Z80 assembly within Millfork programs#Assembly functions](./assemblyz80.md#assembly-functions).
|
||||
|
||||
## Calling external functions at a dynamic address
|
||||
|
||||
|
||||
Reference in New Issue
Block a user