4 * Copyright (C) 1998-2009 Alan R. Baldwin
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * This Assembler Ported by
25 * John L. Hartman (JLH)
26 * jhartman at compuserve dot com
27 * noice at noicedebugger dot com
44 { NULL
, "CON", S_ATYP
, 0, A_CON
},
45 { NULL
, "OVR", S_ATYP
, 0, A_OVR
},
46 { NULL
, "REL", S_ATYP
, 0, A_REL
},
47 { NULL
, "ABS", S_ATYP
, 0, A_ABS
},
48 { NULL
, "NOPAG", S_ATYP
, 0, A_NOPAG
},
49 { NULL
, "PAG", S_ATYP
, 0, A_PAG
},
51 { NULL
, "CODE", S_ATYP
, 0, A_CODE
},
52 { NULL
, "DATA", S_ATYP
, 0, A_DATA
},
53 { NULL
, "XDATA", S_ATYP
, 0, A_XDATA
},
54 { NULL
, "BIT", S_ATYP
, 0, A_BIT
},
56 { NULL
, ".page", S_PAGE
, 0, 0 },
57 { NULL
, ".title", S_HEADER
, 0, O_TITLE
},
58 { NULL
, ".sbttl", S_HEADER
, 0, O_SBTTL
},
59 { NULL
, ".module", S_MODUL
, 0, 0 },
60 { NULL
, ".include", S_INCL
, 0, I_CODE
},
61 { NULL
, ".incbin", S_INCL
, 0, I_BNRY
},
62 { NULL
, ".area", S_AREA
, 0, 0 },
63 { NULL
, ".org", S_ORG
, 0, 0 },
64 { NULL
, ".radix", S_RADIX
, 0, 0 },
65 { NULL
, ".globl", S_GLOBL
, 0, 0 },
66 { NULL
, ".local", S_LOCAL
, 0, 0 },
67 { NULL
, ".if", S_CONDITIONAL
, 0, O_IF
},
68 { NULL
, ".iff", S_CONDITIONAL
, 0, O_IFF
},
69 { NULL
, ".ift", S_CONDITIONAL
, 0, O_IFT
},
70 { NULL
, ".iftf", S_CONDITIONAL
, 0, O_IFTF
},
71 { NULL
, ".ifdef", S_CONDITIONAL
, 0, O_IFDEF
},
72 { NULL
, ".ifndef", S_CONDITIONAL
, 0, O_IFNDEF
},
73 { NULL
, ".ifgt", S_CONDITIONAL
, 0, O_IFGT
},
74 { NULL
, ".iflt", S_CONDITIONAL
, 0, O_IFLT
},
75 { NULL
, ".ifge", S_CONDITIONAL
, 0, O_IFGE
},
76 { NULL
, ".ifle", S_CONDITIONAL
, 0, O_IFLE
},
77 { NULL
, ".ifeq", S_CONDITIONAL
, 0, O_IFEQ
},
78 { NULL
, ".ifne", S_CONDITIONAL
, 0, O_IFNE
},
79 { NULL
, ".ifb", S_CONDITIONAL
, 0, O_IFB
},
80 { NULL
, ".ifnb", S_CONDITIONAL
, 0, O_IFNB
},
81 { NULL
, ".ifidn", S_CONDITIONAL
, 0, O_IFIDN
},
82 { NULL
, ".ifdif", S_CONDITIONAL
, 0, O_IFDIF
},
83 { NULL
, ".iif", S_CONDITIONAL
, 0, O_IIF
},
84 { NULL
, ".iiff", S_CONDITIONAL
, 0, O_IIFF
},
85 { NULL
, ".iift", S_CONDITIONAL
, 0, O_IIFT
},
86 { NULL
, ".iiftf", S_CONDITIONAL
, 0, O_IIFTF
},
87 { NULL
, ".iifdef", S_CONDITIONAL
, 0, O_IIFDEF
},
88 { NULL
, ".iifndef", S_CONDITIONAL
, 0, O_IIFNDEF
},
89 { NULL
, ".iifgt", S_CONDITIONAL
, 0, O_IIFGT
},
90 { NULL
, ".iiflt", S_CONDITIONAL
, 0, O_IIFLT
},
91 { NULL
, ".iifge", S_CONDITIONAL
, 0, O_IIFGE
},
92 { NULL
, ".iifle", S_CONDITIONAL
, 0, O_IIFLE
},
93 { NULL
, ".iifeq", S_CONDITIONAL
, 0, O_IIFEQ
},
94 { NULL
, ".iifne", S_CONDITIONAL
, 0, O_IIFNE
},
95 { NULL
, ".iifb", S_CONDITIONAL
, 0, O_IIFB
},
96 { NULL
, ".iifnb", S_CONDITIONAL
, 0, O_IIFNB
},
97 { NULL
, ".iifidn", S_CONDITIONAL
, 0, O_IIFIDN
},
98 { NULL
, ".iifdif", S_CONDITIONAL
, 0, O_IIFDIF
},
99 { NULL
, ".else", S_CONDITIONAL
, 0, O_ELSE
},
100 { NULL
, ".endif", S_CONDITIONAL
, 0, O_ENDIF
},
101 { NULL
, ".list", S_LISTING
, 0, O_LIST
},
102 { NULL
, ".nlist", S_LISTING
, 0, O_NLIST
},
103 { NULL
, ".equ", S_EQU
, 0, O_EQU
},
104 { NULL
, ".gblequ", S_EQU
, 0, O_GBLEQU
},
105 { NULL
, ".lclequ", S_EQU
, 0, O_LCLEQU
},
107 { NULL
, ".optsdcc", S_OPTSDCC
, 0, 0 },
108 /* end sdas specific */
109 { NULL
, ".byte", S_DATA
, 0, O_1BYTE
},
110 { NULL
, ".db", S_DATA
, 0, O_1BYTE
},
111 { NULL
, ".fcb", S_DATA
, 0, O_1BYTE
},
112 { NULL
, ".word", S_DATA
, 0, O_2BYTE
},
113 { NULL
, ".dw", S_DATA
, 0, O_2BYTE
},
114 { NULL
, ".fdb", S_DATA
, 0, O_2BYTE
},
115 /* { NULL, ".3byte", S_DATA, 0, O_3BYTE }, */
116 /* { NULL, ".triple", S_DATA, 0, O_3BYTE }, */
117 /* { NULL, ".4byte", S_DATA, 0, O_4BYTE }, */
118 /* { NULL, ".quad", S_DATA, 0, O_4BYTE }, */
119 { NULL
, ".blkb", S_BLK
, 0, O_1BYTE
},
120 { NULL
, ".ds", S_BLK
, 0, O_1BYTE
},
121 { NULL
, ".rmb", S_BLK
, 0, O_1BYTE
},
122 { NULL
, ".rs", S_BLK
, 0, O_1BYTE
},
123 { NULL
, ".blkw", S_BLK
, 0, O_2BYTE
},
124 /* { NULL, ".blk3", S_BLK, 0, O_3BYTE }, */
125 /* { NULL, ".blk4", S_BLK, 0, O_4BYTE }, */
126 { NULL
, ".ascii", S_ASCIX
, 0, O_ASCII
},
127 { NULL
, ".ascis", S_ASCIX
, 0, O_ASCIS
},
128 { NULL
, ".asciz", S_ASCIX
, 0, O_ASCIZ
},
129 { NULL
, ".str", S_ASCIX
, 0, O_ASCII
},
130 { NULL
, ".strs", S_ASCIX
, 0, O_ASCIS
},
131 { NULL
, ".strz", S_ASCIX
, 0, O_ASCIZ
},
132 { NULL
, ".fcc", S_ASCIX
, 0, O_ASCII
},
133 { NULL
, ".define", S_DEFINE
, 0, O_DEF
},
134 { NULL
, ".undefine", S_DEFINE
, 0, O_UNDEF
},
135 { NULL
, ".even", S_BOUNDARY
, 0, O_EVEN
},
136 { NULL
, ".odd", S_BOUNDARY
, 0, O_ODD
},
137 { NULL
, ".bndry", S_BOUNDARY
, 0, O_BNDRY
},
138 { NULL
, ".msg" , S_MSG
, 0, 0 },
139 { NULL
, ".assume", S_ERROR
, 0, O_ASSUME
},
140 { NULL
, ".error", S_ERROR
, 0, O_ERROR
},
142 /* Macro Processor */
144 { NULL
, ".macro", S_MACRO
, 0, O_MACRO
},
145 { NULL
, ".endm", S_MACRO
, 0, O_ENDM
},
146 { NULL
, ".mexit", S_MACRO
, 0, O_MEXIT
},
148 { NULL
, ".narg", S_MACRO
, 0, O_NARG
},
149 { NULL
, ".nchr", S_MACRO
, 0, O_NCHR
},
150 { NULL
, ".ntyp", S_MACRO
, 0, O_NTYP
},
152 { NULL
, ".irp", S_MACRO
, 0, O_IRP
},
153 { NULL
, ".irpc", S_MACRO
, 0, O_IRPC
},
154 { NULL
, ".rept", S_MACRO
, 0, O_REPT
},
156 { NULL
, ".nval", S_MACRO
, 0, O_NVAL
},
158 { NULL
, ".mdelete", S_MACRO
, 0, O_MDEL
},
162 { NULL
, "a", S_A
, 0, 0xFF },
164 { NULL
, "nop", S_NOP
, 0, 0x0000 },
165 { NULL
, "ret", S_RET
, 0, 0x007A },
166 { NULL
, "reti", S_RETI
, 0, 0x007B },
167 { NULL
, "mov", S_MOV
, 0, 0x2F00 },
168 { NULL
, "mov.io", S_MOV
, 0, 0x2F00 | PDK_OPCODE_ADR_IO
},
169 { NULL
, "ldt16", S_LDT16
, 0, 0x0301 },
170 { NULL
, "stt16", S_STT16
, 0, 0x0300 },
171 { NULL
, "idxm", S_IDXM
, 0, 0x0380 },
172 { NULL
, "xch", S_XCH
, 0, 0x1380 },
173 { NULL
, "pushaf", S_PUSHAF
, 0, 0x0072 },
174 { NULL
, "popaf", S_POPAF
, 0, 0x0073 },
175 { NULL
, "push", S_PUSHAF
, 0, 0x2072 },
176 { NULL
, "pop", S_POPAF
, 0, 0x2073 },
177 { NULL
, "add", S_ADD
, 0, 0x2800 },
178 { NULL
, "addc", S_ADDC
, 0, 0x0060 },
179 { NULL
, "sub", S_SUB
, 0, 0x2900 },
180 { NULL
, "subc", S_SUBC
, 0, 0x0061 },
181 { NULL
, "inc", S_INC
, 0, 0x1200 },
182 { NULL
, "dec", S_DEC
, 0, 0x1280 },
183 { NULL
, "clear", S_CLEAR
, 0, 0x1300 },
184 { NULL
, "sr", S_SR
, 0, 0x006A },
185 { NULL
, "src", S_SRC
, 0, 0x006C },
186 { NULL
, "sl", S_SL
, 0, 0x006B },
187 { NULL
, "slc", S_SLC
, 0, 0x006D },
188 { NULL
, "swap", S_SWAP
, 0, 0x006E },
189 { NULL
, "and", S_AND
, 0, 0x2C00 },
190 { NULL
, "or", S_OR
, 0, 0x2D00 },
191 { NULL
, "xor", S_XOR
, 0, 0x2E00 },
192 { NULL
, "xor.io", S_XOR
, 0, 0x2E00 | PDK_OPCODE_ADR_IO
},
193 { NULL
, "not", S_NOT
, 0, 0x0068 },
194 { NULL
, "neg", S_NEG
, 0, 0x0069 },
195 { NULL
, "set0", S_SET0
, 0, 0x0000 },
196 { NULL
, "set0.io", S_SET0
, 0, 0x0000 | PDK_OPCODE_ADR_IO
},
197 { NULL
, "set1", S_SET1
, 0, 0x0000 },
198 { NULL
, "set1.io", S_SET1
, 0, 0x0000 | PDK_OPCODE_ADR_IO
},
199 { NULL
, "ceqsn", S_CEQSN
, 0, 0x2A00 },
200 { NULL
, "t0sn", S_T0SN
, 0, 0x0000 },
201 { NULL
, "t0sn.io", S_T0SN
, 0, 0x0000 | PDK_OPCODE_ADR_IO
},
202 { NULL
, "t1sn", S_T1SN
, 0, 0x0001 },
203 { NULL
, "t1sn.io", S_T1SN
, 0, 0x0001 | PDK_OPCODE_ADR_IO
},
204 { NULL
, "izsn", S_IZSN
, 0, 0x0062 },
205 { NULL
, "dzsn", S_DZSN
, 0, 0x0063 },
206 { NULL
, "call", S_CALL
, 0, 0x3800 },
207 { NULL
, "goto", S_GOTO
, 0, 0x3000 },
208 { NULL
, "pcadd", S_PCADD
, 0, 0x0067 },
209 { NULL
, "engint", S_ENGINT
, 0, 0x0078 },
210 { NULL
, "disgint", S_DISGINT
, 0, 0x0079 },
211 { NULL
, "stopsys", S_STOPSYS
, 0, 0x0076 },
212 { NULL
, "stopexe", S_STOPEXE
, 0, 0x0077 },
213 { NULL
, "reset", S_RESET
, 0, 0x0075 },
214 { NULL
, "wdreset", S_WDRESET
, 0, 0x0070 },
215 { NULL
, "swapc.io", S_SWAPC
, 0, 0x0400 | PDK_OPCODE_ADR_IO
},
216 { NULL
, "cneqsn", S_CNEQSN
, 0, 0x2A00 },
217 { NULL
, "comp", S_COMP
, 0, 0x0600 },
218 { NULL
, "nadd", S_NADD
, 0, 0x0700 },
219 { NULL
, "mul", S_MUL
, 0, 0x007C },
220 { NULL
, "ldsptl", S_LDSPTL
, 0, 0x0006 },
221 { NULL
, "ldspth", S_LDSPTH
, S_EOL
, 0x0007 },