mirror of
https://github.com/cc65/cc65.git
synced 2024-12-23 04:30:10 +00:00
b04d79b1da
This PR is mostly a complete rewrite of the emulator for 6502/65c02 opcodes. It provides an easier to maintain implementation of the instructions, by using few macros rather than having hand-written code for each function. All undocumented, previously missing opcodes for 6502 are also implemented. The patch also includes a detailed documentation of those opcodes, for reference to developers. This PR should fix one of the milestones listed here for the next version of CC65: https://github.com/cc65/wiki/wiki/Before-the-next-release
30 lines
841 B
ArmAsm
30 lines
841 B
ArmAsm
;
|
|
; Oliver Schmidt, 2013-05-16
|
|
;
|
|
; This module supplies a header used by sim65.
|
|
;
|
|
|
|
.export __EXEHDR__ : absolute = 1 ; Linker referenced
|
|
.importzp sp
|
|
.import __MAIN_START__
|
|
.import startup
|
|
|
|
.macpack cpu
|
|
|
|
.segment "EXEHDR"
|
|
|
|
.byte $73, $69, $6D, $36, $35 ; 'sim65'
|
|
.byte 2 ; header version
|
|
.if (.cpu .bitand ::CPU_ISET_6502X)
|
|
.byte 2
|
|
.elseif (.cpu .bitand ::CPU_ISET_65C02)
|
|
.byte 1
|
|
.elseif (.cpu .bitand ::CPU_ISET_6502)
|
|
.byte 0
|
|
.else
|
|
.error Unknow CPU type.
|
|
.endif
|
|
.byte sp ; sp address
|
|
.addr __MAIN_START__ ; load address
|
|
.addr startup ; reset address
|