4 * (C) Copyright 1989-1995
13 * Extensions: P. Felber
22 * Read an address specifier. Pack the
23 * address information into the supplied
24 * `expr' structure. Return the mode of
27 * This addr(esp) routine performs the following addressing decoding:
29 * address mode flag addr base
31 * label s_type ---- s_addr s_area
32 * [REG] S_IND+icode 0 0 NULL
33 * [label] S_INDM ---- s_addr s_area
34 * offset[REG] S_IND+icode ---- offset ----
38 register struct expr *esp;
40 register int c, mode = 0, indx;
42 if ((c = getnb()) == '#') {
44 esp->e_mode = S_IMMED;
47 if ((indx = admode(R8)) != 0) {
50 if ((indx = admode(R16)) != 0) {
53 if ((indx = admode(R8X)) != 0) {
57 if ((indx = admode(R16X)) != 0) {
65 esp->e_mode = (mode + indx)&0xFF;
66 esp->e_base.e_ap = NULL;
68 if ((c = getnb()) != RTIND)
72 if ((indx = admode(R8)) != 0) {
75 if ((indx = admode(R16)) != 0) {
78 if ((indx = admode(R8X)) != 0) {
81 if ((indx = admode(R16X)) != 0) {
88 esp->e_addr = indx&0xFF;
90 esp->e_base.e_ap = NULL;
92 if ((c = getnb()) == LFIND) {
94 if ((indx=admode(R16))!=0
95 && ((indx&0xFF)==IX || (indx&0xFF)==IY)) {
97 if ((indx=admode(R16))!=0) {
99 esp->e_mode = S_INDR + (indx&0xFF);
103 if ((c = getnb()) != RTIND)
109 return (esp->e_mode);
113 * Enter admode() to search a specific addressing mode table
114 * for a match. Return the addressing value on a match or
119 register struct adsym *sp;
129 while ( *(ptr = (char *) &sp[i]) ) {
140 * srch --- does string match ?
150 while (*ptr && *str) {
161 while (*ptr && *str) {
162 if (ccase[(unsigned char)(*ptr)] != ccase[(unsigned char)(*str)])
167 if (ccase[(unsigned char)(*ptr)] == ccase[(unsigned char)(*str)]) {
174 if (any(*ptr," \t\n,);")) {
182 * any --- does str contain c?
198 struct adsym R8[] = {
216 struct adsym R8X[] = {
224 struct adsym R16[] = {
251 struct adsym R16X[] = {
262 * Conditional definitions
265 struct adsym CND[] = {