From a2a22476ed62cf973389330ca380651bd780840c Mon Sep 17 00:00:00 2001 From: drmortalwombat <90205530+drmortalwombat@users.noreply.github.com> Date: Sun, 19 May 2024 22:20:52 +0200 Subject: [PATCH] Add constexpr pointers for inline assembler --- oscar64/Parser.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/oscar64/Parser.cpp b/oscar64/Parser.cpp index bebc822..9c40604 100644 --- a/oscar64/Parser.cpp +++ b/oscar64/Parser.cpp @@ -10363,6 +10363,29 @@ Expression* Parser::ParseAssemblerBaseOperand(Declaration* pcasm, int pcoffset) { exp->mDecType = TheUnsignedIntTypeDeclaration; } + else if (dec->mType == DT_VARIABLE && (dec->mFlags & DTF_CONSTEXPR) && dec->mValue && dec->mValue->mType == EX_CONSTANT) + { + Declaration* dt = dec->mValue->mDecValue; + if (dt->mType == DT_CONST_INTEGER) + { + exp->mDecValue = dt; + exp->mDecType = dt->mBase; + mScanner->NextToken(); + return exp; + } + else if (dt->mType == DT_CONST_ADDRESS) + { + dec = new Declaration(mScanner->mLocation, DT_CONST_INTEGER); + dec->mInteger = dt->mInteger; + dec->mBase = TheUnsignedIntTypeDeclaration; + + exp->mDecValue = dec; + exp->mDecType = TheUnsignedIntTypeDeclaration; + mScanner->NextToken(); + return exp; + } + exp->mDecType = TheUnsignedIntTypeDeclaration; + } else if (dec->mType == DT_CONST_ASSEMBLER) { exp->mDecType = dec->mBase;