1 #define RCSID4 "$Id: mach4.c,v 3.5 1994/06/24 12:56:27 ceriel Exp $"
4 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
5 * See the copyright notice in the ACK home directory, in the file "Copyright".
10 * Motorola 6809 parsing rules
24 { emit1(0x10); emit1($1);
27 if (rflag != 0 && PASS_RELO)
28 newrelo($2.typ, RELPC|RELO2|RELBR);
37 if (rflag != 0 && PASS_RELO)
38 newrelo($2.typ, RELPC|RELO2|RELBR);
46 if (rflag != 0 && PASS_RELO)
47 newrelo($3.typ, RELO1);
53 { emit1or2($1 - 0x20);
59 if (rflag != 0 && PASS_RELO)
60 newrelo($3.typ, RELO2|RELBR);
66 if (rflag != 0 && PASS_RELO)
67 newrelo($3.typ, RELO1);
75 { if (0 <= $1 && $1 < 0x80)
76 emit1(($1-0x10) & 0x3F);
80 if (rflag != 0 && PASS_RELO)
81 newrelo($3.typ, RELO1);
87 { emit1or2($1 + 0x10);
89 if (rflag != 0 && PASS_RELO)
90 newrelo($3.typ, RELO2|RELBR);
96 { emit1($1); emit1($2);}
106 case A: emit1($1 - 0x20);
108 case B: emit1($1 - 0x10);
110 default:serror("register error");
119 XOP '(' expr ',' REG ')'
128 if (rflag != 0 && PASS_RELO)
129 newrelo($3.typ, RELO2|RELBR);
140 { if (($3 & 0x8D) == 0x80)
141 serror("invalid index mode");
147 { if (($2.typ & S_TYP) == S_ABS &&
148 ((unsigned)$2.val >> 8) == dpvalue
150 if (0 <= $1 && $1 < 0x80)
151 emit1(($1-0x20) & 0x3F);
158 if (rflag != 0 && PASS_RELO)
159 newrelo($2.typ, RELO2|RELBR);
167 { if (($$ = regbit[$1]) < 0) serror("register error");}
171 if ((i = regbit[$3]) < 0 || ($1 & i) != 0)
172 serror("register error");
177 { if (($$ = regno($1)) < 0) serror("register error");}
179 xmode : ',' xyus '+' '+'
196 case A: $$ = 0x86 + $3; break;
197 case B: $$ = 0x85 + $3; break;
198 case D: $$ = 0x8B + $3; break;
199 default: serror("register error");