diff --git a/analyser/analyser.cpp b/analyser/analyser.cpp index 3494f3f..9801854 100644 --- a/analyser/analyser.cpp +++ b/analyser/analyser.cpp @@ -811,6 +811,7 @@ void Analyser::analyse_print_statement() unreadToken(); while (analyse_expression()) { addInstruction(Instruction(Operation::iprint)); + addInstruction(Instruction(Operation::printl)); next = nextToken(); if (!next.has_value()) { throw Error("Missing ')'", _currentLine); diff --git a/assembler/assembler.cpp b/assembler/assembler.cpp index 1496030..b91d219 100644 --- a/assembler/assembler.cpp +++ b/assembler/assembler.cpp @@ -25,7 +25,8 @@ std::map ITATable = { {Operation::iscan,"iscan"}, {Operation::iload,"iload"}, {Operation::istore,"istore"}, - {Operation::ineg,"ineg"} + {Operation::ineg,"ineg"}, + {Operation::printl,"printl"} }; std::string Assembler::instructionToAssembly(Instruction & ins) { diff --git a/compiler/compiler.cpp b/compiler/compiler.cpp index e55bdf2..e6f1249 100644 --- a/compiler/compiler.cpp +++ b/compiler/compiler.cpp @@ -37,7 +37,8 @@ std::map ITCTable = { {Operation::iscan,"\xb0"}, {Operation::iload,"\x10"}, {Operation::istore,"\x20"}, - {Operation::ineg,"\x40"} + {Operation::ineg,"\x40"}, + {Operation::printl,"\xaf"}//0 }; void Compiler::instructionToBinary(Instruction& ins) { diff --git a/instruction/instruction.h b/instruction/instruction.h index ee78e22..8ee7a29 100644 --- a/instruction/instruction.h +++ b/instruction/instruction.h @@ -26,7 +26,8 @@ enum class Operation { iscan, iload, istore, - ineg + ineg, + printl }; class Instruction final {