comparison lwasm/list.c @ 142:697bc543368c

Implement distinction between . and * for OS9 modules
author lost@l-w.ca
date Fri, 19 Aug 2011 23:55:40 -0600
parents 43a3f1068027
children f8b33b3a45ac
comparison
equal deleted inserted replaced
141:11ebce0183a5 142:697bc543368c
108 { 108 {
109 obytes = lw_alloc(obytelen); 109 obytes = lw_alloc(obytelen);
110 memmove(obytes, cl -> output, cl -> outputl); 110 memmove(obytes, cl -> output, cl -> outputl);
111 } 111 }
112 } 112 }
113 if (cl -> len < 1 && obytelen < 1) 113 if ((cl -> len < 1 && cl -> dlen < 1) && obytelen < 1)
114 { 114 {
115 if (cl -> soff >= 0) 115 if (cl -> soff >= 0)
116 { 116 {
117 fprintf(of, "%04X ", cl -> soff & 0xffff); 117 fprintf(of, "%04Xs ", cl -> soff & 0xffff);
118 } 118 }
119 else if (cl -> dshow >= 0) 119 else if (cl -> dshow >= 0)
120 { 120 {
121 if (cl -> dsize == 1) 121 if (cl -> dsize == 1)
122 { 122 {
151 } 151 }
152 } 152 }
153 else 153 else
154 { 154 {
155 lw_expr_t te; 155 lw_expr_t te;
156 te = lw_expr_copy(cl -> addr); 156 if (instab[cl -> insn].flags & lwasm_insn_setdata)
157 te = lw_expr_copy(cl -> daddr);
158 else
159 te = lw_expr_copy(cl -> addr);
157 as -> exportcheck = 1; 160 as -> exportcheck = 1;
158 as -> csect = cl -> csect; 161 as -> csect = cl -> csect;
159 lwasm_reduce_expr(as, te); 162 lwasm_reduce_expr(as, te);
160 as -> exportcheck = 0; 163 as -> exportcheck = 0;
161 // fprintf(of, "%s\n", lw_expr_print(te)); 164 // fprintf(of, "%s\n", lw_expr_print(te));
162 fprintf(of, "%04X ", lw_expr_intval(te) & 0xffff); 165 fprintf(of, "%04X%c", lw_expr_intval(te) & 0xffff, ((cl -> inmod || (cl -> dlen != cl -> len)) && instab[cl -> insn].flags & lwasm_insn_setdata) ? '.' : ' ');
163 lw_expr_destroy(te); 166 lw_expr_destroy(te);
164 for (i = 0; i < obytelen && i < 8; i++) 167 for (i = 0; i < obytelen && i < 8; i++)
165 { 168 {
166 fprintf(of, "%02X", obytes[i]); 169 fprintf(of, "%02X", obytes[i]);
167 } 170 }