– Add support for undocumented 8085 instructions – Convert undocumented 8085 instructions to 8086 – Add new CPU types and categorize CPU types correctly – Fix macro expansion in some situations – Improve 8080 optimizations – Improve documentation – Other improvements
8.3 KiB
Adding a custom platform
Every platform is defined in an .ini file with an appropriate name.
As an extension, multiline entries are supported: if a line ends with a backslash character, the value continues to the next line.
[compilation] section
-
arch– CPU architecture. It defines which instructions are available. Available values:-
nmos(original 6502) -
strict(NMOS without illegal instructions) -
ricoh(Ricoh 2A03/2A07, NMOS without decimal mode) -
strictricoh(Ricoh 2A03/2A07 without illegal instructions) -
cmos(WDC 65C02 or 65SC02) -
65ce02(CSG 65CE02; experimental) -
huc6280(Hudson HuC6280; experimental) -
65816(WDC 65816/65802; experimental; currently only programs that use only 16-bit addressing are supported) -
z80(Zilog Z80) -
strictz80(Z80 without illegal instructions) -
i8080(Intel 8080) -
i8085(Intel 8085) -
strict8085(Intel 8085 without illegal instructions) -
gameboy(Sharp LR35902; experimental) -
i8086(Intel 8086; very experimental, very buggy and very, very incomplete – see the 8086 support disclaimer)
-
-
encoding– default encoding for console I/O. Default:ascii. See the list of available encodings. -
screen_encoding– default encoding for screencodes (literals with encoding specified asscr). Default: the same asencoding. -
modules– comma-separated list of modules that will be automatically imported -
other compilation options (they can be overridden using commandline options):
-
emit_illegals– whether the compiler should emit illegal instructions, defaultfalse -
emit_cmos– whether the compiler should emit 65C02 instructions, default istrueon compatible processors andfalseelsewhere -
emit_65816– which 65816 instructions should the compiler emit, eitherno,emulationornative -
decimal_mode– whether the compiler should emit decimal instructions, default isfalseonricohandstrictricohandtrueelsewhere; if disabled, a software decimal mode will be used -
emit_8085– whether the compiler should emit Intel 8085 instructions, default istrueon compatible processors andfalseelsewhere -
emit_x80– whether the compiler should emit instructions present on Sharp LR35902 and Z80, but absent on Intel 8080, default istrueon compatible processors andfalseelsewhere -
emit_z80– whether the compiler should emit Zilog Z80 instructions not covered byemit_x80, default istrueon compatible processors andfalseelsewhere -
ro_arrays– (deprecated) whether the compiler should warn upon array writes, default isfalse -
prevent_jmp_indirect_bug– whether the compiler should try to avoid the indirect JMP bug, default isfalseon 65C02-compatible or non-6502 processors andtrueelsewhere -
compact_dispatch_params– whether parameter values in return dispatch statements may overlap other objects, default istrue.
This may cause problems if the parameter table is stored next to a hardware register that has side effects when reading. -
lunix– generate relocatable code for LUnix/LNG, default isfalse -
zeropage_register– reserve a certain amount of bytes of zero page as a pseudoregister to increase language features. Default:4if targeting a 6502-based architecture,0otherwise.
trueis a synonym of the current compiler default (currently: 4) andfalseis a synonym for 0. -
inline- inline functions automatically by default, default isfalse. -
ipo- enable interprocedural optimization, default isfalse. -
function_fallthrough– whether should replace a tail call by simply putting one function after another, default istrue. -
function_deduplication– whether identical functions should be merged into one function, default istrue. -
subroutine_extraction– whether identical fragments of functions should be extracted into subroutines, default isfalse. -
lenient_encoding- allow for automatic substitution of invalid characters in string literals using the default encodings, default isfalse. -
use_shadow_registers_for_irq– use Z80 shadow registers in interrupt routines, default istruefor Z80 andfalseotherwise -
ix_stack– use the IX register to access stack variables, default istruefor Z80 and 8086,falseotherwise -
iy_stack– use the IY register to access stack variables, default isfalse -
ix_scratch– allow using the IY register for other purposes, default isfalse -
iy_scratch– allow using the IY register for other purposes, default isfalse -
software_stack– use software stack for stack variables, default isfalse. Applicable only to 6502-based targets. -
output_intel_syntax– use Intel syntax instead of Zilog syntax, default istruefor Intel 8080/8085 andfalseotherwise
-
[define] section
This section defines values of features of the target. See the preprocessor documentation for more info.
[allocation] section
-
zp_pointers– either a list of comma separated zeropage addresses that can be used by the program as zeropage pointers, orallfor all. Each value should be the address of the first of two free bytes in the zeropage. Only used for 6502-based targets. -
segments– a comma-separated list of segment names.
A segment nameddefaultis always required.
Default:default. In all options below,NAMErefers to a segment name. -
default_code_segment– the default segment for code and initialized arrays.
Note that the default segment for uninitialized arrays and variables is alwaysdefault.
Default:default -
segment_NAME_start– the first address used for automatic allocation in the segment.
Note that on 6502-like targets, thedefaultsegment shouldn't start before $200, as the $0-$1FF range is reserved for the zeropage and the stack.
Themainfunction will be placed as close to the beginning of its segment as possible, but not necessarily atsegment_NAME_start -
segment_NAME_end– the last address in the segment -
segment_NAME_codeend– the last address in the segment for code and initialized arrays.
Only uninitialized variables are allowed betweensegment_NAME_codeendandsegment_NAME_end.
Default: the same assegment_NAME_end. -
segment_NAME_datastart– the first address used for non-zeropage variables, orafter_codeif the variables should be allocated after the code.
Default:after_code.
[output] section
-
style– how multi-segment programs should be output:-
single– output a single file, based mostly, but not necessarily only on data in thedefaultsegment (the default) -
lunix– likesingle, but add data necessary for relocation between code and data (requireslunixoption in thecompilationsection) -
per_segment– generate a separate file with each segment
-
-
format– output file format; a comma-separated list of tokens:-
literal byte values
-
startaddr– little-endian 16-bit address of the first used byte of the compiled output (not necessarily the segment start) -
startpage– the high byte ofstartaddr -
endaddr– little-endian 16-bit address of the last used byte of the compiled output (usually not the segment end) -
allocated– all used bytes -
pagecount– the number of pages used by all used bytes (including partially filled pages) -
<addr>:<addr>- inclusive range of bytes -
<segment>:<addr>:<addr>- inclusive range of bytes in a given segment -
d88- a D88 floppy disk image for PC-88 -
tap- a tape disk image for ZX Spectrum
-
-
extension– target file extension, with or without the dot -
bbc_inf– should the.inffile with file metadata for BBC Micro be created -
gb_checksum– should the main output file be patched with Game Boy-compatible checksums