Open rdebath opened 4 years ago
This means that the C library will be mapped above the 2GB line and you must use a 64bit mov to load the addresses of putchar and getchar.
putchar
getchar
diff --git a/emit_x64.dasc b/emit_x64.dasc index d4f78ef..715232e 100644 --- a/emit_x64.dasc +++ b/emit_x64.dasc @@ -8,7 +8,11 @@ |.define TMP, al | |.macro callp, addr +#if (defined(__code_model_small__) && !defined(__PIC__)) || defined(__ILP32__) | mov rax, (uintptr_t)addr +#else +| mov64 rax, (uintptr_t)addr +#endif | call rax |.endmacro |
This means that the C library will be mapped above the 2GB line and you must use a 64bit mov to load the addresses of
putchar
andgetchar
.