From f91ac106f900280537c0cf38ce3ab082eb4f9a33 Mon Sep 17 00:00:00 2001 From: Ian C Date: Mon, 21 Aug 2006 22:14:41 +0000 Subject: Added expression handler for EMMA --- emma.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'emma.c') 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 #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 } -- cgit v1.2.3