package core:rexcode/isa/mos6502

⌘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

    Index

    Procedures (637)

    Types

    Address_Mode ¶

    Address_Mode :: enum u8 {
    	ZP,        // $nn
    	ZP_X,      // $nn,X
    	ZP_Y,      // $nn,Y
    	ABS,       // $nnnn
    	ABS_X,     // $nnnn,X
    	ABS_Y,     // $nnnn,Y
    	IND,       // ($nnnn) -- JMP only
    	IND_X,     // ($nn,X)
    	IND_Y,     // ($nn),Y
    	IND_ZP,    // ($nn) -- 65C02
    	IND_ABS_X, // ($nnnn,X) -- 65C02 JMP only
    }

    CPU ¶

    CPU :: enum u8 {
    	NMOS, 
    	NMOS_UNDOC, 
    	CMOS_65C02, 
    	HUC6280, 
    }
    Related Procedures With Parameters

    Decode_Entry ¶

    Decode_Entry :: struct #packed {
    	mnemonic: Mnemonic,
    	// 2
    	ops:      [3]Operand_Type,
    	// 3
    	enc:      [3]Operand_Encoding,
    	// 3
    	opcode:   u8,
    	// 1
    	length:   u8,
    	// 1
    	cpu:      CPU,
    	// 1
    	flags:    Encoding_Flags,
    }
     

    One reverse-decode entry. Differs from Encoding: carries the instruction's total byte length and only [3] operand slots (no 6502 instruction uses 4).

    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
    	cpu:      CPU,
    	// 1
    	flags:    Encoding_Flags,
    }
     

    A single instruction encoding form. The opcode byte is always at offset 0.

    ops/enc are [4] for cross-arch parity even though no real 6502 instruction uses more than 3 operands (HuC6280's block-transfer ops).

    Encoding_Flags ¶

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

    Error ¶

    Error :: rexcode_isa.Error

    Error_Code ¶

    Error_Code :: rexcode_isa.Error_Code

    GP ¶

    GP :: enum u8 {
    	A = 0, 
    	X = 1, 
    	Y = 2, 
    }

    Instruction ¶

    Instruction :: struct #packed {
    	ops:           [3]Operand `fmt:"v,operand_count"`,
    	// 30 bytes
    	mnemonic:      Mnemonic,
    	// 2
    	operand_count: u8,
    	// 1
    	flags:         Instruction_Flags,
    	// 1
    	length:        u8,
    	// 1 (filled by decoder; 1..7)
    	_:             [1]u8,
    }
    Related Procedures With Returns

    Instruction_Flags ¶

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

    Instruction_Info ¶

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

    Label_Definition ¶

    Label_Definition :: rexcode_isa.Label_Definition
    Related Constants

    Label_Map ¶

    Label_Map :: rexcode_isa.Label_Map

    Memory ¶

    Memory :: struct #packed {
    	address: u16,
    	mode:    Address_Mode,
    	_:       u8,
    }
    Related Procedures With Parameters
    Related Procedures With Returns

    Mnemonic ¶

    Mnemonic :: enum u16 {
    	INVALID  = 0, 
    	// Arithmetic / logical
    	ADC, 
    	AND, 
    	ASL, 
    	BIT, 
    	CMP, 
    	CPX, 
    	CPY, 
    	DEC, 
    	DEX, 
    	DEY, 
    	EOR, 
    	INC, 
    	INX, 
    	INY, 
    	LSR, 
    	ORA, 
    	ROL, 
    	ROR, 
    	SBC, 
    	// Branches
    	BCC, 
    	BCS, 
    	BEQ, 
    	BMI, 
    	BNE, 
    	BPL, 
    	BVC, 
    	BVS, 
    	// Jumps / subroutines / interrupts
    	JMP, 
    	JSR, 
    	RTI, 
    	RTS, 
    	BRK, 
    	// Flag ops
    	CLC, 
    	CLD, 
    	CLI, 
    	CLV, 
    	SEC, 
    	SED, 
    	SEI, 
    	// Loads / stores
    	LDA, 
    	LDX, 
    	LDY, 
    	STA, 
    	STX, 
    	STY, 
    	// Stack / transfer
    	PHA, 
    	PHP, 
    	PLA, 
    	PLP, 
    	TAX, 
    	TAY, 
    	TSX, 
    	TXA, 
    	TXS, 
    	TYA, 
    	// NOP
    	NOP, 
    	LAX,          // LDA + LDX (load A and X from memory)
    	SAX_NMOS,     // store A AND X to memory (also called AAX / AXS-undoc)
    	DCP,          // DEC + CMP (memory)
    	ISC,          // INC + SBC (also ISB)
    	RLA,          // ROL + AND
    	RRA,          // ROR + ADC
    	SLO,          // ASL + ORA
    	SRE,          // LSR + EOR
    	ALR,          // AND #imm + LSR A
    	ANC,          // AND #imm with carry from N
    	ARR,          // AND #imm + ROR A
    	AXS,          // X = (A AND X) - imm  (also SBX)
    	LAS,          // LDA / TSX / AND with stack pointer
    	ANE,          // A = (A | $EE) AND X AND imm  -- unstable (also XAA)
    	LXA,          // A = X = (A | $EE) AND imm    -- unstable
    	SHA,          // store A AND X AND high+1
    	SHX,          // store X AND high+1
    	SHY,          // store Y AND high+1
    	TAS,          // S = A AND X; store S AND high+1
    	JAM,          // halt the CPU (also KIL / HLT)
    	USBC,         // same as SBC #imm but at $EB (an undocumented alias)
    	DOP,          // double NOP (skips one operand byte)
    	TOP,          // triple NOP (skips two operand bytes)
    	BRA,          // branch always
    	INA,          // INC A
    	DEA,          // DEC A
    	PHX, 
    	PHY, 
    	PLX, 
    	PLY, 
    	STZ,          // store zero
    	TRB, 
    	TSB,          // test-and-reset / test-and-set bits
    	STP, 
    	WAI,          // WDC: stop, wait-for-interrupt
    	// 65C02 Rockwell bit ops -- 32 distinct opcodes
    	RMB0, 
    	RMB1, 
    	RMB2, 
    	RMB3, 
    	RMB4, 
    	RMB5, 
    	RMB6, 
    	RMB7, 
    	SMB0, 
    	SMB1, 
    	SMB2, 
    	SMB3, 
    	SMB4, 
    	SMB5, 
    	SMB6, 
    	SMB7, 
    	BBR0, 
    	BBR1, 
    	BBR2, 
    	BBR3, 
    	BBR4, 
    	BBR5, 
    	BBR6, 
    	BBR7, 
    	BBS0, 
    	BBS1, 
    	BBS2, 
    	BBS3, 
    	BBS4, 
    	BBS5, 
    	BBS6, 
    	BBS7, 
    	SXY,          // swap X, Y
    	SAX,          // swap A, X   (NB: distinct from undocumented NMOS SAX_NMOS)
    	SAY,          // swap A, Y
    	CLA, 
    	CLX, 
    	CLY,          // clear A / X / Y
    	CSH, 
    	CSL,          // CPU speed high / low (7.16 MHz vs 1.79 MHz)
    	SET,          // set T flag (next op uses zp address as accumulator)
    	ST0, 
    	ST1, 
    	ST2,          // store immediate to MMR0/1/2
    	TAM, 
    	TMA,          // transfer A to/from MMR (immediate-selected)
    	TST,          // bit test of immediate against memory
    	BSR,          // branch to subroutine (PC-relative)
    	// HuC6280 block transfer instructions (7-byte encoding)
    	//   src(2) -> dst(2), len(2) bytes
    	TII,          // transfer increment-increment   (memcpy ascending)
    	TDD,          // transfer decrement-decrement   (memcpy descending)
    	TIN,          // transfer increment-no-change   (fill from src)
    	TIA,          // transfer increment-alternate   (interleaved)
    	TAI,          // transfer alternate-increment   (interleaved)
    }
    Related Procedures With Parameters

    Operand ¶

    Operand :: struct #packed {
    	using _: struct #raw_union {
    		reg:       Register,
    		// 2 bytes
    		mem:       Memory,
    		// 4 bytes
    		immediate: i64,
    		// 8 bytes
    		relative:  i64,
    	},
    	kind: Operand_Kind,
    	// 1
    	size: u8,
    }
    Related Procedures With Returns

    Operand_Encoding ¶

    Operand_Encoding :: enum u8 {
    	NONE, 
    	IMPL,        // implicit / accumulator -- no bytes emitted
    	BYTE_1_IMM,  // 8-bit immediate at offset 1
    	BYTE_1_ADDR, // 8-bit zero-page address at offset 1
    	BYTE_1_REL,  // signed 8-bit PC-rel at offset 1
    	WORD_1_ADDR, // 16-bit little-endian absolute at offset 1
    	BYTE_2_REL,  // signed 8-bit PC-rel at offset 2 (BBR/BBS)
    	WORD_1,      // 16-bit LE at offset 1 (HuC block xfer src)
    	WORD_3,      // 16-bit LE at offset 3 (HuC block xfer dst)
    	WORD_5,      // 16-bit LE at offset 5 (HuC block xfer len)
    	BYTE_2_ADDR, // 8-bit zero-page address at offset 2 (HuC TST # zp)
    	WORD_2_ADDR, // 16-bit LE absolute at offset 2 (HuC TST # abs)
    }
     

    Where the operand's bytes go inside the instruction word 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 (e.g. ROL A) -- no operand bytes encoded
    	IMM_8,         // #$nn
    	REL,           // signed byte PC-rel branch target
    	MEM_ZP,        // $nn
    	MEM_ZP_X,      // $nn,X
    	MEM_ZP_Y,      // $nn,Y
    	MEM_ABS,       // $nnnn
    	MEM_ABS_X,     // $nnnn,X
    	MEM_ABS_Y,     // $nnnn,Y
    	MEM_IND,       // ($nnnn) -- NMOS/65C02 JMP only
    	MEM_IND_X,     // ($nn,X)
    	MEM_IND_Y,     // ($nn),Y
    	MEM_IND_ZP,    // ($nn) -- 65C02
    	MEM_IND_ABS_X, // ($nnnn,X) -- 65C02 JMP only
    	IMM_16,        // unsigned 16-bit literal (HuC6280 block xfer operands)
    }
     

    What the user passes in.

    Print_Result :: rexcode_isa.Print_Result

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

    Token ¶

    Token :: rexcode_isa.Token

    Token_Kind ¶

    Token_Kind :: rexcode_isa.Token_Kind

    Constants

    A ¶

    A :: Register(REG_GP | 0)

    DEFAULT_PRINT_OPTIONS ¶

    DEFAULT_PRINT_OPTIONS: rexcode_isa.Print_Options : isa.DEFAULT_PRINT_OPTIONS

    LABEL_UNDEFINED ¶

    LABEL_UNDEFINED: rexcode_isa.Label_Definition : isa.LABEL_UNDEFINED

    MAX_INST_SIZE ¶

    MAX_INST_SIZE :: 7
     

    HuC6280 block transfer

    NONE ¶

    NONE :: Register(0xFFFF)

    P ¶

    P :: Register(REG_SYS | 1)

    PC ¶

    PC :: Register(REG_SYS | 2)

    REG_GP ¶

    REG_GP :: 0x0100
     

    A / X / Y

    REG_NONE ¶

    REG_NONE :: 0x0000

    REG_SYS ¶

    REG_SYS :: 0x0200
     

    S / P / PC

    S ¶

    S :: Register(REG_SYS | 0)

    X ¶

    X :: Register(REG_GP | 1)

    Y ¶

    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

    aprint ¶

    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[u32]string = nil, 
    	allocator := context.allocator, 
    ) -> string {…}

    aprintln ¶

    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[u32]string = nil, 
    	allocator := context.allocator, 
    ) -> string {…}

    bprint ¶

    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[u32]string = nil, 
    ) -> string {…}

    bprintln ¶

    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[u32]string = nil, 
    ) -> string {…}

    decode ¶

    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, 
    	cpu:          CPU = .NMOS, 
    ) -> (byte_count: u32, ok: bool) {…}

    decode_estimate_instruction_count ¶

    decode_estimate_instruction_count :: proc "contextless" (data: []u8) -> int {…}
     

    Typical-case estimate of the instruction count for data.

    decode_max_instruction_count ¶

    decode_max_instruction_count :: proc "contextless" (data: []u8) -> int {…}
     

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

    decode_reserve ¶

    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).

    emit_adc_imm8 ¶

    emit_adc_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}
    Related Procedure Groups

    emit_adc_m ¶

    emit_adc_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_alr_imm8 ¶

    emit_alr_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}

    emit_anc_imm8 ¶

    emit_anc_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}

    emit_and_imm8 ¶

    emit_and_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}
    Related Procedure Groups

    emit_and_m ¶

    emit_and_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_ane_imm8 ¶

    emit_ane_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}

    emit_arr_imm8 ¶

    emit_arr_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}

    emit_asl_a ¶

    emit_asl_a :: proc(instructions: ^[dynamic]Instruction) {…}
    Related Procedure Groups

    emit_asl_m ¶

    emit_asl_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_axs_imm8 ¶

    emit_axs_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}

    emit_bbr0_zp_rel ¶

    emit_bbr0_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbr1_zp_rel ¶

    emit_bbr1_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbr2_zp_rel ¶

    emit_bbr2_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbr3_zp_rel ¶

    emit_bbr3_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbr4_zp_rel ¶

    emit_bbr4_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbr5_zp_rel ¶

    emit_bbr5_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbr6_zp_rel ¶

    emit_bbr6_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbr7_zp_rel ¶

    emit_bbr7_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbs0_zp_rel ¶

    emit_bbs0_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbs1_zp_rel ¶

    emit_bbs1_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbs2_zp_rel ¶

    emit_bbs2_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbs3_zp_rel ¶

    emit_bbs3_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbs4_zp_rel ¶

    emit_bbs4_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbs5_zp_rel ¶

    emit_bbs5_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbs6_zp_rel ¶

    emit_bbs6_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bbs7_zp_rel ¶

    emit_bbs7_zp_rel :: proc(instructions: ^[dynamic]Instruction, zp: u8, label_id: u32) {…}

    emit_bcc_rel ¶

    emit_bcc_rel :: proc(instructions: ^[dynamic]Instruction, label_id: u32) {…}

    emit_bcs_rel ¶

    emit_bcs_rel :: proc(instructions: ^[dynamic]Instruction, label_id: u32) {…}

    emit_beq_rel ¶

    emit_beq_rel :: proc(instructions: ^[dynamic]Instruction, label_id: u32) {…}

    emit_bit_imm8 ¶

    emit_bit_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}
    Related Procedure Groups

    emit_bit_m ¶

    emit_bit_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_bmi_rel ¶

    emit_bmi_rel :: proc(instructions: ^[dynamic]Instruction, label_id: u32) {…}

    emit_bne_rel ¶

    emit_bne_rel :: proc(instructions: ^[dynamic]Instruction, label_id: u32) {…}

    emit_bpl_rel ¶

    emit_bpl_rel :: proc(instructions: ^[dynamic]Instruction, label_id: u32) {…}

    emit_bra_rel ¶

    emit_bra_rel :: proc(instructions: ^[dynamic]Instruction, label_id: u32) {…}

    emit_brk_none ¶

    emit_brk_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_bsr_rel ¶

    emit_bsr_rel :: proc(instructions: ^[dynamic]Instruction, label_id: u32) {…}

    emit_bvc_rel ¶

    emit_bvc_rel :: proc(instructions: ^[dynamic]Instruction, label_id: u32) {…}

    emit_bvs_rel ¶

    emit_bvs_rel :: proc(instructions: ^[dynamic]Instruction, label_id: u32) {…}

    emit_cla_none ¶

    emit_cla_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_clc_none ¶

    emit_clc_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_cld_none ¶

    emit_cld_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_cli_none ¶

    emit_cli_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_clv_none ¶

    emit_clv_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_clx_none ¶

    emit_clx_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_cly_none ¶

    emit_cly_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_cmp_imm8 ¶

    emit_cmp_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}
    Related Procedure Groups

    emit_cmp_m ¶

    emit_cmp_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_cpx_imm8 ¶

    emit_cpx_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}
    Related Procedure Groups

    emit_cpx_m ¶

    emit_cpx_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_cpy_imm8 ¶

    emit_cpy_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}
    Related Procedure Groups

    emit_cpy_m ¶

    emit_cpy_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_csh_none ¶

    emit_csh_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_csl_none ¶

    emit_csl_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_dcp_m ¶

    emit_dcp_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_dea_a ¶

    emit_dea_a :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_dec_a ¶

    emit_dec_a :: proc(instructions: ^[dynamic]Instruction) {…}
    Related Procedure Groups

    emit_dec_m ¶

    emit_dec_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_dex_none ¶

    emit_dex_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_dey_none ¶

    emit_dey_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_dop_imm8 ¶

    emit_dop_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}
    Related Procedure Groups

    emit_dop_m ¶

    emit_dop_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_eor_imm8 ¶

    emit_eor_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}
    Related Procedure Groups

    emit_eor_m ¶

    emit_eor_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_ina_a ¶

    emit_ina_a :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_inc_a ¶

    emit_inc_a :: proc(instructions: ^[dynamic]Instruction) {…}
    Related Procedure Groups

    emit_inc_m ¶

    emit_inc_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_inx_none ¶

    emit_inx_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_iny_none ¶

    emit_iny_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_isc_m ¶

    emit_isc_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_jam_none ¶

    emit_jam_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_jmp_m ¶

    emit_jmp_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_jsr_m ¶

    emit_jsr_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_las_m ¶

    emit_las_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_lax_m ¶

    emit_lax_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_lda_imm8 ¶

    emit_lda_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}
    Related Procedure Groups

    emit_lda_m ¶

    emit_lda_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_ldx_imm8 ¶

    emit_ldx_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}
    Related Procedure Groups

    emit_ldx_m ¶

    emit_ldx_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_ldy_imm8 ¶

    emit_ldy_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}
    Related Procedure Groups

    emit_ldy_m ¶

    emit_ldy_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_lsr_a ¶

    emit_lsr_a :: proc(instructions: ^[dynamic]Instruction) {…}
    Related Procedure Groups

    emit_lsr_m ¶

    emit_lsr_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_lxa_imm8 ¶

    emit_lxa_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}

    emit_nop_none ¶

    emit_nop_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_ora_imm8 ¶

    emit_ora_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}
    Related Procedure Groups

    emit_ora_m ¶

    emit_ora_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_pha_none ¶

    emit_pha_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_php_none ¶

    emit_php_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_phx_none ¶

    emit_phx_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_phy_none ¶

    emit_phy_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_pla_none ¶

    emit_pla_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_plp_none ¶

    emit_plp_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_plx_none ¶

    emit_plx_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_ply_none ¶

    emit_ply_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_rla_m ¶

    emit_rla_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_rmb0_m ¶

    emit_rmb0_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_rmb1_m ¶

    emit_rmb1_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_rmb2_m ¶

    emit_rmb2_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_rmb3_m ¶

    emit_rmb3_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_rmb4_m ¶

    emit_rmb4_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_rmb5_m ¶

    emit_rmb5_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_rmb6_m ¶

    emit_rmb6_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_rmb7_m ¶

    emit_rmb7_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_rol_a ¶

    emit_rol_a :: proc(instructions: ^[dynamic]Instruction) {…}
    Related Procedure Groups

    emit_rol_m ¶

    emit_rol_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_ror_a ¶

    emit_ror_a :: proc(instructions: ^[dynamic]Instruction) {…}
    Related Procedure Groups

    emit_ror_m ¶

    emit_ror_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_rra_m ¶

    emit_rra_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_rti_none ¶

    emit_rti_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_rts_none ¶

    emit_rts_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_sax_nmos_m ¶

    emit_sax_nmos_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_sax_none ¶

    emit_sax_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_say_none ¶

    emit_say_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_sbc_imm8 ¶

    emit_sbc_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}
    Related Procedure Groups

    emit_sbc_m ¶

    emit_sbc_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}
    Related Procedure Groups

    emit_sec_none ¶

    emit_sec_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_sed_none ¶

    emit_sed_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_sei_none ¶

    emit_sei_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_set_none ¶

    emit_set_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_sha_m ¶

    emit_sha_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_shx_m ¶

    emit_shx_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_shy_m ¶

    emit_shy_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_slo_m ¶

    emit_slo_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_smb0_m ¶

    emit_smb0_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_smb1_m ¶

    emit_smb1_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_smb2_m ¶

    emit_smb2_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_smb3_m ¶

    emit_smb3_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_smb4_m ¶

    emit_smb4_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_smb5_m ¶

    emit_smb5_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_smb6_m ¶

    emit_smb6_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_smb7_m ¶

    emit_smb7_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_sre_m ¶

    emit_sre_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_st0_imm8 ¶

    emit_st0_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}

    emit_st1_imm8 ¶

    emit_st1_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}

    emit_st2_imm8 ¶

    emit_st2_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}

    emit_sta_m ¶

    emit_sta_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_stp_none ¶

    emit_stp_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_stx_m ¶

    emit_stx_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_sty_m ¶

    emit_sty_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_stz_m ¶

    emit_stz_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_sxy_none ¶

    emit_sxy_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_tai_block ¶

    emit_tai_block :: proc(instructions: ^[dynamic]Instruction, src, dst, length_val: u16) {…}

    emit_tam_imm8 ¶

    emit_tam_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}

    emit_tas_m ¶

    emit_tas_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_tax_none ¶

    emit_tax_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_tay_none ¶

    emit_tay_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_tdd_block ¶

    emit_tdd_block :: proc(instructions: ^[dynamic]Instruction, src, dst, length_val: u16) {…}

    emit_tia_block ¶

    emit_tia_block :: proc(instructions: ^[dynamic]Instruction, src, dst, length_val: u16) {…}

    emit_tii_block ¶

    emit_tii_block :: proc(instructions: ^[dynamic]Instruction, src, dst, length_val: u16) {…}

    emit_tin_block ¶

    emit_tin_block :: proc(instructions: ^[dynamic]Instruction, src, dst, length_val: u16) {…}

    emit_tma_imm8 ¶

    emit_tma_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}

    emit_top_m ¶

    emit_top_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_trb_m ¶

    emit_trb_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_tsb_m ¶

    emit_tsb_m :: proc(instructions: ^[dynamic]Instruction, m: Memory) {…}

    emit_tst_tst ¶

    emit_tst_tst :: proc(instructions: ^[dynamic]Instruction, imm: i64, m: Memory) {…}

    emit_tsx_none ¶

    emit_tsx_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_txa_none ¶

    emit_txa_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_txs_none ¶

    emit_txs_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_tya_none ¶

    emit_tya_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_usbc_imm8 ¶

    emit_usbc_imm8 :: proc(instructions: ^[dynamic]Instruction, imm: i64) {…}

    emit_wai_none ¶

    emit_wai_none :: proc(instructions: ^[dynamic]Instruction) {…}

    encode ¶

    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 ¶

    encode_max_code_size :: proc "contextless" (instructions: []Instruction) -> int {…}

    encode_max_relocation_count ¶

    encode_max_relocation_count :: proc "contextless" (instructions: []Instruction) -> int {…}

    encode_reserve ¶

    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 reallocates. Allocates no new buffers; pass nil to skip either array.

    fprint ¶

    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[u32]string = nil, 
    ) {…}

    fprintln ¶

    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[u32]string = nil, 
    ) {…}

    inst_a ¶

    inst_a :: proc "contextless" (m: Mnemonic) -> Instruction {…}

    inst_adc_imm8 ¶

    inst_adc_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}
    Related Procedure Groups

    inst_adc_m ¶

    inst_adc_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_alr_imm8 ¶

    inst_alr_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}

    inst_anc_imm8 ¶

    inst_anc_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}

    inst_and_imm8 ¶

    inst_and_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}
    Related Procedure Groups

    inst_and_m ¶

    inst_and_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_ane_imm8 ¶

    inst_ane_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}

    inst_arr_imm8 ¶

    inst_arr_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}

    inst_asl_a ¶

    inst_asl_a :: proc "contextless" () -> Instruction {…}
    Related Procedure Groups

    inst_asl_m ¶

    inst_asl_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_axs_imm8 ¶

    inst_axs_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}

    inst_bbr0_zp_rel ¶

    inst_bbr0_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbr1_zp_rel ¶

    inst_bbr1_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbr2_zp_rel ¶

    inst_bbr2_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbr3_zp_rel ¶

    inst_bbr3_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbr4_zp_rel ¶

    inst_bbr4_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbr5_zp_rel ¶

    inst_bbr5_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbr6_zp_rel ¶

    inst_bbr6_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbr7_zp_rel ¶

    inst_bbr7_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbs0_zp_rel ¶

    inst_bbs0_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbs1_zp_rel ¶

    inst_bbs1_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbs2_zp_rel ¶

    inst_bbs2_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbs3_zp_rel ¶

    inst_bbs3_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbs4_zp_rel ¶

    inst_bbs4_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbs5_zp_rel ¶

    inst_bbs5_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbs6_zp_rel ¶

    inst_bbs6_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bbs7_zp_rel ¶

    inst_bbs7_zp_rel :: proc "contextless" (zp: u8, label_id: u32) -> Instruction {…}

    inst_bcc_rel ¶

    inst_bcc_rel :: proc "contextless" (label_id: u32) -> Instruction {…}

    inst_bcs_rel ¶

    inst_bcs_rel :: proc "contextless" (label_id: u32) -> Instruction {…}

    inst_beq_rel ¶

    inst_beq_rel :: proc "contextless" (label_id: u32) -> Instruction {…}

    inst_bit_imm8 ¶

    inst_bit_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}
    Related Procedure Groups

    inst_bit_m ¶

    inst_bit_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_block ¶

    inst_block :: proc "contextless" (m: Mnemonic, src, dst, length_val: u16) -> Instruction {…}
     

    HuC6280 block transfer: src, dst, length (7-byte encoding).

    inst_bmi_rel ¶

    inst_bmi_rel :: proc "contextless" (label_id: u32) -> Instruction {…}

    inst_bne_rel ¶

    inst_bne_rel :: proc "contextless" (label_id: u32) -> Instruction {…}

    inst_bpl_rel ¶

    inst_bpl_rel :: proc "contextless" (label_id: u32) -> Instruction {…}

    inst_bra_rel ¶

    inst_bra_rel :: proc "contextless" (label_id: u32) -> Instruction {…}

    inst_brk_none ¶

    inst_brk_none :: proc "contextless" () -> Instruction {…}

    inst_bsr_rel ¶

    inst_bsr_rel :: proc "contextless" (label_id: u32) -> Instruction {…}

    inst_bvc_rel ¶

    inst_bvc_rel :: proc "contextless" (label_id: u32) -> Instruction {…}

    inst_bvs_rel ¶

    inst_bvs_rel :: proc "contextless" (label_id: u32) -> Instruction {…}

    inst_cla_none ¶

    inst_cla_none :: proc "contextless" () -> Instruction {…}

    inst_clc_none ¶

    inst_clc_none :: proc "contextless" () -> Instruction {…}

    inst_cld_none ¶

    inst_cld_none :: proc "contextless" () -> Instruction {…}

    inst_cli_none ¶

    inst_cli_none :: proc "contextless" () -> Instruction {…}

    inst_clv_none ¶

    inst_clv_none :: proc "contextless" () -> Instruction {…}

    inst_clx_none ¶

    inst_clx_none :: proc "contextless" () -> Instruction {…}

    inst_cly_none ¶

    inst_cly_none :: proc "contextless" () -> Instruction {…}

    inst_cmp_imm8 ¶

    inst_cmp_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}
    Related Procedure Groups

    inst_cmp_m ¶

    inst_cmp_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_cpx_imm8 ¶

    inst_cpx_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}
    Related Procedure Groups

    inst_cpx_m ¶

    inst_cpx_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_cpy_imm8 ¶

    inst_cpy_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}
    Related Procedure Groups

    inst_cpy_m ¶

    inst_cpy_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_csh_none ¶

    inst_csh_none :: proc "contextless" () -> Instruction {…}

    inst_csl_none ¶

    inst_csl_none :: proc "contextless" () -> Instruction {…}

    inst_dcp_m ¶

    inst_dcp_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_dea_a ¶

    inst_dea_a :: proc "contextless" () -> Instruction {…}

    inst_dec_a ¶

    inst_dec_a :: proc "contextless" () -> Instruction {…}
    Related Procedure Groups

    inst_dec_m ¶

    inst_dec_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_dex_none ¶

    inst_dex_none :: proc "contextless" () -> Instruction {…}

    inst_dey_none ¶

    inst_dey_none :: proc "contextless" () -> Instruction {…}

    inst_dop_imm8 ¶

    inst_dop_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}
    Related Procedure Groups

    inst_dop_m ¶

    inst_dop_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_eor_imm8 ¶

    inst_eor_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}
    Related Procedure Groups

    inst_eor_m ¶

    inst_eor_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_i ¶

    inst_i :: proc "contextless" (m: Mnemonic, imm: i64) -> Instruction {…}

    inst_ina_a ¶

    inst_ina_a :: proc "contextless" () -> Instruction {…}

    inst_inc_a ¶

    inst_inc_a :: proc "contextless" () -> Instruction {…}
    Related Procedure Groups

    inst_inc_m ¶

    inst_inc_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_inx_none ¶

    inst_inx_none :: proc "contextless" () -> Instruction {…}

    inst_iny_none ¶

    inst_iny_none :: proc "contextless" () -> Instruction {…}

    inst_isc_m ¶

    inst_isc_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_jam_none ¶

    inst_jam_none :: proc "contextless" () -> Instruction {…}

    inst_jmp_m ¶

    inst_jmp_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_jsr_m ¶

    inst_jsr_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_las_m ¶

    inst_las_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_lax_m ¶

    inst_lax_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_lda_imm8 ¶

    inst_lda_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}
    Related Procedure Groups

    inst_lda_m ¶

    inst_lda_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_ldx_imm8 ¶

    inst_ldx_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}
    Related Procedure Groups

    inst_ldx_m ¶

    inst_ldx_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_ldy_imm8 ¶

    inst_ldy_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}
    Related Procedure Groups

    inst_ldy_m ¶

    inst_ldy_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_lsr_a ¶

    inst_lsr_a :: proc "contextless" () -> Instruction {…}
    Related Procedure Groups

    inst_lsr_m ¶

    inst_lsr_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_lxa_imm8 ¶

    inst_lxa_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}

    inst_m ¶

    inst_m :: proc "contextless" (m: Mnemonic, mm: Memory) -> Instruction {…}

    inst_none ¶

    inst_none :: proc "contextless" (m: Mnemonic) -> Instruction {…}

    inst_nop_none ¶

    inst_nop_none :: proc "contextless" () -> Instruction {…}

    inst_ora_imm8 ¶

    inst_ora_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}
    Related Procedure Groups

    inst_ora_m ¶

    inst_ora_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_pha_none ¶

    inst_pha_none :: proc "contextless" () -> Instruction {…}

    inst_php_none ¶

    inst_php_none :: proc "contextless" () -> Instruction {…}

    inst_phx_none ¶

    inst_phx_none :: proc "contextless" () -> Instruction {…}

    inst_phy_none ¶

    inst_phy_none :: proc "contextless" () -> Instruction {…}

    inst_pla_none ¶

    inst_pla_none :: proc "contextless" () -> Instruction {…}

    inst_plp_none ¶

    inst_plp_none :: proc "contextless" () -> Instruction {…}

    inst_plx_none ¶

    inst_plx_none :: proc "contextless" () -> Instruction {…}

    inst_ply_none ¶

    inst_ply_none :: proc "contextless" () -> Instruction {…}

    inst_rel ¶

    inst_rel :: proc "contextless" (m: Mnemonic, label_id: u32) -> Instruction {…}

    inst_rla_m ¶

    inst_rla_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_rmb0_m ¶

    inst_rmb0_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_rmb1_m ¶

    inst_rmb1_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_rmb2_m ¶

    inst_rmb2_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_rmb3_m ¶

    inst_rmb3_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_rmb4_m ¶

    inst_rmb4_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_rmb5_m ¶

    inst_rmb5_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_rmb6_m ¶

    inst_rmb6_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_rmb7_m ¶

    inst_rmb7_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_rol_a ¶

    inst_rol_a :: proc "contextless" () -> Instruction {…}
    Related Procedure Groups

    inst_rol_m ¶

    inst_rol_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_ror_a ¶

    inst_ror_a :: proc "contextless" () -> Instruction {…}
    Related Procedure Groups

    inst_ror_m ¶

    inst_ror_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_rra_m ¶

    inst_rra_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_rti_none ¶

    inst_rti_none :: proc "contextless" () -> Instruction {…}

    inst_rts_none ¶

    inst_rts_none :: proc "contextless" () -> Instruction {…}

    inst_sax_nmos_m ¶

    inst_sax_nmos_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_sax_none ¶

    inst_sax_none :: proc "contextless" () -> Instruction {…}

    inst_say_none ¶

    inst_say_none :: proc "contextless" () -> Instruction {…}

    inst_sbc_imm8 ¶

    inst_sbc_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}
    Related Procedure Groups

    inst_sbc_m ¶

    inst_sbc_m :: proc "contextless" (m: Memory) -> Instruction {…}
    Related Procedure Groups

    inst_sec_none ¶

    inst_sec_none :: proc "contextless" () -> Instruction {…}

    inst_sed_none ¶

    inst_sed_none :: proc "contextless" () -> Instruction {…}

    inst_sei_none ¶

    inst_sei_none :: proc "contextless" () -> Instruction {…}

    inst_set_none ¶

    inst_set_none :: proc "contextless" () -> Instruction {…}

    inst_sha_m ¶

    inst_sha_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_shx_m ¶

    inst_shx_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_shy_m ¶

    inst_shy_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_slo_m ¶

    inst_slo_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_smb0_m ¶

    inst_smb0_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_smb1_m ¶

    inst_smb1_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_smb2_m ¶

    inst_smb2_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_smb3_m ¶

    inst_smb3_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_smb4_m ¶

    inst_smb4_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_smb5_m ¶

    inst_smb5_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_smb6_m ¶

    inst_smb6_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_smb7_m ¶

    inst_smb7_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_sre_m ¶

    inst_sre_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_st0_imm8 ¶

    inst_st0_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}

    inst_st1_imm8 ¶

    inst_st1_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}

    inst_st2_imm8 ¶

    inst_st2_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}

    inst_sta_m ¶

    inst_sta_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_stp_none ¶

    inst_stp_none :: proc "contextless" () -> Instruction {…}

    inst_stx_m ¶

    inst_stx_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_sty_m ¶

    inst_sty_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_stz_m ¶

    inst_stz_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_sxy_none ¶

    inst_sxy_none :: proc "contextless" () -> Instruction {…}

    inst_tai_block ¶

    inst_tai_block :: proc "contextless" (src, dst, length_val: u16) -> Instruction {…}

    inst_tam_imm8 ¶

    inst_tam_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}

    inst_tas_m ¶

    inst_tas_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_tax_none ¶

    inst_tax_none :: proc "contextless" () -> Instruction {…}

    inst_tay_none ¶

    inst_tay_none :: proc "contextless" () -> Instruction {…}

    inst_tdd_block ¶

    inst_tdd_block :: proc "contextless" (src, dst, length_val: u16) -> Instruction {…}

    inst_tia_block ¶

    inst_tia_block :: proc "contextless" (src, dst, length_val: u16) -> Instruction {…}

    inst_tii_block ¶

    inst_tii_block :: proc "contextless" (src, dst, length_val: u16) -> Instruction {…}

    inst_tin_block ¶

    inst_tin_block :: proc "contextless" (src, dst, length_val: u16) -> Instruction {…}

    inst_tma_imm8 ¶

    inst_tma_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}

    inst_top_m ¶

    inst_top_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_trb_m ¶

    inst_trb_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_tsb_m ¶

    inst_tsb_m :: proc "contextless" (m: Memory) -> Instruction {…}

    inst_tst_tst ¶

    inst_tst_tst :: proc "contextless" (imm: i64, m: Memory) -> Instruction {…}

    inst_tsx_none ¶

    inst_tsx_none :: proc "contextless" () -> Instruction {…}

    inst_txa_none ¶

    inst_txa_none :: proc "contextless" () -> Instruction {…}

    inst_txs_none ¶

    inst_txs_none :: proc "contextless" () -> Instruction {…}

    inst_tya_none ¶

    inst_tya_none :: proc "contextless" () -> Instruction {…}

    inst_usbc_imm8 ¶

    inst_usbc_imm8 :: proc "contextless" (imm: i64) -> Instruction {…}

    inst_wai_none ¶

    inst_wai_none :: proc "contextless" () -> Instruction {…}

    inst_zp_rel ¶

    inst_zp_rel :: proc "contextless" (m: Mnemonic, zp: u8, label_id: u32) -> Instruction {…}
     

    BBR/BBS: zero-page byte + relative branch (3-byte encoding).

    mem_abs ¶

    mem_abs :: proc "contextless" (addr: u16) -> Memory {…}

    mem_abs_x ¶

    mem_abs_x :: proc "contextless" (addr: u16) -> Memory {…}

    mem_abs_y ¶

    mem_abs_y :: proc "contextless" (addr: u16) -> Memory {…}

    mem_ind ¶

    mem_ind :: proc "contextless" (addr: u16) -> Memory {…}

    mem_ind_abs_x ¶

    mem_ind_abs_x :: proc "contextless" (addr: u16) -> Memory {…}

    mem_ind_x ¶

    mem_ind_x :: proc "contextless" (addr: u8) -> Memory {…}

    mem_ind_y ¶

    mem_ind_y :: proc "contextless" (addr: u8) -> Memory {…}

    mem_ind_zp ¶

    mem_ind_zp :: proc "contextless" (addr: u8) -> Memory {…}

    mem_zp ¶

    mem_zp :: proc "contextless" (addr: u8) -> Memory {…}

    mem_zp_x ¶

    mem_zp_x :: proc "contextless" (addr: u8) -> Memory {…}

    mem_zp_y ¶

    mem_zp_y :: proc "contextless" (addr: u8) -> Memory {…}

    mnemonic_to_string ¶

    mnemonic_to_string :: proc(m: Mnemonic, lowercase: bool = true, allocator := context.temp_allocator) -> string {…}

    op_abs ¶

    op_abs :: proc "contextless" (a: u16) -> Operand {…}

    op_abs_x ¶

    op_abs_x :: proc "contextless" (a: u16) -> Operand {…}

    op_abs_y ¶

    op_abs_y :: proc "contextless" (a: u16) -> Operand {…}

    op_imm16 ¶

    op_imm16 :: proc "contextless" (v: i64) -> Operand {…}

    op_imm8 ¶

    op_imm8 :: proc "contextless" (v: i64) -> Operand {…}

    op_ind ¶

    op_ind :: proc "contextless" (a: u16) -> Operand {…}

    op_ind_abs_x ¶

    op_ind_abs_x :: proc "contextless" (a: u16) -> Operand {…}

    op_ind_x ¶

    op_ind_x :: proc "contextless" (a: u8) -> Operand {…}

    op_ind_y ¶

    op_ind_y :: proc "contextless" (a: u8) -> Operand {…}

    op_ind_zp ¶

    op_ind_zp :: proc "contextless" (a: u8) -> Operand {…}

    op_label ¶

    op_label :: proc "contextless" (label_id: u32, size: u8 = 1) -> Operand {…}

    op_mem ¶

    op_mem :: proc "contextless" (m: Memory) -> Operand {…}

    op_reg ¶

    op_reg :: proc "contextless" (r: Register) -> Operand {…}

    op_rel_offset ¶

    op_rel_offset :: proc "contextless" (offset: i64) -> Operand {…}

    op_zp ¶

    op_zp :: proc "contextless" (a: u8) -> Operand {…}
     

    Address-mode-named operand helpers (call site reads like asm).

    op_zp_x ¶

    op_zp_x :: proc "contextless" (a: u8) -> Operand {…}

    op_zp_y ¶

    op_zp_y :: proc "contextless" (a: u8) -> Operand {…}

    print ¶

    print :: 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[u32]string = nil, 
    ) {…}

    println ¶

    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[u32]string = nil, 
    ) {…}

    reg_class ¶

    reg_class :: proc "contextless" (r: Register) -> u16 {…}

    reg_hw ¶

    reg_hw :: proc "contextless" (r: Register) -> u8 {…}

    reg_is_gp ¶

    reg_is_gp :: proc "contextless" (r: Register) -> bool {…}

    sbprint ¶

    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[u32]string = nil, 
    ) {…}

    sbprintln ¶

    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[u32]string = nil, 
    ) {…}

    tprint ¶

    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[u32]string = nil, 
    ) -> string {…}

    tprintln ¶

    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[u32]string = nil, 
    ) -> string {…}

    wprint ¶

    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[u32]string = nil, 
    ) {…}

    wprintln ¶

    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[u32]string = nil, 
    ) {…}

    Procedure Groups

    emit_asl ¶

    emit_asl :: proc{
    	emit_asl_a,
    	emit_asl_m,
    }
    

    emit_dec ¶

    emit_dec :: proc{
    	emit_dec_m,
    	emit_dec_a,
    }
    

    emit_inc ¶

    emit_inc :: proc{
    	emit_inc_m,
    	emit_inc_a,
    }
    

    emit_lsr ¶

    emit_lsr :: proc{
    	emit_lsr_a,
    	emit_lsr_m,
    }
    

    emit_rol ¶

    emit_rol :: proc{
    	emit_rol_a,
    	emit_rol_m,
    }
    

    emit_ror ¶

    emit_ror :: proc{
    	emit_ror_a,
    	emit_ror_m,
    }
    

    inst_asl ¶

    inst_asl :: proc{
    	inst_asl_a,
    	inst_asl_m,
    }
    

    inst_dec ¶

    inst_dec :: proc{
    	inst_dec_m,
    	inst_dec_a,
    }
    

    inst_inc ¶

    inst_inc :: proc{
    	inst_inc_m,
    	inst_inc_a,
    }
    

    inst_lsr ¶

    inst_lsr :: proc{
    	inst_lsr_a,
    	inst_lsr_m,
    }
    

    inst_rol ¶

    inst_rol :: proc{
    	inst_rol_a,
    	inst_rol_m,
    }
    

    inst_ror ¶

    inst_ror :: proc{
    	inst_ror_a,
    	inst_ror_m,
    }
    

    Source Files

    Generation Information

    Generated with odin version dev-2026-07 (vendor "odin") Windows_amd64 @ 2026-07-20 21:55:33.468775900 +0000 UTC