Settings | Sign in | Sign up

There is currently 1 post.

【方法】在Visual Studio C语言程序中嵌入汇编代码

Floor 1 巨大八爪鱼 10/6/16 10:58
#include <stdio.h>
int add(int a, int b)
{
 __asm
 {
  mov eax, a
  add eax, b // eax为返回值
 }
}
int main(void)
{
 printf("%d\n", add(3, 4));
 return 0;
}

输出:7

Content converter:

Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.
©2010-2025 Purasbar Ver3.0 [Mobile] [Desktop]
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported license.