package core:rexcode/isa/mos65816

⌘K
Ctrl+K
or
/

    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

    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,
    }

    Decode_Index ¶

    Decode_Index :: struct #packed {
    	start: u16,
    	count: u16,
    }

    Encode_Run ¶

    Encode_Run :: struct {
    	start: u32,
    	count: u32,
    }
     

    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,
    }

    Encoding_Flags ¶

    Encoding_Flags :: distinct bit_field u8 {
    	branch:      bool | 1,
    	cond_branch: bool | 1,
    	page_cross:  bool | 1,
    	_:           u8 | 5,
    }

    GP ¶

    GP :: enum u8 {
    	A = 0, 
    	X = 1, 
    	Y = 2, 
    	S = 3, 
    	D = 4, 
    }

    Instruction ¶

    Instruction :: struct #packed {
    	ops:           [2]Operand `fmt:"v,operand_count"`,
    	// 20 bytes (only MVN/MVP use 2; rest use 0 or 1)
    	mnemonic:      Mnemonic,
    	// 2
    	operand_count: u8,
    	// 1
    	flags:         Instruction_Flags,
    	// 1
    	length:        u8,
    	// 1
    	_:             [7]u8,
    }

    Instruction_Flags ¶

    Instruction_Flags :: distinct bit_field u8 {
    	_: u8 | 8,
    }

    Instruction_Info ¶

    Instruction_Info :: struct {
    	offset:       u32,
    	decode_entry: u16,
    	_:            u16,
    }

    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

    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 :: struct #packed {
    	using _: struct #raw_union {
    		reg:       Register,
    		mem:       Memory,
    		immediate: i64,
    		relative:  i64,
    	},
    	kind: Operand_Kind,
    	size: u8,
    }

    Related Procedures With Returns

    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, 
    }

    Register ¶

    Register :: distinct u16

    Related Procedures With Parameters

    Related Constants

    Relocation ¶

    Relocation :: struct #packed {
    	offset:   u32,
    	label_id: u32,
    	addend:   i32,
    	type:     Relocation_Type,
    	size:     u8,
    	inst_idx: u16,
    }

    Relocation_Type ¶

    Relocation_Type :: enum u8 {
    	NONE  = 0, 
    	ABS16, 
    	ABS24, 
    	REL8, 
    	REL16, 
    }

    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:: 0x0100
    A / X / Y / S / D
    REG_NONE:: 0x0000
    REG_SYS:: 0x0200
    DBR / 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.

    aprintproc(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
    aprintlnproc(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
    bprintproc(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
    bprintlnproc(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
    decodeproc(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) -> int
    Typical-case estimate of the instruction count for data.

    Typical-case estimate of the instruction count for data.

    decode_max_instruction_count(data: []u8) -> int
    Instruction-count ceiling for data (shortest instruction is 1 byte).

    Instruction-count ceiling for data (shortest instruction is 1 byte).

    decode_reserveproc(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 data (reserves on top of any existing elements; nil to skip; exact=true for the ceiling, else the estimate).

    emit_adc 3 forms
    emit_adc_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_adc_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_adc_imm16proc(instructions: ^[dynamic]Instruction, imm: i16)
    emit_and 3 forms
    emit_and_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_and_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_and_imm16proc(instructions: ^[dynamic]Instruction, imm: i16)
    emit_asl 2 forms
    emit_asl_aproc(instructions: ^[dynamic]Instruction)
    emit_asl_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_bccproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bcc_relproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bcsproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bcs_relproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_beqproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_beq_relproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bit 3 forms
    emit_bit_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_bit_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_bit_imm16proc(instructions: ^[dynamic]Instruction, imm: i16)
    emit_bmiproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bmi_relproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bneproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bne_relproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bplproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bpl_relproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_braproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bra_relproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_brkproc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_brk_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_brlproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_brl_rel_longproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bvcproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bvc_relproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bvsproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_bvs_relproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_clcproc(instructions: ^[dynamic]Instruction)
    emit_clc_noneproc(instructions: ^[dynamic]Instruction)
    emit_cldproc(instructions: ^[dynamic]Instruction)
    emit_cld_noneproc(instructions: ^[dynamic]Instruction)
    emit_cliproc(instructions: ^[dynamic]Instruction)
    emit_cli_noneproc(instructions: ^[dynamic]Instruction)
    emit_clvproc(instructions: ^[dynamic]Instruction)
    emit_clv_noneproc(instructions: ^[dynamic]Instruction)
    emit_cmp 3 forms
    emit_cmp_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_cmp_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_cmp_imm16proc(instructions: ^[dynamic]Instruction, imm: i16)
    emit_copproc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_cop_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_cpx 3 forms
    emit_cpx_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_cpx_imm16proc(instructions: ^[dynamic]Instruction, imm: i16)
    emit_cpx_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_cpy 3 forms
    emit_cpy_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_cpy_imm16proc(instructions: ^[dynamic]Instruction, imm: i16)
    emit_cpy_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_dec 2 forms
    emit_dec_aproc(instructions: ^[dynamic]Instruction)
    emit_dec_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_dexproc(instructions: ^[dynamic]Instruction)
    emit_dex_noneproc(instructions: ^[dynamic]Instruction)
    emit_deyproc(instructions: ^[dynamic]Instruction)
    emit_dey_noneproc(instructions: ^[dynamic]Instruction)
    emit_eor 3 forms
    emit_eor_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_eor_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_eor_imm16proc(instructions: ^[dynamic]Instruction, imm: i16)
    emit_inc 2 forms
    emit_inc_aproc(instructions: ^[dynamic]Instruction)
    emit_inc_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_inxproc(instructions: ^[dynamic]Instruction)
    emit_inx_noneproc(instructions: ^[dynamic]Instruction)
    emit_inyproc(instructions: ^[dynamic]Instruction)
    emit_iny_noneproc(instructions: ^[dynamic]Instruction)
    emit_jmlproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_jml_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_jmpproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_jmp_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_jslproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_jsl_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_jsrproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_jsr_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_lda 3 forms
    emit_lda_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_lda_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_lda_imm16proc(instructions: ^[dynamic]Instruction, imm: i16)
    emit_ldx 3 forms
    emit_ldx_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_ldx_imm16proc(instructions: ^[dynamic]Instruction, imm: i16)
    emit_ldx_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_ldy 3 forms
    emit_ldy_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_ldy_imm16proc(instructions: ^[dynamic]Instruction, imm: i16)
    emit_ldy_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_lsr 2 forms
    emit_lsr_aproc(instructions: ^[dynamic]Instruction)
    emit_lsr_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_mvnproc(instructions: ^[dynamic]Instruction, src_bank, dst_bank: u8)
    emit_mvn_banksproc(instructions: ^[dynamic]Instruction, src_bank, dst_bank: u8)
    emit_mvpproc(instructions: ^[dynamic]Instruction, src_bank, dst_bank: u8)
    emit_mvp_banksproc(instructions: ^[dynamic]Instruction, src_bank, dst_bank: u8)
    emit_nopproc(instructions: ^[dynamic]Instruction)
    emit_nop_noneproc(instructions: ^[dynamic]Instruction)
    emit_ora 3 forms
    emit_ora_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_ora_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_ora_imm16proc(instructions: ^[dynamic]Instruction, imm: i16)
    emit_peaproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_pea_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_peiproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_pei_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_perproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_per_rel_longproc(instructions: ^[dynamic]Instruction, label: u32)
    emit_phaproc(instructions: ^[dynamic]Instruction)
    emit_pha_noneproc(instructions: ^[dynamic]Instruction)
    emit_phbproc(instructions: ^[dynamic]Instruction)
    emit_phb_noneproc(instructions: ^[dynamic]Instruction)
    emit_phdproc(instructions: ^[dynamic]Instruction)
    emit_phd_noneproc(instructions: ^[dynamic]Instruction)
    emit_phkproc(instructions: ^[dynamic]Instruction)
    emit_phk_noneproc(instructions: ^[dynamic]Instruction)
    emit_phpproc(instructions: ^[dynamic]Instruction)
    emit_php_noneproc(instructions: ^[dynamic]Instruction)
    emit_phxproc(instructions: ^[dynamic]Instruction)
    emit_phx_noneproc(instructions: ^[dynamic]Instruction)
    emit_phyproc(instructions: ^[dynamic]Instruction)
    emit_phy_noneproc(instructions: ^[dynamic]Instruction)
    emit_plaproc(instructions: ^[dynamic]Instruction)
    emit_pla_noneproc(instructions: ^[dynamic]Instruction)
    emit_plbproc(instructions: ^[dynamic]Instruction)
    emit_plb_noneproc(instructions: ^[dynamic]Instruction)
    emit_pldproc(instructions: ^[dynamic]Instruction)
    emit_pld_noneproc(instructions: ^[dynamic]Instruction)
    emit_plpproc(instructions: ^[dynamic]Instruction)
    emit_plp_noneproc(instructions: ^[dynamic]Instruction)
    emit_plxproc(instructions: ^[dynamic]Instruction)
    emit_plx_noneproc(instructions: ^[dynamic]Instruction)
    emit_plyproc(instructions: ^[dynamic]Instruction)
    emit_ply_noneproc(instructions: ^[dynamic]Instruction)
    emit_repproc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_rep_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_rol 2 forms
    emit_rol_aproc(instructions: ^[dynamic]Instruction)
    emit_rol_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_ror 2 forms
    emit_ror_aproc(instructions: ^[dynamic]Instruction)
    emit_ror_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_rtiproc(instructions: ^[dynamic]Instruction)
    emit_rti_noneproc(instructions: ^[dynamic]Instruction)
    emit_rtlproc(instructions: ^[dynamic]Instruction)
    emit_rtl_noneproc(instructions: ^[dynamic]Instruction)
    emit_rtsproc(instructions: ^[dynamic]Instruction)
    emit_rts_noneproc(instructions: ^[dynamic]Instruction)
    emit_sbc 3 forms
    emit_sbc_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_sbc_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_sbc_imm16proc(instructions: ^[dynamic]Instruction, imm: i16)
    emit_secproc(instructions: ^[dynamic]Instruction)
    emit_sec_noneproc(instructions: ^[dynamic]Instruction)
    emit_sedproc(instructions: ^[dynamic]Instruction)
    emit_sed_noneproc(instructions: ^[dynamic]Instruction)
    emit_seiproc(instructions: ^[dynamic]Instruction)
    emit_sei_noneproc(instructions: ^[dynamic]Instruction)
    emit_sepproc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_sep_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_staproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_sta_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_stpproc(instructions: ^[dynamic]Instruction)
    emit_stp_noneproc(instructions: ^[dynamic]Instruction)
    emit_stxproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_stx_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_styproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_sty_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_stzproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_stz_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_taxproc(instructions: ^[dynamic]Instruction)
    emit_tax_noneproc(instructions: ^[dynamic]Instruction)
    emit_tayproc(instructions: ^[dynamic]Instruction)
    emit_tay_noneproc(instructions: ^[dynamic]Instruction)
    emit_tcdproc(instructions: ^[dynamic]Instruction)
    emit_tcd_noneproc(instructions: ^[dynamic]Instruction)
    emit_tcsproc(instructions: ^[dynamic]Instruction)
    emit_tcs_noneproc(instructions: ^[dynamic]Instruction)
    emit_tdcproc(instructions: ^[dynamic]Instruction)
    emit_tdc_noneproc(instructions: ^[dynamic]Instruction)
    emit_trbproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_trb_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_tsbproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_tsb_memproc(instructions: ^[dynamic]Instruction, m: Memory)
    emit_tscproc(instructions: ^[dynamic]Instruction)
    emit_tsc_noneproc(instructions: ^[dynamic]Instruction)
    emit_tsxproc(instructions: ^[dynamic]Instruction)
    emit_tsx_noneproc(instructions: ^[dynamic]Instruction)
    emit_txaproc(instructions: ^[dynamic]Instruction)
    emit_txa_noneproc(instructions: ^[dynamic]Instruction)
    emit_txsproc(instructions: ^[dynamic]Instruction)
    emit_txs_noneproc(instructions: ^[dynamic]Instruction)
    emit_txyproc(instructions: ^[dynamic]Instruction)
    emit_txy_noneproc(instructions: ^[dynamic]Instruction)
    emit_tyaproc(instructions: ^[dynamic]Instruction)
    emit_tya_noneproc(instructions: ^[dynamic]Instruction)
    emit_tyxproc(instructions: ^[dynamic]Instruction)
    emit_tyx_noneproc(instructions: ^[dynamic]Instruction)
    emit_waiproc(instructions: ^[dynamic]Instruction)
    emit_wai_noneproc(instructions: ^[dynamic]Instruction)
    emit_wdmproc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_wdm_imm8proc(instructions: ^[dynamic]Instruction, imm: i8)
    emit_xbaproc(instructions: ^[dynamic]Instruction)
    emit_xba_noneproc(instructions: ^[dynamic]Instruction)
    emit_xceproc(instructions: ^[dynamic]Instruction)
    emit_xce_noneproc(instructions: ^[dynamic]Instruction)
    encodeproc(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_reserveproc(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.

    fprintproc(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)
    fprintlnproc(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) -> Instruction
    MVN/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_stringproc(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
    printproc(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)
    printlnproc(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
    sbprintproc(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)
    sbprintlnproc(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)
    tprintproc(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
    tprintlnproc(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
    wprintproc(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)
    wprintlnproc(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

    Generation Information

    Generated with odin version dev-2026-10 (vendor "odin") Windows_amd64 @ 2026-10-10 00:25:51.511820200 +0000 UTC