Improve byte, word and semicolon handling in asxlat
authorNick Downing <nick@ndcode.org>
Thu, 11 Aug 2022 03:25:32 +0000 (13:25 +1000)
committerNick Downing <nick@ndcode.org>
Thu, 11 Aug 2022 03:26:26 +0000 (13:26 +1000)
as0.c

diff --git a/as0.c b/as0.c
index dfe1d2f..3a48bca 100644 (file)
--- a/as0.c
+++ b/as0.c
@@ -825,7 +825,14 @@ void pass0() {
        ealoop:
 /* printf("ealoop token = 0x%08x\n", token); */
                if (token == TSEMICOLON)
+ {
+#if TRANSLATE
+  if (xbufp >= xbuf + 0xff0)
+   abort();
+  xbufp += sprintf(xbufp, "\n");
+#endif
                        continue;
+ }
                if (token == TNEWLINE) {
                        line++;
                        continue;
@@ -2061,7 +2068,14 @@ void p0opline() {
                if (token == TSTRING)
                        p0opl17();
                else
+ {
+#if TRANSLATE
+  if (xbufp >= xbuf + 0xff0)
+   abort();
+  xbufp += sprintf(xbufp, ".dw ");
+#endif
                        p0xpr();
+ }
                return;
        }
 
@@ -2156,11 +2170,21 @@ void p0opline() {
 /*     opl16 */
 
        case FDOTBYTE:
+#if TRANSLATE
+ if (xstartp >= xbuf + 0xff0)
+  abort();
+ xbufp = xstartp + sprintf(xstartp, ".db");
+#endif
                p0opl16();
                return;
 
 #if 1 /* modifications for dec syntax */
        case FDOTWORD:
+#if TRANSLATE
+ if (xstartp >= xbuf + 0xff0)
+  abort();
+ xbufp = xstartp + sprintf(xstartp, ".dw");
+#endif
                p0opldotword();
                return;
 #endif