diff a09.c @ 8:96a067cf4c4f

level2 rom done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 05 Jul 2018 12:07:06 +0900
parents a6db579d8c11
children ce7323f9b937
line wrap: on
line diff
--- a/a09.c	Thu Jul 05 02:00:14 2018 +0900
+++ b/a09.c	Thu Jul 05 12:07:06 2018 +0900
@@ -181,21 +181,31 @@
 int os9 = 0;   // os9 flag
 int prevloc = 0;
 
-/* Symbol categories.
-   0 Constant value (from equ).
-   1 Variable value (from set)
-   2 Address within program module (label).
-   3 Variable containing address.
-   4 Adress in other program module (extern)
-   5 Variable containing external address.
-   6 Unresolved address.
-   7 Variable containing unresolved address.
-   8 Public label.
-   9 Macro definition.
-  10 Public label (yet undefined).
-  11 parameter name.
-  12 local label.
-  13 empty.
+/* expression categories...
+   ECORD   all zeros is ordinary constant.
+   ECADR   bit 1 indicates address within module.
+   ECEXT   bit 2 indicates external address.
+   ECLBL   bit 3 public label
+   ECABS   bit 4 indicates this can't be relocated if it's an address.
+   ECNEG   bit 5 indicates address (if any) is negative.
+*/
+
+
+/* Symbol categories.                               exprcat ( symcat & 0xe )
+   0 SCC      Constant value (from equ).                     ECORD
+   1 SCV      Variable value (from set)                      ECORD
+   2 SCC__ADR Address within program module (label).         ECADR
+   3 SCV__ADR Variable containing address.                   ECADR
+   4 SC_E_ADR Adress in other program module (extern)        ECEXT
+   5 SCVE_ADR Variable containing external address.          ECEXT
+   6 SCU _ADR Unresolved address.                            ECEXT+ECADR
+   7 SCV_UADR Variable containing unresolved address.        ECEXT+ECADR
+   8 SC___LBL Public label.                                  ECLBL
+   9 SCMACRO  Macro definition.                              xxx
+  10 SCU__LBL Public label (yet undefined).                  ECADR+ECLBL
+  11 SCPARAM  parameter name.                                ECADR+ECLBL
+  12 SCLOCAL  local label.                                   ECEXT+ECLBL
+  13 SCEMPTY  empty.                                         xxx
 */
 
 struct symrecord symtable[NLABELS];
@@ -431,15 +441,6 @@
  return p->value;
 }
 
-/* expression categories...
-   all zeros is ordinary constant.
-   bit 1 indicates address within module.
-   bit 2 indicates external address.
-   bit 4 indicates this can't be relocated if it's an address.
-   bit 5 indicates address (if any) is negative.
-*/
-
-
 
 short scanfactor()
 {
@@ -934,9 +935,9 @@
                 if(offs<-128||offs>=128||opsize==3||unknown||!certain) {
                  if((!unknown)&&opsize==2&&(offs<-128||offs>=128) )
                    error|=16;
-                 offs--;
-                 opsize=3;
-                 postbyte++;
+                 // offs--;
+                 // opsize=3;
+                 // postbyte++;
                 }
                 putbyte(postbyte);
                 if (debug) fprintf(stderr,"DEBUG: doaddress: mode=%d, opsize=%d, error=%d, postbyte=%02X, operand=%04X offs=%d\n",mode,opsize,error,postbyte,operand,offs);