Advertisement
NeoSanFox

__asm

Dec 23rd, 2020
1,285
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int func(int A, int B, int C, int D, int E, int F);
  4.  
  5. int main(void)
  6. {
  7.     printf_s("(a+b*c)/(d-e*f) = %d  \n if a = 4, b = 3, c = 2, d = 6, e = 1, f = 5\n", \
  8.         func(4, 3, 2, 6, 1, 5));
  9.  
  10. }
  11. int func(int A, int B, int C, int D, int E, int F)
  12. {
  13.     __asm
  14.     {
  15.         mov eax, 3;
  16.         mov ecx, 2;
  17.         imul eax, ecx;
  18.         mov ecx, 4;
  19.         add eax, ecx;
  20.         mov ecx, 1;
  21.         mov edx, 5;
  22.         imul ecx, edx;
  23.         mov edx, 6;
  24.         sub edx, ecx;
  25.         shr eax, 2;
  26.     }
  27.     // Return with result in EAX
  28. }
Advertisement
RAW Paste Data Copied
Advertisement