From 76fd2328d9e7240ef613581a3d90fa9d008bb6de Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Sat, 10 Mar 2018 19:00:01 -0800 Subject: [PATCH] Compiler bugfixes --- src/toolsrc/codegen.pla | 1 + src/toolsrc/codeopt.pla | 2 +- src/toolsrc/codeseq.plh | 4 ++++ src/toolsrc/plasm.pla | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/toolsrc/codegen.pla b/src/toolsrc/codegen.pla index 299fd2c..c51ab70 100644 --- a/src/toolsrc/codegen.pla +++ b/src/toolsrc/codegen.pla @@ -670,6 +670,7 @@ def gen_ctag(seq, tag) op=>opnext = new_op op = op=>opnext fin + op->opcode = INVALID_CODE op->opgroup = CODETAG_GROUP op=>optag = tag return seq diff --git a/src/toolsrc/codeopt.pla b/src/toolsrc/codeopt.pla index c0481d8..234ce8a 100644 --- a/src/toolsrc/codeopt.pla +++ b/src/toolsrc/codeopt.pla @@ -133,7 +133,7 @@ def crunch_seq(seq, pass) fin break is CONST_CODE // Collapse constant operation - nextopnext = nextop->nextop + nextopnext = nextop->opnext if nextopnext when nextopnext->opcode is MUL_CODE diff --git a/src/toolsrc/codeseq.plh b/src/toolsrc/codeseq.plh index 6cc4cf3..899d642 100644 --- a/src/toolsrc/codeseq.plh +++ b/src/toolsrc/codeseq.plh @@ -79,6 +79,10 @@ const BRNCH_CODE = $50 // const CODETAG_GROUP = $06 // +// Invalid code +// +const INVALID_CODE = $FF +// // Code sequence op // struc t_opseq diff --git a/src/toolsrc/plasm.pla b/src/toolsrc/plasm.pla index 5da3dc6..5340763 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.02\n") +puts("PLASMA Compiler, Version 1.03\n") arg = argNext(argFirst) if ^arg and ^(arg + 1) == '-' opt = arg + 2