diff --git a/PLASMA-BLD1.PO b/PLASMA-BLD1.PO index fcc08ee..698488e 100644 Binary files a/PLASMA-BLD1.PO and b/PLASMA-BLD1.PO differ diff --git a/src/toolsrc/codegen.c b/src/toolsrc/codegen.c index c8eb630..1ceb4f6 100755 --- a/src/toolsrc/codegen.c +++ b/src/toolsrc/codegen.c @@ -232,6 +232,14 @@ void idglobal_size(int type, int size, int constsize) else if (size) emit_data(0, 0, 0, size); } +void idlocal_size(int size) +{ + localsize += size; + if (localsize > 255) + { + parse_error("Local variable size overflow\n"); + } +} int id_tag(char *name, int len) { int i; diff --git a/src/toolsrc/parse.c b/src/toolsrc/parse.c index 6188e7e..e10561f 100755 --- a/src/toolsrc/parse.c +++ b/src/toolsrc/parse.c @@ -1170,8 +1170,13 @@ int parse_var(int type, long basesize) { if (idlen) id_add(idstr, idlen, type, size); - else - emit_data(0, 0, 0, size); + else if (!(type & EXTERN_TYPE)) + { + if (type & LOCAL_TYPE) + idlocal_size(size); + else + emit_data(0, 0, 0, size); + } } return (1); } diff --git a/src/toolsrc/parse.pla b/src/toolsrc/parse.pla index dd81daa..e5f8588 100644 --- a/src/toolsrc/parse.pla +++ b/src/toolsrc/parse.pla @@ -941,8 +941,12 @@ def parse_var(type, basesize)#0 else new_iddata(idptr, idlen, type, size) fin - elsif not (type & (EXTERN_TYPE|LOCAL_TYPE)) - emit_fill(size) + elsif not type & EXTERN_TYPE + if type & LOCAL_TYPE + framesize = framesize + size + else + size_iddata(type, size, 0) + fin fin fin end diff --git a/src/toolsrc/plasm.pla b/src/toolsrc/plasm.pla index 42fd156..eeb5ffb 100644 --- a/src/toolsrc/plasm.pla +++ b/src/toolsrc/plasm.pla @@ -411,7 +411,7 @@ include "toolsrc/parse.pla" // // Look at command line arguments and compile module // -puts("PLASMA Compiler, Version 1.0\n") +puts("PLASMA Compiler, Version 1.01\n") arg = argNext(argFirst) if ^arg and ^(arg + 1) == '-' opt = arg + 2 diff --git a/src/toolsrc/symbols.h b/src/toolsrc/symbols.h index 4fc90ce..9eb8cb6 100755 --- a/src/toolsrc/symbols.h +++ b/src/toolsrc/symbols.h @@ -46,4 +46,6 @@ int id_tag(char *name, int len); int id_const(char *name, int len); int id_type(char *name, int len); void idglobal_size(int type, int size, int constsize); +void idlocal_size(int size); +void idlocal_size(int size); int tag_new(int type);