summaryrefslogtreecommitdiff
path: root/emma.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2006-08-21 22:14:41 +0000
committerIan C <ianc@noddybox.co.uk>2006-08-21 22:14:41 +0000
commitf91ac106f900280537c0cf38ce3ab082eb4f9a33 (patch)
treec3dce09f4776b5e1e8bf0c705b24203ef57eee0e /emma.c
parent65c818acf64915aa6b1de12774abab855cb6437b (diff)
Added expression handler for EMMA
Diffstat (limited to 'emma.c')
-rw-r--r--emma.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/emma.c b/emma.c
index 41bdb1a..21c640e 100644
--- a/emma.c
+++ b/emma.c
@@ -31,6 +31,7 @@ static const char id[]="$Id$";
#include <stdarg.h>
#include "z80.h"
+#include "expr.h"
#define TRUE 1
@@ -202,7 +203,7 @@ static int StrEq(const char *a, const char *b)
}
-static int Expand(const char *p, long *res)
+static int Expand(void *client, const char *p, long *res)
{
Z80State s;
int ok=TRUE;
@@ -312,10 +313,8 @@ static Z80Word Address(const char *p)
{
long e=0;
- if (!Expand(p,&e))
- {
- e=strtol(p,NULL,0);
- }
+ if (!ExprEval(p,&e,Expand,z80))
+ Log("%s\n",ExprError());
return (Z80Word)e;
}
@@ -331,10 +330,8 @@ static Z80Val Val(const char *p)
{
long e=0;
- if (!Expand(p,&e))
- {
- e=strtol(p,NULL,0);
- }
+ if (!ExprEval(p,&e,Expand,z80))
+ Log("%s\n",ExprError());
return (Z80Val)e;
}
@@ -724,8 +721,6 @@ static void DoRun(int no, const char *arg[])
static void DoUntil(int no, const char *arg[])
{
- Log("No supported\n");
-#if 0
if (no<2)
{
Log("Missing arguments\n");
@@ -763,7 +758,6 @@ static void DoUntil(int no, const char *arg[])
}
stop=FALSE;
-#endif
}