Files
player/Project/Src/NES/6502def.s
2025-07-08 19:13:35 +08:00

65 lines
2.2 KiB
ArmAsm
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

m6502_nz .req r3 // bit 31=N, Z=1 if bits 0-7=0 ;RN定义寄存器名
m6502_rmem .req r4 // readmem_tbl
m6502_a .req r5 // bits 0-23=0,
m6502_x .req r6 // bits 0-23=0
m6502_y .req r7 // bits 0-23=0
cycles .req r8 // also VDIC flagsVDIC
m6502_pc .req r9
globalptr .req r10 // =wram_globals* ptr
m6502_optbl .req r10
cpu_zpage .req r11 // =CPU_RAM
addy .req r12 // keep this at r12 ( APCS) //addr :8
// equates.s - GCC/GAS version
// GAS RN使
// globalptr, r10
// cpu_zpage r11
// MAP 0, globalptr
// globalptr
.equ opz, 0 //
.equ readmem_tbl, opz + 4 //
.equ writemem_tbl, readmem_tbl + 32 //
.equ memmap_tbl, writemem_tbl + 32 // ROM/RAM
.equ cpuregs, memmap_tbl + 32 // 6502
.equ m6502_s, cpuregs + 28 // s
.equ lastbank, m6502_s + 4 // ROM bank
.equ nexttimeout, lastbank + 4 //
.equ rombase, nexttimeout + 4 // ROM
.equ romnumber, rombase + 4 // ROM
.equ rommask, romnumber + 4 // ROM romsize-1
.equ joy0data, rommask + 4 // 1
.equ joy1data, joy0data + 4 // 2
.equ clocksh, joy1data + 4 // APU
.equ cpunmif, clocksh + 4 // NMI
.equ cpuirqf, cpunmif + 4 // IRQ
.equ C, 0x01 // 6502 flags 6502
.equ Z, 0x02
.equ I, 0x04
.equ D, 0x08
.equ B, 0x10 // (always 1 except when IRQ pushes it) IRQ
.equ R, 0x20 // (locked at 1)
.equ V, 0x40
.equ N, 0x80
.equ CYC_C, 0x01 // Carry bit
.equ BRANCH, 0x02 // branch instruction encountered
.equ CYC_I, 0x04 // IRQ mask
.equ CYC_D, 0x08 // Decimal bit
.equ CYC_V, 0x40 // Overflow bit
.equ CYC_MASK, 0xFF // CYCLE-1 ;Mask