summaryrefslogtreecommitdiffhomepage
path: root/dev/LibCompiler/src
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-02-01 10:59:32 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-02-01 10:59:32 +0100
commit15fe85002f0377c3a4b1ff6b7d50f42033184713 (patch)
tree68a7b171799c8d210e44a68ac284ce2b2da8dbb4 /dev/LibCompiler/src
parent9680ed596db87636c33001bd5a205c44d38117e1 (diff)
ADD: Tweak C++ AMD64 compiler to remove \r endings, to ensure assembler
understands the assembly correctly. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/LibCompiler/src')
-rw-r--r--dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc
index 29de94c..3f9a042 100644
--- a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc
+++ b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc
@@ -752,7 +752,7 @@ bool CompilerFrontendCPlusPlus::Compile(const std::string text,
if (pair != subText)
continue;
- syntax_tree.fUserValue = "mov rax," + kRegisterList[indxReg - 1] + "\r\nret\n";
+ syntax_tree.fUserValue = "mov rax, " + kRegisterList[indxReg - 1] + "\nret\n";
break;
}
@@ -763,13 +763,13 @@ bool CompilerFrontendCPlusPlus::Compile(const std::string text,
}
else
{
- syntax_tree.fUserValue = "mov rax, " + subText + "\r\nret\n";
+ syntax_tree.fUserValue = "mov rax, " + subText + "\nret\n";
}
}
else
{
syntax_tree.fUserValue = "__LIBCOMPILER_LOCAL_RETURN_STRING: db " + subText + ", 0\nmov rcx, __LIBCOMPILER_LOCAL_RETURN_STRING\n";
- syntax_tree.fUserValue += "mov rax, rcx\r\nret\n";
+ syntax_tree.fUserValue += "mov rax, rcx\nret\n";
}
break;