%token SETB SEXT SUB SUBB TRAP XCH XOR
%token REG DPTR PC A C USP
%token WORD BIT NUMBER CHAR STRING EOL LOCAL_LABEL
-%token ORG EQU DB DW BITDEF REGDEF LOW HIGH
+%token ORG EQU SFR DB DW BITDEF REGDEF LOW HIGH
%token RSHIFT LSHIFT
%token AREA AREA_NAME AREA_DESC DS
%token MODULE GLOBL
}
linenosym: directive EOL {
- if (p3) out(op, $1);
+ if (p3) out(op, $1);
$$ = $1;
}
| instruction EOL {
if (p1) build_sym_list(symbol_name);
if (p1 || p2) assign_value(symbol_name, $3);
}
- | symbol EQU expr {
+ | symbol SFR expr {
if (p1) build_sym_list(symbol_name);
if (p1 || p2) assign_value(symbol_name, $3);
+ if (p1 || p2) mk_sfr(symbol_name);
$$ = 0;
}
| '.' BITDEF bitsymbol ',' bit {
$$ = 0;
}
| bitsymbol BITDEF expr {
- if (p1) {
+ if (p1) {
build_sym_list(symbol_name);
mk_bit(symbol_name);
}
/* ignore global symbol declaration */
$$ = 0;
}
+ | '.' GLOBL bit {
+ /* ignore bit symbol declaration */
+ $$ = 0;
+ }
| '.' DS expr {
/* todo: if CSEG, emit some filler bytes */
$$ = $3;
int reg_indirect(int reg_spec)
{
if (reg_spec & BYTE_REG)
- error("Imdirect addressing may not use byte registers");
+ error("Indirect addressing may not use byte registers");
if ((reg_spec & 15) > 7)
error("Only R0 through R7 may be used for indirect addr");
return reg_spec & 7;