Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / sdas / aspdk / pdk.h
blobb07de2ac34ce2bbad920b3ae225acc6979b2527b
1 /* pdk.h */
3 /*
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/>.
20 * Alan R. Baldwin
21 * 721 Berkeley St.
22 * Kent, Ohio 44240
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. */
33 #include <stdbool.h>
35 * Instructions.
37 #define S_MOV 50
38 #define S_LDT16 51
39 #define S_STT16 52
40 #define S_IDXM 53
41 #define S_XCH 54
42 #define S_PUSHAF 55
43 #define S_POPAF 56
44 #define S_ADD 57
45 #define S_ADDC 58
46 #define S_SUB 59
47 #define S_SUBC 60
48 #define S_INC 61
49 #define S_DEC 62
50 #define S_CLEAR 63
51 #define S_SR 64
52 #define S_SRC 65
53 #define S_SL 66
54 #define S_SLC 67
55 #define S_SWAP 68
56 #define S_AND 69
57 #define S_OR 70
58 #define S_XOR 71
59 #define S_NOT 72
60 #define S_NEG 73
61 #define S_SET0 74
62 #define S_SET1 75
63 #define S_CEQSN 76
64 #define S_T0SN 77
65 #define S_T1SN 78
66 #define S_IZSN 79
67 #define S_DZSN 80
68 #define S_CALL 81
69 #define S_GOTO 82
70 #define S_RET 83
71 #define S_RETI 84
72 #define S_NOP 85
73 #define S_PCADD 86
74 #define S_ENGINT 87
75 #define S_DISGINT 88
76 #define S_STOPSYS 89
77 #define S_STOPEXE 90
78 #define S_RESET 91
79 #define S_WDRESET 92
80 #define S_SWAPC 93 /* not on pdk13 */
81 #define S_CNEQSN 94
82 #define S_LDSPTL 95
83 #define S_LDSPTH 96
84 #define S_NADD 97 /* not on pdk13 */
85 #define S_COMP 98 /* not on pdk13 */
86 #define S_MUL 99
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 */
103 * Addressing modes.
105 #define S_K 31
106 #define S_A 32
107 #define S_M 33
108 #define S_IO 34
110 #define PDK_OPCODE_ADR_IO 0x80000000
111 #define PDK_OPCODE_MASK 0xFFFFFF
113 struct inst {
114 a_uint op; /* opcode of instruction */
115 a_uint mask; /* mask of parameter for instruction */
118 #ifdef OTHERSYSTEM
120 /* Codegen functions to emit instructions. */
121 extern VOID emov(a_uint op,
122 struct inst def,
123 struct inst ioa,
124 struct inst aio,
125 struct inst ma,
126 struct inst am);
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 */
149 #else
151 /* Codegen functions to emit instructions. */
152 extern VOID emov();
153 extern VOID eidxm();
154 extern VOID earith();
155 extern VOID earithc();
156 extern VOID eshift();
157 extern VOID ebit();
158 extern VOID enot();
159 extern VOID ebitn();
160 extern VOID eskip();
161 extern VOID ezsn();
162 extern VOID eret();
163 extern VOID eone();
164 extern VOID exch();
165 extern VOID epupo();
166 extern VOID eopta();
167 extern VOID eswapc();
168 extern VOID espec();
170 extern int addr();
171 extern int pdkbit();
173 #endif