<main.c>
extern void asm_main();
void test(int k, int j, int y)
{
printf("k:%d\n", k);
printf("j:%d\n", j);
printf("y:%d\n", y);
}
int main()
{
asm_main();
return 0;
}
<test.asm>
segment .text
extern _test
global _asm_main
_asm_main:
;entry code
push ebp ; 1. --esp 2. 값 push
mov ebp, esp
push 7
push 9
push 10
call _test
add esp, 12
;exit code
mov esp, ebp
pop ebp ; 1. 값 pop 2. ++esp
ret
'NASM' 카테고리의 다른 글
| 어셈블리어 메모리공간에 저장되는 과정 (0) | 2009/05/14 |
|---|---|
| Bit Operations (0) | 2009/05/12 |
| push,pop (0) | 2009/05/12 |
| 어셈블리어 (0) | 2009/05/11 |



Prev
