Advertisement
Mysoft

Untitled

Dec 13th, 2020
2,363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "crt.bi"
  2.  
  3. dim shared as zstring*12 zText = "eax+ebx=%i"
  4.  
  5. asm
  6.  
  7.   mov eax, 10
  8.   mov ebx, 30
  9.   add eax, ebx
  10.  
  11.   'notice the parameters are pushed on the inverse order because you are pushing to a stack
  12.   'so the last pushed is the first in memory order... (string,number)
  13.   push eax
  14.   push offset zText
  15.    
  16.   call printf
  17.   '(8 bytes were passed to the CDECL style function, the 4 byte pointer, and the 4 byte integer)
  18.   'so this is to clean up what the two PUSH stored. when calling a function that uses C calling convention)
  19.   add esp, 8
  20.  
  21. end asm
  22.  
  23. 'mixed is simpler :P
  24. sleep
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement