Reinstated check for labels in zero page

This commit is contained in:
Andrew Alderwick 2021-04-21 21:01:50 +01:00
parent 3474b3a4f1
commit e7f234f55b
2 changed files with 3 additions and 1 deletions

View File

@ -3,7 +3,7 @@
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ] |00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ] |20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ]
|0100 |0000
@dvd [ &x $2 &y $2 &dx $1 &dy $1 ] @dvd [ &x $2 &y $2 &dx $1 &dy $1 ]

View File

@ -233,6 +233,8 @@ parsetoken(char *w)
Label *l; Label *l;
Macro *m; Macro *m;
if(w[0] == '.' && (l = findlabel(w + 1))) { /* zero-page */ if(w[0] == '.' && (l = findlabel(w + 1))) { /* zero-page */
if(l->addr > 0xff)
return error("Address is not in zero page", w);
pushbyte(l->addr, 1); pushbyte(l->addr, 1);
return ++l->refs; return ++l->refs;
} else if(w[0] == ',' && (l = findlabel(w + 1))) { } else if(w[0] == ',' && (l = findlabel(w + 1))) {