Debian Codegraph @

ACME_Lib/65816/std.a

raw
1 ;ACME 0.96.4
2
3 !ifdef lib_65816_std_a !eof
4 lib_65816_std_a = 2
5
6 ; Labels and macros for Western Digital's 65c816 processor
7
8 !address {
9 cpu_e_cop = $fff4
10 cpu_e_abort = $fff8
11 cpu_e_nmi = $fffa
12 cpu_e_reset = $fffc
13 cpu_e_irq = $fffe
14
15 cpu_n_cop = $ffe4
16 cpu_n_brk = $ffe6
17 cpu_n_abort = $ffe8
18 cpu_n_nmi = $ffea
19 ; no reset vector for native mode because reset always enters emulation mode
20 cpu_n_irq = $ffee
21 }
22
23 !macro cpu_emu {; switch to emulation mode
24 sec
25 xce
26 }
27
28 !macro cpu_native {; switch to native mode
29 clc
30 xce
31 }
32
33 !macro a8 {; switch A to 8 bit
34 sep #%..#.....
35 !as
36 }
37
38 !macro a16 {; switch A to 16 bit
39 rep #%..#.....
40 !al
41 }
42
43 !macro i8 {; switch X/Y to 8 bit
44 sep #%...#....
45 !rs
46 }
47
48 !macro i16 {; switch X/Y to 16 bit
49 rep #%...#....
50 !rl
51 }
52
53 !macro ai8 {; switch A/X/Y to 8 bit
54 sep #%..##....
55 !as
56 !rs
57 }
58
59 !macro ai16 {; switch A/X/Y to 16 bit
60 rep #%..##....
61 !al
62 !rl
63 }
64
65 !macro a8i16 {; switch A to 8, X/Y to 16 bit
66 +a8
67 +i16
68 }
69
70 !macro a16i8 {; switch A to 16, X/Y to 8 bit
71 +a16
72 +i8
73 }
74
75 !macro inc24 @t {; increase 24-bit counter
76 inc @t
77 bne +
78 inc @t + 1
79 bne +
80 inc @t + 2
81 +
82 }