package core:rexcode/isa/mos65816
Overview
rexcode · Brendan Punsky (dotbmp@github), original author
rexcode · Brendan Punsky (dotbmp@github), original author
rexcode · Brendan Punsky (dotbmp@github), original author
rexcode · Brendan Punsky (dotbmp@github), original author
rexcode · Brendan Punsky (dotbmp@github), original author
rexcode · Brendan Punsky (dotbmp@github), original author
rexcode · Brendan Punsky (dotbmp@github), original author
rexcode · Brendan Punsky (dotbmp@github), original author
rexcode · Brendan Punsky (dotbmp@github), original author
rexcode · Brendan Punsky (dotbmp@github), original author
rexcode · Brendan Punsky (dotbmp@github), original author
Index
Types (30)
Constants (19)
Listed one per row under Constants.
Variables (4)
Procedures (449)
Listed one per row under Procedures.
Procedure Groups (36)
Listed one per row under Procedures.
Types
Address_Mode ¶
Address_Mode :: enum u8 { DP, DP_X, DP_Y, DP_IND, DP_IND_X, DP_IND_Y, DP_IND_LONG, DP_IND_LONG_Y, ABS, ABS_X, ABS_Y, ABS_IND, ABS_IND_LONG, ABS_IND_X, LONG, LONG_X, SR, SR_IND_Y, }
Assumed_State ¶
Assumed_State :: struct { m: bool, // M=1 (8-bit A/memory) M=0 (16-bit A/memory) x: bool, // X=1 (8-bit X/Y) X=0 (16-bit X/Y) e: bool, }
Mode-flag state the caller asserts at decode time.
Related Constants
Decode_Entry ¶
Decode_Entry :: struct #packed { mnemonic: Mnemonic, // 2 ops: [2]Operand_Type, // 2 enc: [2]Operand_Encoding, // 2 opcode: u8, // 1 length: u8, // 1 flags: Encoding_Flags, }
Encode_Run ¶
Companion run index: ENCODE_RUNS[mnemonic] -> contiguous run in ENCODE_FORMS.
Encoding ¶
Encoding :: struct #packed { mnemonic: Mnemonic, // 2 ops: [4]Operand_Type, // 4 enc: [4]Operand_Encoding, // 4 opcode: u8, // 1 length: u8, // 1 flags: Encoding_Flags, }
Error_Code ¶
Error_Code :: rexcode_isa.Error_Code
Label_Map ¶
Label_Map :: rexcode_isa.Label_Map
Label_Names ¶
Label_Names :: map[rexcode_isa.Label_Offset]string
Label_Offset ¶
Label_Offset :: rexcode_isa.Label_Offset
Memory ¶
Memory :: distinct bit_field u32 { address: u32 | 24, mode: Address_Mode | 8, }
24-bit address packed alongside the mode in 4 bytes.
Related Procedures With Parameters
- emit_adc_mem
- emit_and_mem
- emit_asl_mem
- emit_bit_mem
- emit_cmp_mem
- emit_cpx_mem
- emit_cpy_mem
- emit_dec_mem
- emit_eor_mem
- emit_inc_mem
- emit_jml_mem
- emit_jmp_mem
- emit_jsl_mem
- emit_jsr_mem
- emit_lda_mem
- emit_ldx_mem
- emit_ldy_mem
- emit_lsr_mem
- emit_ora_mem
- emit_pea_mem
- emit_pei_mem
- emit_rol_mem
- emit_ror_mem
- emit_sbc_mem
- emit_sta_mem
- emit_stx_mem
- emit_sty_mem
- emit_stz_mem
- emit_trb_mem
- emit_tsb_mem
- inst_adc_mem
- inst_and_mem
- inst_asl_mem
- inst_bit_mem
- inst_cmp_mem
- inst_cpx_mem
- inst_cpy_mem
- inst_dec_mem
- inst_eor_mem
- inst_inc_mem
- inst_jml_mem
- inst_jmp_mem
- inst_jsl_mem
- inst_jsr_mem
- inst_lda_mem
- inst_ldx_mem
- inst_ldy_mem
- inst_lsr_mem
- inst_m
- inst_ora_mem
- inst_pea_mem
- inst_pei_mem
- inst_rol_mem
- inst_ror_mem
- inst_sbc_mem
- inst_sta_mem
- inst_stx_mem
- inst_sty_mem
- inst_stz_mem
- inst_trb_mem
- inst_tsb_mem
- op_mem
- emit_adc (procedure groups)
- emit_and (procedure groups)
- emit_asl (procedure groups)
- emit_bit (procedure groups)
- emit_cmp (procedure groups)
- emit_cpx (procedure groups)
- emit_cpy (procedure groups)
- emit_dec (procedure groups)
- emit_eor (procedure groups)
- emit_inc (procedure groups)
- emit_lda (procedure groups)
- emit_ldx (procedure groups)
- emit_ldy (procedure groups)
- emit_lsr (procedure groups)
- emit_ora (procedure groups)
- emit_rol (procedure groups)
- emit_ror (procedure groups)
- emit_sbc (procedure groups)
- inst_adc (procedure groups)
- inst_and (procedure groups)
- inst_asl (procedure groups)
- inst_bit (procedure groups)
- inst_cmp (procedure groups)
- inst_cpx (procedure groups)
- inst_cpy (procedure groups)
- inst_dec (procedure groups)
- inst_eor (procedure groups)
- inst_inc (procedure groups)
- inst_lda (procedure groups)
- inst_ldx (procedure groups)
- inst_ldy (procedure groups)
- inst_lsr (procedure groups)
- inst_ora (procedure groups)
- inst_rol (procedure groups)
- inst_ror (procedure groups)
- inst_sbc (procedure groups)
Related Procedures With Returns
Mnemonic ¶
Mnemonic :: enum u16 { INVALID = 0, // 6502 core ADC, AND, ASL, BIT, CMP, CPX, CPY, DEC, DEX, DEY, EOR, INC, INX, INY, LSR, ORA, ROL, ROR, SBC, LDA, LDX, LDY, STA, STX, STY, TAX, TAY, TSX, TXA, TXS, TYA, PHA, PHP, PLA, PLP, JMP, JSR, RTI, RTS, BRK, NOP, // Branches BCC, BCS, BEQ, BMI, BNE, BPL, BVC, BVS, // Flags CLC, CLD, CLI, CLV, SEC, SED, SEI, // 65C02 additions (carry over to 65816) BRA, STZ, TRB, TSB, PHX, PHY, PLX, PLY, STP, WAI, // 65816 new BRL, // 16-bit relative branch COP, // co-processor enable (interrupt) JML, // jump long (24-bit) JSL, // jump-to-subroutine long (24-bit) MVN, MVP, // block move negative / positive PEA, // push effective absolute address PEI, // push effective indirect address PER, // push effective PC-relative PHB, PHD, PHK, // push DBR / D / PBR PLB, PLD, // pull DBR / D REP, SEP, // reset / set status bits (immediate mask) RTL, // return long TCD, TDC, // A <-> D TCS, TSC, // A <-> S TXY, TYX, // X <-> Y WDM, // reserved (assembles as 2-byte no-op) XBA, // exchange A halves (B <-> A) XCE, // exchange Carry and Emulation flags }
Related Procedures With Parameters
Operand ¶
Operand_Encoding ¶
Operand_Encoding :: enum u8 { NONE, IMPL, BYTE_1_IMM, // 8-bit at offset 1 WORD_1_IMM, // 16-bit LE at offset 1 BYTE_1_ADDR, // 8-bit zero/direct page address at offset 1 WORD_1_ADDR, // 16-bit LE absolute at offset 1 LONG_1_ADDR, // 24-bit LE long at offset 1 BYTE_1_REL, // signed 8-bit PC-rel at offset 1 WORD_1_REL, // signed 16-bit PC-rel at offset 1 BYTE_1_BANK, // dst bank byte at offset 1 (MVN/MVP) BYTE_2_BANK, // src bank byte at offset 2 (MVN/MVP) }
Byte-offset + width within the instruction stream.
Operand_Kind ¶
Operand_Kind :: enum u8 { NONE, REGISTER, // mostly used for `A` in `ROL A` (implicit; rarely needed) IMMEDIATE, MEMORY, RELATIVE, // PC-relative target (label or raw byte offset) }
Operand_Type ¶
Operand_Type :: enum u8 { NONE, A_IMPL, // accumulator -- no operand bytes // Immediates IMM_8, // always 8-bit (COP, REP, SEP, WDM, BRK signature, ...) IMM_M8, // 8-bit when M=1 IMM_M16, // 16-bit when M=0 IMM_X8, // 8-bit when X=1 IMM_X16, // 16-bit when X=0 // Branches REL, // signed 8-bit PC-rel REL_LONG, // signed 16-bit PC-rel (BRL, PER) // Memory (one per addressing mode) MEM_DP, MEM_DP_X, MEM_DP_Y, MEM_DP_IND, MEM_DP_IND_X, MEM_DP_IND_Y, MEM_DP_IND_LONG, MEM_DP_IND_LONG_Y, MEM_ABS, MEM_ABS_X, MEM_ABS_Y, MEM_ABS_IND, MEM_ABS_IND_LONG, MEM_ABS_IND_X, MEM_LONG, MEM_LONG_X, MEM_SR, MEM_SR_IND_Y, // Block move: two 8-bit bank operands. Source order in the syntax // (MVN src, dst) is the REVERSE of the byte order in the encoding. BANK_SRC, BANK_DST, }
Print_Options ¶
Print_Options :: rexcode_isa.Print_Options
Related Procedures With Parameters
Related Constants
Print_Result ¶
Print_Result :: rexcode_isa.Print_Result
Relocation_Type ¶
Relocation_Type :: enum u8 { NONE = 0, ABS16, ABS24, REL8, REL16, }
Token_Kind ¶
Token_Kind :: rexcode_isa.Token_Kind
Constants
One row per constant, under the prefix it shares with others.
| A | :: Register(REG_GP | 0) |
| D | :: Register(REG_GP | 4) |
| DBR | :: Register(REG_SYS | 0) |
| DEFAULT_PRINT_OPTIONS | : rexcode_isa.Print_Options : isa.DEFAULT_PRINT_OPTIONS |
| EMULATION | :: Assumed_State{m = true, x = true, e = true} |
| LABEL_UNDEFINED | : rexcode_isa.Label_Definition : isa.LABEL_UNDEFINED |
| MAX_INST_SIZE | :: 4 |
| NATIVE_16 | :: Assumed_State{m = false, x = false, e = false} |
| NATIVE_8 | :: Assumed_State{m = true, x = true, e = false} |
| NONE | :: Register(0xFFFF) |
| P | :: Register(REG_SYS | 2) |
| PBR | :: Register(REG_SYS | 1) |
| PC | :: Register(REG_SYS | 3) |
| REG_… 3 | |
|---|---|
| REG_GP | :: 0x0100A / X / Y / S / D |
| REG_NONE | :: 0x0000 |
| REG_SYS | :: 0x0200DBR / PBR / P / PC |
| S | :: Register(REG_GP | 3) |
| X | :: Register(REG_GP | 1) |
| Y | :: Register(REG_GP | 2) |
Variables
DECODE_ENTRIES ¶
@(rodata) DECODE_ENTRIES: []Decode_Entry = …
DECODE_INDEX_OPCODE ¶
@(rodata) DECODE_INDEX_OPCODE: []Decode_Index = …
ENCODE_FORMS ¶
@(rodata) ENCODE_FORMS: []Encoding = …
ENCODE_RUNS ¶
@(rodata) ENCODE_RUNS: []Encode_Run = …
Procedures
One row per procedure, under the procedure groups they belong to; each is a proc "contextless" unless it says otherwise.
| aprint | proc(instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil, allocator := context.allocator) -> string |
| aprintln | proc(instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil, allocator := context.allocator) -> string |
| bprint | proc(buf: []u8, instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil) -> string |
| bprintln | proc(buf: []u8, instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil) -> string |
| decode | proc(data: []u8, relocs: []Relocation, instructions: ^[dynamic]Instruction, inst_info: ^[dynamic]Instruction_Info, label_defs: ^[dynamic]rexcode_isa.Label_Definition, errors: ^[dynamic]rexcode_isa.Error, state: Assumed_State = NATIVE_16) -> (byte_count: u32, ok: bool) |
| decode_estimate_instruction_count | (data: []u8) -> intTypical-case estimate of the instruction count for data.Typical-case estimate of the instruction count for |
| decode_max_instruction_count | (data: []u8) -> intInstruction-count ceiling for data (shortest instruction is 1 byte).Instruction-count ceiling for |
| decode_reserve | proc(instructions: ^[dynamic]Instruction, inst_info: ^[dynamic]Instruction_Info, label_defs: ^[dynamic]rexcode_isa.Label_Definition, data: []u8, exact: bool = false)Pre-size the caller's decode output arrays for data (reserves on top of any existing elements; nil to skip; exact=true for the ceiling, else the estimate).Pre-size the caller's decode output arrays for |
| emit_adc 3 forms | |
|---|---|
| emit_adc_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_adc_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_adc_imm16 | proc(instructions: ^[dynamic]Instruction, imm: i16) |
| emit_and 3 forms | |
| emit_and_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_and_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_and_imm16 | proc(instructions: ^[dynamic]Instruction, imm: i16) |
| emit_asl 2 forms | |
| emit_asl_a | proc(instructions: ^[dynamic]Instruction) |
| emit_asl_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_bcc | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bcc_rel | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bcs | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bcs_rel | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_beq | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_beq_rel | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bit 3 forms | |
| emit_bit_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_bit_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_bit_imm16 | proc(instructions: ^[dynamic]Instruction, imm: i16) |
| emit_bmi | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bmi_rel | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bne | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bne_rel | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bpl | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bpl_rel | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bra | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bra_rel | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_brk | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_brk_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_brl | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_brl_rel_long | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bvc | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bvc_rel | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bvs | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_bvs_rel | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_clc | proc(instructions: ^[dynamic]Instruction) |
| emit_clc_none | proc(instructions: ^[dynamic]Instruction) |
| emit_cld | proc(instructions: ^[dynamic]Instruction) |
| emit_cld_none | proc(instructions: ^[dynamic]Instruction) |
| emit_cli | proc(instructions: ^[dynamic]Instruction) |
| emit_cli_none | proc(instructions: ^[dynamic]Instruction) |
| emit_clv | proc(instructions: ^[dynamic]Instruction) |
| emit_clv_none | proc(instructions: ^[dynamic]Instruction) |
| emit_cmp 3 forms | |
| emit_cmp_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_cmp_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_cmp_imm16 | proc(instructions: ^[dynamic]Instruction, imm: i16) |
| emit_cop | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_cop_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_cpx 3 forms | |
| emit_cpx_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_cpx_imm16 | proc(instructions: ^[dynamic]Instruction, imm: i16) |
| emit_cpx_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_cpy 3 forms | |
| emit_cpy_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_cpy_imm16 | proc(instructions: ^[dynamic]Instruction, imm: i16) |
| emit_cpy_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_dec 2 forms | |
| emit_dec_a | proc(instructions: ^[dynamic]Instruction) |
| emit_dec_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_dex | proc(instructions: ^[dynamic]Instruction) |
| emit_dex_none | proc(instructions: ^[dynamic]Instruction) |
| emit_dey | proc(instructions: ^[dynamic]Instruction) |
| emit_dey_none | proc(instructions: ^[dynamic]Instruction) |
| emit_eor 3 forms | |
| emit_eor_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_eor_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_eor_imm16 | proc(instructions: ^[dynamic]Instruction, imm: i16) |
| emit_inc 2 forms | |
| emit_inc_a | proc(instructions: ^[dynamic]Instruction) |
| emit_inc_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_inx | proc(instructions: ^[dynamic]Instruction) |
| emit_inx_none | proc(instructions: ^[dynamic]Instruction) |
| emit_iny | proc(instructions: ^[dynamic]Instruction) |
| emit_iny_none | proc(instructions: ^[dynamic]Instruction) |
| emit_jml | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_jml_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_jmp | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_jmp_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_jsl | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_jsl_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_jsr | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_jsr_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_lda 3 forms | |
| emit_lda_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_lda_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_lda_imm16 | proc(instructions: ^[dynamic]Instruction, imm: i16) |
| emit_ldx 3 forms | |
| emit_ldx_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_ldx_imm16 | proc(instructions: ^[dynamic]Instruction, imm: i16) |
| emit_ldx_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_ldy 3 forms | |
| emit_ldy_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_ldy_imm16 | proc(instructions: ^[dynamic]Instruction, imm: i16) |
| emit_ldy_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_lsr 2 forms | |
| emit_lsr_a | proc(instructions: ^[dynamic]Instruction) |
| emit_lsr_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_mvn | proc(instructions: ^[dynamic]Instruction, src_bank, dst_bank: u8) |
| emit_mvn_banks | proc(instructions: ^[dynamic]Instruction, src_bank, dst_bank: u8) |
| emit_mvp | proc(instructions: ^[dynamic]Instruction, src_bank, dst_bank: u8) |
| emit_mvp_banks | proc(instructions: ^[dynamic]Instruction, src_bank, dst_bank: u8) |
| emit_nop | proc(instructions: ^[dynamic]Instruction) |
| emit_nop_none | proc(instructions: ^[dynamic]Instruction) |
| emit_ora 3 forms | |
| emit_ora_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_ora_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_ora_imm16 | proc(instructions: ^[dynamic]Instruction, imm: i16) |
| emit_pea | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_pea_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_pei | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_pei_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_per | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_per_rel_long | proc(instructions: ^[dynamic]Instruction, label: u32) |
| emit_pha | proc(instructions: ^[dynamic]Instruction) |
| emit_pha_none | proc(instructions: ^[dynamic]Instruction) |
| emit_phb | proc(instructions: ^[dynamic]Instruction) |
| emit_phb_none | proc(instructions: ^[dynamic]Instruction) |
| emit_phd | proc(instructions: ^[dynamic]Instruction) |
| emit_phd_none | proc(instructions: ^[dynamic]Instruction) |
| emit_phk | proc(instructions: ^[dynamic]Instruction) |
| emit_phk_none | proc(instructions: ^[dynamic]Instruction) |
| emit_php | proc(instructions: ^[dynamic]Instruction) |
| emit_php_none | proc(instructions: ^[dynamic]Instruction) |
| emit_phx | proc(instructions: ^[dynamic]Instruction) |
| emit_phx_none | proc(instructions: ^[dynamic]Instruction) |
| emit_phy | proc(instructions: ^[dynamic]Instruction) |
| emit_phy_none | proc(instructions: ^[dynamic]Instruction) |
| emit_pla | proc(instructions: ^[dynamic]Instruction) |
| emit_pla_none | proc(instructions: ^[dynamic]Instruction) |
| emit_plb | proc(instructions: ^[dynamic]Instruction) |
| emit_plb_none | proc(instructions: ^[dynamic]Instruction) |
| emit_pld | proc(instructions: ^[dynamic]Instruction) |
| emit_pld_none | proc(instructions: ^[dynamic]Instruction) |
| emit_plp | proc(instructions: ^[dynamic]Instruction) |
| emit_plp_none | proc(instructions: ^[dynamic]Instruction) |
| emit_plx | proc(instructions: ^[dynamic]Instruction) |
| emit_plx_none | proc(instructions: ^[dynamic]Instruction) |
| emit_ply | proc(instructions: ^[dynamic]Instruction) |
| emit_ply_none | proc(instructions: ^[dynamic]Instruction) |
| emit_rep | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_rep_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_rol 2 forms | |
| emit_rol_a | proc(instructions: ^[dynamic]Instruction) |
| emit_rol_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_ror 2 forms | |
| emit_ror_a | proc(instructions: ^[dynamic]Instruction) |
| emit_ror_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_rti | proc(instructions: ^[dynamic]Instruction) |
| emit_rti_none | proc(instructions: ^[dynamic]Instruction) |
| emit_rtl | proc(instructions: ^[dynamic]Instruction) |
| emit_rtl_none | proc(instructions: ^[dynamic]Instruction) |
| emit_rts | proc(instructions: ^[dynamic]Instruction) |
| emit_rts_none | proc(instructions: ^[dynamic]Instruction) |
| emit_sbc 3 forms | |
| emit_sbc_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_sbc_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_sbc_imm16 | proc(instructions: ^[dynamic]Instruction, imm: i16) |
| emit_sec | proc(instructions: ^[dynamic]Instruction) |
| emit_sec_none | proc(instructions: ^[dynamic]Instruction) |
| emit_sed | proc(instructions: ^[dynamic]Instruction) |
| emit_sed_none | proc(instructions: ^[dynamic]Instruction) |
| emit_sei | proc(instructions: ^[dynamic]Instruction) |
| emit_sei_none | proc(instructions: ^[dynamic]Instruction) |
| emit_sep | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_sep_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_sta | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_sta_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_stp | proc(instructions: ^[dynamic]Instruction) |
| emit_stp_none | proc(instructions: ^[dynamic]Instruction) |
| emit_stx | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_stx_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_sty | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_sty_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_stz | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_stz_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_tax | proc(instructions: ^[dynamic]Instruction) |
| emit_tax_none | proc(instructions: ^[dynamic]Instruction) |
| emit_tay | proc(instructions: ^[dynamic]Instruction) |
| emit_tay_none | proc(instructions: ^[dynamic]Instruction) |
| emit_tcd | proc(instructions: ^[dynamic]Instruction) |
| emit_tcd_none | proc(instructions: ^[dynamic]Instruction) |
| emit_tcs | proc(instructions: ^[dynamic]Instruction) |
| emit_tcs_none | proc(instructions: ^[dynamic]Instruction) |
| emit_tdc | proc(instructions: ^[dynamic]Instruction) |
| emit_tdc_none | proc(instructions: ^[dynamic]Instruction) |
| emit_trb | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_trb_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_tsb | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_tsb_mem | proc(instructions: ^[dynamic]Instruction, m: Memory) |
| emit_tsc | proc(instructions: ^[dynamic]Instruction) |
| emit_tsc_none | proc(instructions: ^[dynamic]Instruction) |
| emit_tsx | proc(instructions: ^[dynamic]Instruction) |
| emit_tsx_none | proc(instructions: ^[dynamic]Instruction) |
| emit_txa | proc(instructions: ^[dynamic]Instruction) |
| emit_txa_none | proc(instructions: ^[dynamic]Instruction) |
| emit_txs | proc(instructions: ^[dynamic]Instruction) |
| emit_txs_none | proc(instructions: ^[dynamic]Instruction) |
| emit_txy | proc(instructions: ^[dynamic]Instruction) |
| emit_txy_none | proc(instructions: ^[dynamic]Instruction) |
| emit_tya | proc(instructions: ^[dynamic]Instruction) |
| emit_tya_none | proc(instructions: ^[dynamic]Instruction) |
| emit_tyx | proc(instructions: ^[dynamic]Instruction) |
| emit_tyx_none | proc(instructions: ^[dynamic]Instruction) |
| emit_wai | proc(instructions: ^[dynamic]Instruction) |
| emit_wai_none | proc(instructions: ^[dynamic]Instruction) |
| emit_wdm | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_wdm_imm8 | proc(instructions: ^[dynamic]Instruction, imm: i8) |
| emit_xba | proc(instructions: ^[dynamic]Instruction) |
| emit_xba_none | proc(instructions: ^[dynamic]Instruction) |
| emit_xce | proc(instructions: ^[dynamic]Instruction) |
| emit_xce_none | proc(instructions: ^[dynamic]Instruction) |
| encode | proc(instructions: []Instruction, label_defs: []rexcode_isa.Label_Definition, code: []u8, relocs: ^[dynamic]Relocation, errors: ^[dynamic]rexcode_isa.Error, resolve: bool = true, base_address: u64 = 0) -> (byte_count: u32, ok: bool) |
| encode_max_code_size | (instructions: []Instruction) -> int |
| encode_max_relocation_count | (instructions: []Instruction) -> int |
| encode_reserve | proc(code: ^[dynamic]u8, relocs: ^[dynamic]Relocation, instructions: []Instruction)Pre-size the caller's encode outputs (code grown by length so code[:] is a valid emit target; relocs reserved by capacity) so the encode hot path never…Pre-size the caller's encode outputs (code grown by length so code[:] is a valid emit target; relocs reserved by capacity) so the encode hot path never reallocates. Allocates no new buffers; pass nil to skip either array. |
| fprint | proc(fd: ^os.File, instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil) |
| fprintln | proc(fd: ^os.File, instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil) |
| inst_a | (m: Mnemonic) -> Instruction |
| inst_adc 3 forms | |
| inst_adc_mem | (m: Memory) -> Instruction |
| inst_adc_imm8 | (imm: i8) -> Instruction |
| inst_adc_imm16 | (imm: i16) -> Instruction |
| inst_and 3 forms | |
| inst_and_mem | (m: Memory) -> Instruction |
| inst_and_imm8 | (imm: i8) -> Instruction |
| inst_and_imm16 | (imm: i16) -> Instruction |
| inst_asl 2 forms | |
| inst_asl_a | () -> Instruction |
| inst_asl_mem | (m: Memory) -> Instruction |
| inst_bcc | (label: u32) -> Instruction |
| inst_bcc_rel | (label: u32) -> Instruction |
| inst_bcs | (label: u32) -> Instruction |
| inst_bcs_rel | (label: u32) -> Instruction |
| inst_beq | (label: u32) -> Instruction |
| inst_beq_rel | (label: u32) -> Instruction |
| inst_bit 3 forms | |
| inst_bit_mem | (m: Memory) -> Instruction |
| inst_bit_imm8 | (imm: i8) -> Instruction |
| inst_bit_imm16 | (imm: i16) -> Instruction |
| inst_block_move | (m: Mnemonic, src_bank, dst_bank: u8) -> InstructionMVN/MVP src, dst -- caller writes "natural" order; encoder reverses to the WDC-specified opcode | dst_bank | src_bank byte layout. |
| inst_bmi | (label: u32) -> Instruction |
| inst_bmi_rel | (label: u32) -> Instruction |
| inst_bne | (label: u32) -> Instruction |
| inst_bne_rel | (label: u32) -> Instruction |
| inst_bpl | (label: u32) -> Instruction |
| inst_bpl_rel | (label: u32) -> Instruction |
| inst_bra | (label: u32) -> Instruction |
| inst_bra_rel | (label: u32) -> Instruction |
| inst_brk | (imm: i8) -> Instruction |
| inst_brk_imm8 | (imm: i8) -> Instruction |
| inst_brl | (label: u32) -> Instruction |
| inst_brl_rel_long | (label: u32) -> Instruction |
| inst_bvc | (label: u32) -> Instruction |
| inst_bvc_rel | (label: u32) -> Instruction |
| inst_bvs | (label: u32) -> Instruction |
| inst_bvs_rel | (label: u32) -> Instruction |
| inst_clc | () -> Instruction |
| inst_clc_none | () -> Instruction |
| inst_cld | () -> Instruction |
| inst_cld_none | () -> Instruction |
| inst_cli | () -> Instruction |
| inst_cli_none | () -> Instruction |
| inst_clv | () -> Instruction |
| inst_clv_none | () -> Instruction |
| inst_cmp 3 forms | |
| inst_cmp_mem | (m: Memory) -> Instruction |
| inst_cmp_imm8 | (imm: i8) -> Instruction |
| inst_cmp_imm16 | (imm: i16) -> Instruction |
| inst_cop | (imm: i8) -> Instruction |
| inst_cop_imm8 | (imm: i8) -> Instruction |
| inst_cpx 3 forms | |
| inst_cpx_imm8 | (imm: i8) -> Instruction |
| inst_cpx_imm16 | (imm: i16) -> Instruction |
| inst_cpx_mem | (m: Memory) -> Instruction |
| inst_cpy 3 forms | |
| inst_cpy_imm8 | (imm: i8) -> Instruction |
| inst_cpy_imm16 | (imm: i16) -> Instruction |
| inst_cpy_mem | (m: Memory) -> Instruction |
| inst_dec 2 forms | |
| inst_dec_a | () -> Instruction |
| inst_dec_mem | (m: Memory) -> Instruction |
| inst_dex | () -> Instruction |
| inst_dex_none | () -> Instruction |
| inst_dey | () -> Instruction |
| inst_dey_none | () -> Instruction |
| inst_eor 3 forms | |
| inst_eor_mem | (m: Memory) -> Instruction |
| inst_eor_imm8 | (imm: i8) -> Instruction |
| inst_eor_imm16 | (imm: i16) -> Instruction |
| inst_i16 | (m: Mnemonic, v: i64) -> Instruction |
| inst_i8 | (m: Mnemonic, v: i64) -> Instruction |
| inst_inc 2 forms | |
| inst_inc_a | () -> Instruction |
| inst_inc_mem | (m: Memory) -> Instruction |
| inst_inx | () -> Instruction |
| inst_inx_none | () -> Instruction |
| inst_iny | () -> Instruction |
| inst_iny_none | () -> Instruction |
| inst_jml | (m: Memory) -> Instruction |
| inst_jml_mem | (m: Memory) -> Instruction |
| inst_jmp | (m: Memory) -> Instruction |
| inst_jmp_mem | (m: Memory) -> Instruction |
| inst_jsl | (m: Memory) -> Instruction |
| inst_jsl_mem | (m: Memory) -> Instruction |
| inst_jsr | (m: Memory) -> Instruction |
| inst_jsr_mem | (m: Memory) -> Instruction |
| inst_lda 3 forms | |
| inst_lda_mem | (m: Memory) -> Instruction |
| inst_lda_imm8 | (imm: i8) -> Instruction |
| inst_lda_imm16 | (imm: i16) -> Instruction |
| inst_ldx 3 forms | |
| inst_ldx_imm8 | (imm: i8) -> Instruction |
| inst_ldx_imm16 | (imm: i16) -> Instruction |
| inst_ldx_mem | (m: Memory) -> Instruction |
| inst_ldy 3 forms | |
| inst_ldy_imm8 | (imm: i8) -> Instruction |
| inst_ldy_imm16 | (imm: i16) -> Instruction |
| inst_ldy_mem | (m: Memory) -> Instruction |
| inst_lsr 2 forms | |
| inst_lsr_a | () -> Instruction |
| inst_lsr_mem | (m: Memory) -> Instruction |
| inst_m | (m: Mnemonic, mm: Memory) -> Instruction |
| inst_mvn | (src_bank, dst_bank: u8) -> Instruction |
| inst_mvn_banks | (src_bank, dst_bank: u8) -> Instruction |
| inst_mvp | (src_bank, dst_bank: u8) -> Instruction |
| inst_mvp_banks | (src_bank, dst_bank: u8) -> Instruction |
| inst_none | (m: Mnemonic) -> Instruction |
| inst_nop | () -> Instruction |
| inst_nop_none | () -> Instruction |
| inst_ora 3 forms | |
| inst_ora_mem | (m: Memory) -> Instruction |
| inst_ora_imm8 | (imm: i8) -> Instruction |
| inst_ora_imm16 | (imm: i16) -> Instruction |
| inst_pea | (m: Memory) -> Instruction |
| inst_pea_mem | (m: Memory) -> Instruction |
| inst_pei | (m: Memory) -> Instruction |
| inst_pei_mem | (m: Memory) -> Instruction |
| inst_per | (label: u32) -> Instruction |
| inst_per_rel_long | (label: u32) -> Instruction |
| inst_pha | () -> Instruction |
| inst_pha_none | () -> Instruction |
| inst_phb | () -> Instruction |
| inst_phb_none | () -> Instruction |
| inst_phd | () -> Instruction |
| inst_phd_none | () -> Instruction |
| inst_phk | () -> Instruction |
| inst_phk_none | () -> Instruction |
| inst_php | () -> Instruction |
| inst_php_none | () -> Instruction |
| inst_phx | () -> Instruction |
| inst_phx_none | () -> Instruction |
| inst_phy | () -> Instruction |
| inst_phy_none | () -> Instruction |
| inst_pla | () -> Instruction |
| inst_pla_none | () -> Instruction |
| inst_plb | () -> Instruction |
| inst_plb_none | () -> Instruction |
| inst_pld | () -> Instruction |
| inst_pld_none | () -> Instruction |
| inst_plp | () -> Instruction |
| inst_plp_none | () -> Instruction |
| inst_plx | () -> Instruction |
| inst_plx_none | () -> Instruction |
| inst_ply | () -> Instruction |
| inst_ply_none | () -> Instruction |
| inst_rel | (m: Mnemonic, label_id: u32) -> Instruction |
| inst_rel_long | (m: Mnemonic, label_id: u32) -> Instruction |
| inst_rep | (imm: i8) -> Instruction |
| inst_rep_imm8 | (imm: i8) -> Instruction |
| inst_rol 2 forms | |
| inst_rol_a | () -> Instruction |
| inst_rol_mem | (m: Memory) -> Instruction |
| inst_ror 2 forms | |
| inst_ror_a | () -> Instruction |
| inst_ror_mem | (m: Memory) -> Instruction |
| inst_rti | () -> Instruction |
| inst_rti_none | () -> Instruction |
| inst_rtl | () -> Instruction |
| inst_rtl_none | () -> Instruction |
| inst_rts | () -> Instruction |
| inst_rts_none | () -> Instruction |
| inst_sbc 3 forms | |
| inst_sbc_mem | (m: Memory) -> Instruction |
| inst_sbc_imm8 | (imm: i8) -> Instruction |
| inst_sbc_imm16 | (imm: i16) -> Instruction |
| inst_sec | () -> Instruction |
| inst_sec_none | () -> Instruction |
| inst_sed | () -> Instruction |
| inst_sed_none | () -> Instruction |
| inst_sei | () -> Instruction |
| inst_sei_none | () -> Instruction |
| inst_sep | (imm: i8) -> Instruction |
| inst_sep_imm8 | (imm: i8) -> Instruction |
| inst_sta | (m: Memory) -> Instruction |
| inst_sta_mem | (m: Memory) -> Instruction |
| inst_stp | () -> Instruction |
| inst_stp_none | () -> Instruction |
| inst_stx | (m: Memory) -> Instruction |
| inst_stx_mem | (m: Memory) -> Instruction |
| inst_sty | (m: Memory) -> Instruction |
| inst_sty_mem | (m: Memory) -> Instruction |
| inst_stz | (m: Memory) -> Instruction |
| inst_stz_mem | (m: Memory) -> Instruction |
| inst_tax | () -> Instruction |
| inst_tax_none | () -> Instruction |
| inst_tay | () -> Instruction |
| inst_tay_none | () -> Instruction |
| inst_tcd | () -> Instruction |
| inst_tcd_none | () -> Instruction |
| inst_tcs | () -> Instruction |
| inst_tcs_none | () -> Instruction |
| inst_tdc | () -> Instruction |
| inst_tdc_none | () -> Instruction |
| inst_trb | (m: Memory) -> Instruction |
| inst_trb_mem | (m: Memory) -> Instruction |
| inst_tsb | (m: Memory) -> Instruction |
| inst_tsb_mem | (m: Memory) -> Instruction |
| inst_tsc | () -> Instruction |
| inst_tsc_none | () -> Instruction |
| inst_tsx | () -> Instruction |
| inst_tsx_none | () -> Instruction |
| inst_txa | () -> Instruction |
| inst_txa_none | () -> Instruction |
| inst_txs | () -> Instruction |
| inst_txs_none | () -> Instruction |
| inst_txy | () -> Instruction |
| inst_txy_none | () -> Instruction |
| inst_tya | () -> Instruction |
| inst_tya_none | () -> Instruction |
| inst_tyx | () -> Instruction |
| inst_tyx_none | () -> Instruction |
| inst_wai | () -> Instruction |
| inst_wai_none | () -> Instruction |
| inst_wdm | (imm: i8) -> Instruction |
| inst_wdm_imm8 | (imm: i8) -> Instruction |
| inst_xba | () -> Instruction |
| inst_xba_none | () -> Instruction |
| inst_xce | () -> Instruction |
| inst_xce_none | () -> Instruction |
| mem_abs | (a: u16) -> Memory |
| mem_abs_ind | (a: u16) -> Memory |
| mem_abs_ind_long | (a: u16) -> Memory |
| mem_abs_ind_x | (a: u16) -> Memory |
| mem_abs_x | (a: u16) -> Memory |
| mem_abs_y | (a: u16) -> Memory |
| mem_dp | (a: u8) -> Memory |
| mem_dp_ind | (a: u8) -> Memory |
| mem_dp_ind_long | (a: u8) -> Memory |
| mem_dp_ind_long_y | (a: u8) -> Memory |
| mem_dp_ind_x | (a: u8) -> Memory |
| mem_dp_ind_y | (a: u8) -> Memory |
| mem_dp_x | (a: u8) -> Memory |
| mem_dp_y | (a: u8) -> Memory |
| mem_long | (a: u32) -> Memory |
| mem_long_x | (a: u32) -> Memory |
| mem_sr | (a: u8) -> Memory |
| mem_sr_ind_y | (a: u8) -> Memory |
| mnemonic_to_string | proc(m: Mnemonic, lowercase: bool = true, allocator := context.temp_allocator) -> string |
| op_imm16 | (v: i64) -> Operand |
| op_imm8 | (v: i64) -> Operand |
| op_label | (label_id: u32, size: u8 = 1) -> Operand |
| op_mem | (m: Memory) -> Operand |
| op_reg | (r: Register) -> Operand |
| op_rel_offset | (off: i64) -> Operand |
proc(instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil) | |
| println | proc(instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil) |
| reg_class | (r: Register) -> u16 |
| reg_hw | (r: Register) -> u8 |
| sbprint | proc(sb: ^strings.Builder, instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil) |
| sbprintln | proc(sb: ^strings.Builder, instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil) |
| tprint | proc(instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil) -> string |
| tprintln | proc(instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil) -> string |
| wprint | proc(w: io.Stream, instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil) |
| wprintln | proc(w: io.Stream, instructions: []Instruction, inst_info: []Instruction_Info, label_defs: []rexcode_isa.Label_Definition, tokens: ^[dynamic]rexcode_isa.Token = nil, options: ^rexcode_isa.Print_Options = nil, label_names: ^map[rexcode_isa.Label_Offset]string = nil) |
Procedure Groups
Listed with their procedures under Procedures.
Source Files
- decoder.odin
- encoder.odin
- encoding_types.odin
- instructions.odin
- mnemonic_builders.odin
- mnemonics.odin
- operands.odin
- printer.odin
- registers.odin
- reloc.odin
- tables.odin
Generation Information
Generated with odin version dev-2026-10 (vendor "odin") Windows_amd64 @ 2026-10-10 00:25:51.511820200 +0000 UTC