Advertisement
MichaelPetch

inlinebug

Jul 31st, 2019
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. /* Compile with -O0 it will work, compile with -O3 and it will likely print nothing */
  2.  
  3. #define write(RESULT, FD, BUFF, SIZE) \
  4. asm volatile ("syscall" : \
  5. "=a" (RESULT) : \
  6. "D" (FD), "S" (BUFF), "d" (SIZE), "a" (1) \
  7. : "rcx", "r11")
  8.  
  9. int
  10. main() {
  11. char str[]="Hello\n";
  12. int res;
  13. write(res, 1, str, 6);
  14.  
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement