struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / sdas / asf8 / f8.h
blob3e33d91e48493433a44336b91aa3f1bd58b4c239
1 /* f8.h */
3 /*
4 * Copyright (C) 2010 Alan R. Baldwin
5 * Copyright (C) 2022 Philipp K. Krause
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 * Alan R. Baldwin
22 * 721 Berkeley St.
23 * Kent, Ohio 44240
27 /*)BUILD
28 $(PROGRAM) = ASSTM8
29 $(INCLUDE) = {
30 ASXXXX.H
31 ST8.H
33 $(FILES) = {
34 ST8MCH.C
35 ST8ADR.C
36 ST8PST.C
37 ASMAIN.C
38 ASMCRO.C
39 ASDBG.C
40 ASLEX.C
41 ASSYM.C
42 ASSUBR.C
43 ASEXPR.C
44 ASDATA.C
45 ASLIST.C
46 ASOUT.C
48 $(STACK) = 3000
51 // Opcodes
52 #define OPCODE_SWAPOP 0x9c
53 #define OPCODE_ALTACC1 0x9d
54 #define OPCODE_ALTACC2 0x9e
55 #define OPCODE_ALTACC3 0x9f
56 #define OPCODE_ALTACC4 0x94
57 #define OPCODE_ALTACC5 0xd8
60 * Registers
62 #define XL 0
63 #define XH 1
64 #define YL 2
65 #define YH 3
66 #define ZL 4
67 #define ZH 5
68 #define F 7
69 #define SP 8
70 #define X 9
71 #define Y 10
72 #define Z 11
75 * Addressing Modes
77 #define S_IMM 0x00
78 #define S_DIR 0x01
79 #define S_SPREL 0x02
80 #define S_ZREL 0x03
81 #define S_REG 0x04
82 #define S_IX 0x05
83 #define S_YREL 0x06
84 #define S_ISPREL 0x07
86 #define S_SHORT 0x08
87 #define S_LONG 0x09
90 * Instruction types
92 enum insttype {
93 S_2OP = 60,
94 S_2OPSUB,
95 S_1OP,
96 S_1OPPUSH,
97 S_2OPW,
98 S_2OPWSUB,
99 S_2OPWSBC,
100 S_2OPWADD,
101 S_2OPWADC,
102 S_1OPW,
103 S_1OPWPUSH,
104 S_LD,
105 S_LDI,
106 S_LDW,
107 S_0OP,
108 S_0OPXCH,
109 S_0OPMAD,
110 S_0OPROT,
111 S_0OPMSK,
112 S_0OPCAX,
113 S_0OPW,
114 S_0OPWXCH,
115 S_0OPWSLL,
116 S_0OPWRLC,
117 S_0OPWCP,
118 S_0OPWDEC,
119 S_0OPWSEX,
120 S_0OPWCAX,
121 S_BIT,
122 S_JR,
123 S_JR2,
124 S_DNJNZ,
125 S_JP,
126 S_RET,
127 S_NOP,
128 S_TRAP
131 struct adsym
133 char a_str[4]; /* addressing string */
134 int a_val; /* addressing mode value */
137 extern struct adsym REG[];
139 extern int rcode;
141 /* machine dependent functions */
143 /* ST8adr.c */
144 extern int addr(struct expr *esp);
145 extern int addr1(struct expr *esp);
146 extern int addrsl(struct expr *esp);
147 extern int admode(struct adsym *sp);
148 extern int any(int c, char *str);
149 extern int srch(char *str);
151 /* ST8mch.c */
152 extern VOID machine(struct mne *mp);
153 extern int mchpcr(struct expr *esp);
154 extern VOID minit(void);
155 extern VOID opcy_aerr(void);
156 extern VOID valu_aerr(struct expr *e, int n);
157 extern int ls_mode(struct expr *e);
158 extern int d_mode(struct expr *e);
159 extern int setbit(int b);
160 extern int getbit(void);
161 extern void altacc(int reg);
162 extern void altaccw(int reg);
163 extern void altaccw2(int reg0, int reg1);