]> git.gag.com Git - fw/sdcc/blobdiff - as/xa51/xa_asm.y
xa51, work in progress
[fw/sdcc] / as / xa51 / xa_asm.y
index 7791e7bef41ba7f4232c28caf91bd157fcd6c5c2..4b87ea3f109abf8f7bb1419e8cc2a2a37f540fa1 100644 (file)
@@ -53,7 +53,7 @@ static int bitmask[]={1, 2, 4, 8, 16, 32, 64, 128};
 %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 
@@ -84,7 +84,7 @@ line:          linesymbol ':' linenosym {
                }
 
 linenosym:     directive EOL {
-                       if (p3) out(op, $1);
+                       if (p3) out(op, $1);
                        $$ = $1;
                }
              | instruction EOL {
@@ -115,9 +115,10 @@ directive:     '.' ORG expr {
                        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 {
@@ -137,7 +138,7 @@ directive:     '.' ORG expr {
                         $$ = 0;
                 }
             | bitsymbol BITDEF expr {
-                       if (p1) {
+                       if (p1) {
                                 build_sym_list(symbol_name);
                                 mk_bit(symbol_name);
                         }
@@ -183,6 +184,10 @@ directive:     '.' ORG expr {
                        /* ignore global symbol declaration */
                        $$ = 0;
                }
+            | '.' GLOBL bit {
+                       /* ignore bit symbol declaration */
+                       $$ = 0;
+               }
             | '.' DS expr {
                        /* todo: if CSEG, emit some filler bytes */
                        $$ = $3;
@@ -1136,7 +1141,7 @@ int reg(int reg_spec)
 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;