changeset 410:acaafc70044b

Fixed "=" pseudo op to work correctly
author lost@l-w.ca
date Sun, 08 Aug 2010 23:47:16 -0600
parents cba03436c720
children cac204676434
files extra/README lwasm/pass1.c
diffstat 2 files changed, 17 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/extra/README	Mon Aug 02 18:07:04 2010 -0600
+++ b/extra/README	Sun Aug 08 23:47:16 2010 -0600
@@ -28,16 +28,12 @@
 
 You should probably name them m6809-unknown-none-{ar,as,ld} or similar
 depending on your gcc build target. Then you'll want to get the gcc6809
-patch and patch the correct gcc source code. Then use a configure line
-similar to the following:
+patch and patch the correct gcc source code. You probably want to add
+m6809-unknown-none-ranlib as a symblink to /bin/true, too.
 
-configure --enable-languages=c --target=m6809-coco
---program-prefix=m6809-coco-lwos- --enable-obsolete
---srcdir=/home/lost/gcc6809/src/gcc-4.3.3 --disable-threads --disable-nls
---disable-libssp --prefix=/usr/local/coco --with-as=/usr/local/coco/bin/as
---with-ld=/usr/local/coco/bin/ld --with-sysroot=/usr/local/coco
-
-Obviously adjust various paths to match what you're doing.
+Then, you can skip the bits in the install instructions that install
+"binutils" and so on. A simple "make" in the "build-6809" directory should
+do. At least it does with gcc6809-4.3.4-3.
 
 The exact mechanics of configuring and getting gcc to install correctly is
-left as an exercise to the dedicated masochist.
+left as an exercise to the dedicated masochist.
\ No newline at end of file
--- a/lwasm/pass1.c	Mon Aug 02 18:07:04 2010 -0600
+++ b/lwasm/pass1.c	Sun Aug 08 23:47:16 2010 -0600
@@ -185,10 +185,10 @@
 		}
 
 		// find the end of the first token
-		for (tok = p1; *p1 && !isspace(*p1) && *p1 != ':'; p1++)
+		for (tok = p1; *p1 && !isspace(*p1) && *p1 != ':' && *p1 != '='; p1++)
 			/* do nothing */ ;
 		
-		if (*p1 == ':' || stspace == 0)
+		if (*p1 == ':' || *p1 == '=' || stspace == 0)
 		{
 			// have a symbol here
 			sym = lw_strndup(tok, p1 - tok);
@@ -197,8 +197,15 @@
 			for (; *p1 && isspace(*p1); p1++)
 				/* do nothing */ ;
 			
-			for (tok = p1; *p1 && !isspace(*p1); p1++)
-				/* do nothing */ ;
+			if (*p1 == '=')
+			{
+				tok = p1++;
+			}
+			else
+			{
+				for (tok = p1; *p1 && !isspace(*p1); p1++)
+					/* do nothing */ ;
+			}
 		}
 		if (sym)
 			cl -> sym = lw_strdup(sym);