acme/ACME_Lib/65816/std.a

82 lines
1.0 KiB
Plaintext
Raw Normal View History

;ACME 0.95
!ifdef lib_65816_std_a !eof
lib_65816_std_a = 1
; Labels and macros for Western Digital's 65c816 processor
!address {
cpu_e_cop = $fff4
cpu_e_abort = $fff8
cpu_e_nmi = $fffa
cpu_e_reset = $fffc
cpu_e_irq = $fffe
cpu_n_cop = $fff4
cpu_n_brk = $fff6
cpu_n_abort = $fff8
cpu_n_nmi = $fffa
cpu_n_irq = $fffe
}
!macro cpu_emu {; switch to emulation mode
sec
xce
}
!macro cpu_native {; switch to native mode
clc
xce
}
!macro a8 {; switch A to 8 bit
sep #%..#.....
!as
}
!macro a16 {; switch A to 16 bit
rep #%..#.....
!al
}
!macro i8 {; switch X/Y to 8 bit
sep #%...#....
!rs
}
!macro i16 {; switch X/Y to 16 bit
rep #%...#....
!rl
}
!macro ai8 {; switch A/X/Y to 8 bit
sep #%..##....
!as
!rs
}
!macro ai16 {; switch A/X/Y to 16 bit
rep #%..##....
!al
!rl
}
!macro a8i16 {; switch A to 8, X/Y to 16 bit
+a8
+i16
}
!macro a16i8 {; switch A to 16, X/Y to 8 bit
+a16
+i8
}
!macro inc24 .t {; increase 24-bit counter
inc .t
bne +
inc .t + 1
bne +
inc .t + 2
+
}