]> git.sur5r.net Git - cc65/blob - test/asm/cpudetect.s
By default, we get the memory reserved for hires mode
[cc65] / test / asm / cpudetect.s
1
2 .macpack cpu
3
4 ; step 1: try to assemble an instruction that's exclusive to this set
5 ;         (when possible)
6
7 .ifp02
8    lda #$ea
9 .endif
10
11 .ifpsc02
12    jmp ($1234,x)
13 .endif
14
15 .ifpc02
16    rmb0 $12
17 .endif
18
19 .ifp816
20    xba
21 .endif
22
23 .ifp4510
24    taz
25 .endif
26
27
28 ; step 2: check for bitwise compatibility of instructions sets
29 ;         (made verbose for better reading with hexdump/hd(1))
30
31 .if (.cpu .bitand CPU_ISET_NONE)
32    .byte 0,"CPU_ISET_NONE"
33 .endif
34
35 .if (.cpu .bitand CPU_ISET_6502)
36    .byte 0,"CPU_ISET_6502"
37 .endif
38
39 .if (.cpu .bitand CPU_ISET_6502X)
40    .byte 0,"CPU_ISET_6502X"
41 .endif
42
43 .if (.cpu .bitand CPU_ISET_65SC02)
44    .byte 0,"CPU_ISET_65SC02"
45 .endif
46
47 .if (.cpu .bitand CPU_ISET_65C02)
48    .byte 0,"CPU_ISET_65C02"
49 .endif
50
51 .if (.cpu .bitand CPU_ISET_65816)
52    .byte 0,"CPU_ISET_65816"
53 .endif
54
55 .if (.cpu .bitand CPU_ISET_SWEET16)
56    .byte 0,"CPU_ISET_SWEET16"
57 .endif
58
59 .if (.cpu .bitand CPU_ISET_HUC6280)
60    .byte 0,"CPU_ISET_HUC6280"
61 .endif
62
63 .if (.cpu .bitand CPU_ISET_4510)
64    .byte 0,"CPU_ISET_4510"
65 .endif
66