| 1 |
;ACME 0.97 |
| 2 |
!cpu m65 |
| 3 |
!to "out-m65.o", plain |
| 4 |
*=$1000 |
| 5 |
M65 = 1 ; make next include skip the NOP mnemonic (re-used as prefix code by M65) |
| 6 |
!src "include-6502.a" |
| 7 |
; !src "include-65c02.a" ; not used, because 65ce02 changes "(zp)" to "(zp), z" |
| 8 |
!src "include-bitmanips.a" |
| 9 |
!src "include-65ce02.a" |
| 10 |
; this differs between 65ce02 and 4502: |
| 11 |
map ; $5c |
| 12 |
; this is an alias for NOP: |
| 13 |
eom ; $ea, "end of mapping" |
| 14 |
|
| 15 |
; "quad mode" m65 extension using NEG:NEG prefix: |
| 16 |
; (instructions that are commented out might be re-purposed later) |
| 17 |
;orq ($01, x) ; 01 |
| 18 |
orq $05 ; 05 |
| 19 |
aslq $05 ; 06 |
| 20 |
aslq ; 0a |
| 21 |
orq $0d0e ; 0d |
| 22 |
aslq $0d0e ; 0e |
| 23 |
;orq ($11), y ; 11 |
| 24 |
orq ($12) ; 12 |
| 25 |
;orq $15, x ; 15 |
| 26 |
aslq $15, x ; 16 |
| 27 |
;orq $1919, y ; 19 |
| 28 |
inq ; 1a |
| 29 |
;orq $1d1e, x ; 1d |
| 30 |
aslq $1d1e, x ; 1e |
| 31 |
;andq ($01, x) ; 21 |
| 32 |
bitq $05 ; 24 |
| 33 |
andq $05 ; 25 |
| 34 |
rolq $05 ; 26 |
| 35 |
rolq ; 2a |
| 36 |
bitq $0d0e ; 2c |
| 37 |
andq $0d0e ; 2d |
| 38 |
rolq $0d0e ; 2e |
| 39 |
;andq ($11), y ; 31 |
| 40 |
andq ($12) ; 32 |
| 41 |
;bitq $15, x ; 34 |
| 42 |
;andq $15, x ; 35 |
| 43 |
rolq $15, x ; 36 |
| 44 |
;andq $1919, y ; 39 |
| 45 |
deq ; 3a |
| 46 |
;bitq $1d1e, x ; 3c |
| 47 |
;andq $1d1e, x ; 3d |
| 48 |
rolq $1d1e, x ; 3e |
| 49 |
;eorq ($01, x) ; 41 |
| 50 |
asrq ; 43 |
| 51 |
asrq $05 ; 44 |
| 52 |
eorq $05 ; 45 |
| 53 |
lsrq $05 ; 46 |
| 54 |
lsrq ; 4a |
| 55 |
eorq $0d0e ; 4d |
| 56 |
lsrq $0d0e ; 4e |
| 57 |
;eorq ($11), y ; 51 |
| 58 |
eorq ($12) ; 52 |
| 59 |
asrq $15, x ; 54 |
| 60 |
;eorq $15, x ; 55 |
| 61 |
lsrq $15, x ; 56 |
| 62 |
;eorq $1919, y ; 59 |
| 63 |
;eorq $1d1e, x ; 5d |
| 64 |
lsrq $1d1e, x ; 5e |
| 65 |
;adcq ($01, x) ; 61 |
| 66 |
adcq $05 ; 65 |
| 67 |
rorq $05 ; 66 |
| 68 |
rorq ; 6a |
| 69 |
adcq $0d0e ; 6d |
| 70 |
rorq $0d0e ; 6e |
| 71 |
;adcq ($11), y ; 71 |
| 72 |
adcq ($12) ; 72 |
| 73 |
;adcq $15, x ; 75 |
| 74 |
rorq $15, x ; 76 |
| 75 |
;adcq $1919, y ; 79 |
| 76 |
;adcq $1d1e, x ; 7d |
| 77 |
rorq $1d1e, x ; 7e |
| 78 |
;stq ($01, x) ; 81 |
| 79 |
;stq ($82, s), y ; 82 |
| 80 |
stq $05 ; 85 |
| 81 |
stq $0d0e ; 8d |
| 82 |
;stq ($11), y ; 91 |
| 83 |
stq ($12) ; 92 |
| 84 |
;stq $15, x ; 95 |
| 85 |
;stq $1919, y ; 99 |
| 86 |
;stq $1d1e, x ; 9d |
| 87 |
;ldq ($01, x) ; a1 |
| 88 |
ldq $05 ; a5 |
| 89 |
ldq $0d0e ; ad |
| 90 |
;ldq ($11), y ; b1 |
| 91 |
ldq ($12), z ; b2 |
| 92 |
;ldq $15, x ; b5 |
| 93 |
;ldq $1919, y ; b9 |
| 94 |
;ldq $1d1e, x ; bd |
| 95 |
;cpq ($01, x) ; c1 |
| 96 |
cpq $05 ; c5 |
| 97 |
deq $05 ; c6 |
| 98 |
cpq $0d0e ; cd |
| 99 |
deq $0d0e ; ce |
| 100 |
;cpq ($11), y ; d1 |
| 101 |
cpq ($12) ; d2 |
| 102 |
;cpq $15, x ; d5 |
| 103 |
deq $15, x ; d6 |
| 104 |
;cpq $1919, y ; d9 |
| 105 |
;cpq $1d1e, x ; dd |
| 106 |
deq $1d1e, x ; de |
| 107 |
;sbcq ($01, x) ; e1 |
| 108 |
;ldq ($e2, s), y ; e2 |
| 109 |
sbcq $05 ; e5 |
| 110 |
inq $05 ; e6 |
| 111 |
sbcq $0d0e ; ed |
| 112 |
inq $0d0e ; ee |
| 113 |
;sbcq ($11), y ; f1 |
| 114 |
sbcq ($12) ; f2 |
| 115 |
;sbcq $15, x ; f5 |
| 116 |
inq $15, x ; f6 |
| 117 |
;sbcq $1919, y ; f9 |
| 118 |
;sbcq $1d1e, x ; fd |
| 119 |
inq $1d1e, x ; fe |
| 120 |
; "long mode" m65 extension using NOP prefix: |
| 121 |
ora [$12], z ; 12 |
| 122 |
and [$12], z ; 32 |
| 123 |
eor [$12], z ; 52 |
| 124 |
adc [$12], z ; 72 |
| 125 |
sta [$12], z ; 92 |
| 126 |
lda [$12], z ; b2 |
| 127 |
cmp [$12], z ; d2 |
| 128 |
sbc [$12], z ; f2 |
| 129 |
; "quad mode" and "long mode" combined using NEG:NEG:NOP prefix: |
| 130 |
orq [$12] ; 12 |
| 131 |
andq [$12] ; 32 |
| 132 |
eorq [$12] ; 52 |
| 133 |
adcq [$12] ; 72 |
| 134 |
stq [$12] ; 92 |
| 135 |
ldq [$12], z ; b2 |
| 136 |
cpq [$12] ; d2 |
| 137 |
sbcq [$12] ; f2 |