1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-12-27 04:29:34 +00:00
millfork/docs/abi/undocumented.md

64 lines
1.2 KiB
Markdown
Raw Normal View History

2018-04-02 22:21:26 +00:00
[< back to index](../index.md)
2018-01-04 00:15:04 +00:00
# Undocumented opcodes
Original 6502 processors accidentally supported a bunch of extra undocumented instructions.
Millfork can emit them if so desired.
## Mnemonics
Since various assemblers use different mnemonics for undocumented opcodes,
Millfork supports multiple mnemonics per opcode. The default one is given first:
* **AHX**, AXA, SHA
* **ALR**
* **ANC**
* **ARR**
* **DCP**, DCM
* **ISC**, INS
* **LAS**
* **LAX**
* **LXA**, OAL
* **RLA**
* **RRA**
* **SAX**\*
2018-01-04 00:15:04 +00:00
* **SHX**, XAS
* **SHY**, SAY\*
2018-01-04 00:15:04 +00:00
* **SBX**, AXS\*\*
2018-01-04 00:15:04 +00:00
* **SRE**, LSE
* **SLO**, ASO
* **TAS**
* **XAA**, ANE
\* HuC2680 has different instructions also called SAX and SAY,
but Millfork can distinguish between them and the NMOS illegal instructions based on the addressing mode.
\*\* AXS is also used for SAX in some assemblers. Millfork interprets AXS based on the addressing mode.
2018-01-04 00:15:04 +00:00
## Generation
In order for the compiler to emit one of those opcodes,
an appropriate CPU architecture must be chosen (`nmos` or `ricoh`)
and either it must appear in an assembly block or it may be a result of optimization.
Optimization will never emit any of the following opcodes due to their instability and/or uselessness:
AHX, LAS, LXA, SHX, SHY, TAS, XAA.