2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 #define RCSID5 "$Id: mach5.c,v 3.6 1994/06/24 12:56:31 ceriel Exp $"
8 * Motorola 6809 special routines
15 register int sm, dist;
18 dist = exp.val - (DOTVAL + 2);
19 if (pass == PASS_2 && dist > 0 && !(exp.typ & S_DOT))
22 if ((exp.typ & ~S_DOT) != DOTTYP)
24 if (opc == 0x8D || opc == 0x20)
28 if ((sm = small(sm,saving)) == 0) {
30 if (opc == 0x8D) /* bsr */
32 else if (opc == 0x20) /* bra */
42 if (rflag != 0 && PASS_RELO)
43 newrelo(exp.typ, RELPC|RELO2|RELBR);
50 regno(r) register r; {
67 register int reg, ind;
73 dist = exp.val - (DOTVAL + 2);
74 if (pass == PASS_2 && dist > 0 && !(exp.typ & S_DOT))
77 if ((exp.typ & S_TYP) != DOTTYP)
87 } else if ((reg = regno(reg)) < 0)
88 serror("register error");
89 else if ((exp.typ & S_TYP) == S_ABS && exp.val == 0)
90 emit1(0x84 + reg + ind); /* XOP 0, REG == XOP , REG */
91 else if (ind == 0 && (exp.typ & S_TYP) == S_ABS &&
92 -16 <= exp.val && exp.val <= 15
94 emit1(reg + ind + (exp.val & 037));
95 else if ((exp.typ&S_TYP)==S_ABS && -128<=exp.val && exp.val<=127) {
96 emit1(0x88 + reg + ind);
99 emit1(0x89 + reg + ind);
101 if (rflag != 0 && PASS_RELO)
102 newrelo(exp.typ, RELO2|RELBR);