1 /* $Id: mach1.c,v 1.12 1994/06/24 13:05:40 ceriel Exp $ */
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
7 * Motorola 68020 dependent C declarations
10 #define low3(z) ((short)(z) & 07)
11 #define low4(z) ((short)(z) & 017)
12 #define low5(z) ((short)(z) & 037)
13 #define low6(z) ((short)(z) & 077)
14 #define low7(z) ((short)(z) & 0177)
16 #define fit3(z) ((((z)-1) & ~((int)07)) == 0)
17 #define fit4(z) (((z) & ~((int)017)) == 0)
18 #define fit5(z) (((z) & ~((int)037)) == 0)
19 #define fit6(z) (((z) & ~((int)077)) == 0)
20 #define fit7(z) (((z) & ~((int)0177)) == 0)
21 #define sfit7(z) (fit7((z)+64))
22 #define fit8(z) (((z) & ~((int)0xFF)) == 0)
23 #define fit16(z) (((z) & ~(0xFFFFL)) == 0)
29 #define SIZE_DEF SIZE_W
39 #define DEF_FP 01000 /* default floating point processor */
40 #define DEF_MM 00000 /* default memory management */
41 extern int co_id; /* coprocessor id */
43 extern int mrg_1,mrg_2; /* Mode and ReGister */
44 extern short ffew_1, ffew_2; /* Full Format Extension Word */
45 extern expr_t bd_1,bd_2,od_1,od_2; /* base and outer displacements */
47 extern valu_t bd_rel1,bd_rel2,od_rel1,od_rel2;
52 #define T_EMIT2(a,b,c,d) t_emit2(a,b,c,(valu_t)0)
53 #define T_EMIT4(a,b,c,d) t_emit4(a,b,c,(valu_t)0)
55 #define T_EMIT2(a,b,c,d) t_emit2(a,b,c,(valu_t)d)
56 #define T_EMIT4(a,b,c,d) t_emit4(a,b,c,(valu_t)d)
59 #define T_EMIT2(a,b,c,d) t_emit2(a)
60 #define T_EMIT4(a,b,c,d) t_emit4(a)
64 short i_word; /* word to be emitted */
71 typedef struct instr_t instr_t;
72 extern instr_t instr[30]; /* temporary area for instructions */
73 extern instr_t *instrp; /* index into instr[] */
74 extern int dot_offset;
76 /* flags used when reading effective addresses */
78 #define PRE_INDEX 0100
79 #define POST_INDEX 0200
80 #define DBL_INDEX 0300
83 /* addressing mode bits */
93 extern int curr_instr;
97 extern short eamode[];
102 /* 02A */ DTA|MEM|CTR|ALT,
103 /* 03A */ DTA|MEM |ALT,
104 /* 04A */ DTA|MEM |ALT,
105 /* 05A */ DTA|MEM|CTR|ALT|FITW|PUTW, /* if relocation wanted, use 06A */
106 /* 06A */ DTA|MEM|CTR|ALT |PUTW, /* relocation handled by ea_1() */
108 /* 070 */ DTA|MEM|CTR|ALT|FITW|PUTW | (RELO2)<<8,
109 /* 071 */ DTA|MEM|CTR|ALT |PUTL | (RELO4)<<8,
110 /* 072 */ DTA|MEM|CTR |FITW|PUTW, /* if relocation wanted, use 073 */
111 /* 073 */ DTA|MEM|CTR |PUTW, /* relocation handled by ea_1() */
113 /* 074B */ DTA|MEM |FITB|PUTW | (RELO1)<<8,
114 /* 074W */ DTA|MEM |FITW|PUTW | (RELO2)<<8,
115 /* 074L */ DTA|MEM |PUTL | (RELO4)<<8,
117 /* RELO2 had to go with mode 070, because the assembly
118 * language programmer can use addresses like
119 * '(expression).w', which still have to be relocatable.