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 Assember Ported by
25 * John L. Hartman (JLH)
26 * jhartman at compuserve dot com
27 * noice at noicedebugger dot com
31 /* Contains common functionality for the pdk architecture. */
80 #define S_SWAPC 93 /* not on pdk13 */
84 #define S_NADD 97 /* not on pdk13 */
85 #define S_COMP 98 /* not on pdk13 */
87 #define S_DELAY 100 /* not on pdk15 */
88 #define S_PMODE 101 /* not on pdk15 */
89 #define S_POPWPC 102 /* not on pdk15 */
90 #define S_PUSHWPC 103 /* not on pdk15 */
91 #define S_PUSHW 104 /* not on pdk15 */
92 #define S_POPW 105 /* not on pdk15 */
93 #define S_IGOTO 106 /* not on pdk15 */
94 #define S_ICALL 107 /* not on pdk15 */
95 #define S_LDTABL 108 /* not on pdk14 */
96 #define S_LDTABH 109 /* not on pdk14 */
97 #define S_TOG 110 /* not on pdk15 */
98 #define S_WAIT0 111 /* not on pdk15 */
99 #define S_WAIT1 112 /* not on pdk15 */
100 #define S_NMOV 113 /* not on pdk15 */
110 #define PDK_OPCODE_ADR_IO 0x80000000
111 #define PDK_OPCODE_MASK 0xFFFFFF
114 a_uint op
; /* opcode of instruction */
115 a_uint mask
; /* mask of parameter for instruction */
120 /* Codegen functions to emit instructions. */
121 extern VOID
emov(a_uint op
,
127 extern VOID
eidxm(struct inst am
, struct inst ma
);
128 extern VOID
earith(struct inst def
, struct inst ma
, struct inst am
);
129 extern VOID
earithc(struct inst ma
, struct inst am
, struct inst m
, struct inst a
);
130 extern VOID
eshift(struct inst a
, struct inst m
);
131 extern VOID
ebit(a_uint op
, struct inst def
, struct inst ma
, struct inst am
, struct inst
*ioa
);
132 extern VOID
enot(struct inst def
, struct inst m
);
133 extern VOID
ebitn(a_uint op
, struct inst io
, struct inst m
, int offset
);
134 extern VOID
eskip(struct inst def
, struct inst m
);
135 extern VOID
ezsn(struct inst def
, struct inst m
);
136 extern VOID
eret(struct inst def
, struct inst k
);
137 extern VOID
eone(struct inst m
);
138 extern VOID
exch(struct inst m
);
139 extern VOID
epupo(struct inst def
);
140 extern VOID
eopta(struct inst def
);
141 extern VOID
eswapc(a_uint op
, struct inst iok
, int offset
);
142 extern VOID
espec(struct inst am
, struct inst ma
);
144 extern int addr(struct expr
*esp
, bool ioAdr
);
145 extern int pdkbit(struct expr
*esp
);
147 /* Addressing parsing */
151 /* Codegen functions to emit instructions. */
154 extern VOID
earith();
155 extern VOID
earithc();
156 extern VOID
eshift();
167 extern VOID
eswapc();