summaryrefslogtreecommitdiffhomepage
path: root/cpp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp.cpp')
-rw-r--r--cpp.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp.cpp b/cpp.cpp
index c988b5d..c8de4c8 100644
--- a/cpp.cpp
+++ b/cpp.cpp
@@ -1,6 +1,7 @@
#include "cpp.h"
#include "asm/encode.h"
+#include "asm/operators.h"
#include "bnf.h"
#include "cppbnf.h"
#include "debug.h"
@@ -584,13 +585,13 @@ void CPP::link()
// TODO
// mSegment -> elf
-#if 0
- return {
+
+ mCode = std::vector<uint8_t>{
0x48, 0xc7, 0xc0, 0x3c, 0x00, 0x00, 0x00, // mov $0x3c,%rax # syscall 60
0x48, 0x31, 0xff, // xor %rdi,%rdi # exit code 0
+ } + mSegment.getCode() + std::vector<uint8_t>{ // add to edi
0x0f, 0x05, // syscall
};
-#endif
}
// phases of translation, according to standard