diff lwasm/lwasm.c @ 357:0cf4948d53b4

Checkpoint - adding actual cpu instructions
author lost@starbug
date Wed, 31 Mar 2010 20:12:20 -0600
parents 60568b123281
children f50a54d0293a
line wrap: on
line diff
--- a/lwasm/lwasm.c	Wed Mar 31 18:46:32 2010 -0600
+++ b/lwasm/lwasm.c	Wed Mar 31 20:12:20 2010 -0600
@@ -555,3 +555,28 @@
 	
 	return 0;
 }
+
+int lwasm_lookupreg2(const char *regs, char **p)
+{
+	int rval = 0;
+	
+	while (*regs)
+	{
+		if (toupper(**p) == *regs)
+		{
+			if (regs[1] == ' ' && !isalpha(*(*p + 1)))
+				break;
+			if (toupper(*(*p + 1)) == regs[1])
+				break;
+		}
+		regs += 2;
+		rval++;
+	}
+	if (!*regs)
+		return -1;
+	if (regs[1] == ' ')
+		(*p)++;
+	else
+		(*p) += 2;
+	return rval;
+}