1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-22 16:33:48 +00:00

Adding the fix code segment in far call bank.

Added the currentBankLocation to the procedure definition.
This commit is contained in:
Flight_Control 2022-11-21 20:11:25 +01:00
parent c9fa35a42c
commit 0d90caebe8

View File

@ -589,6 +589,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
}
procedure.setParameters(parameterList);
procedure.setCodeSegment(currentCodeSegment); // When a procedure is defined, the currentCodeSegment is to be set.
procedure.setBankLocation(currentBank); // When a procedure is defined, the currentBank is to be set, or far calls won't work.
// Add return variable
if(!SymbolType.VOID.equals(procedure.getReturnType())) {
final VariableBuilder builder = new VariableBuilder("return", procedure, false, false, procedure.getReturnType(), varDecl.getDeclDirectives(), currentDataSegment, program.getTargetPlatform().getVariableBuilderConfig());