| ... | ... |
@@ -296,18 +296,20 @@ pass1(FILE *f) |
| 296 | 296 |
printf("Pass 1\n");
|
| 297 | 297 |
while(fscanf(f, "%s", w) == 1) {
|
| 298 | 298 |
if(skipblock(w, &ccmnt, '(', ')')) continue;
|
| 299 |
- if(w[0] == '|') |
|
| 299 |
+ if(w[0] == '|') {
|
|
| 300 |
+ if(!sihx(w + 1)) |
|
| 301 |
+ return error("Invalid padding", w);
|
|
| 300 | 302 |
addr = shex(w + 1); |
| 301 |
- else if(w[0] == '%') {
|
|
| 303 |
+ } else if(w[0] == '%') {
|
|
| 302 | 304 |
if(!makemacro(w + 1, f)) |
| 303 |
- return error("Pass1 failed", w);
|
|
| 305 |
+ return error("Invalid macro", w);
|
|
| 304 | 306 |
} else if(w[0] == '@') {
|
| 305 | 307 |
if(!makelabel(w + 1, addr)) |
| 306 |
- return error("Pass1 failed", w);
|
|
| 308 |
+ return error("Invalid label", w);
|
|
| 307 | 309 |
scpy(w + 1, scope, 64); |
| 308 | 310 |
} else if(w[0] == '&') {
|
| 309 | 311 |
if(!makelabel(sublabel(subw, scope, w + 1), addr)) |
| 310 |
- return error("Pass1 failed", w);
|
|
| 312 |
+ return error("Ivalid sublabel", w);
|
|
| 311 | 313 |
} else if(sihx(w)) |
| 312 | 314 |
addr += slen(w) / 2; |
| 313 | 315 |
else |