Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change
Quote from: zedd151 on Today at 05:35:57 AMI had seen your posting in the Linux board.
Is this for Linux or Windows?
int foo(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8) {
return arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8;
}
int bar() {
return foo(1, 2, 3, 4, 5, 6, 7, 8);
}
bar:
push rbp
mov rbp, rsp
push 8
push 7
mov r9d, 6
mov r8d, 5
mov ecx, 4
mov edx, 3
mov esi, 2
mov edi, 1
call foo
add rsp, 16
leave
ret
mov rsp,rbp
pop rbp
foo:
push rbp
mov rbp, rsp
mov DWORD PTR [rbp-4], edi
mov DWORD PTR [rbp-8], esi
mov DWORD PTR [rbp-12], edx
mov DWORD PTR [rbp-16], ecx
mov DWORD PTR [rbp-20], r8d
mov DWORD PTR [rbp-24], r9d
mov edx, DWORD PTR [rbp-4]
mov eax, DWORD PTR [rbp-8]
add edx, eax
mov eax, DWORD PTR [rbp-12]
add edx, eax
mov eax, DWORD PTR [rbp-16]
add edx, eax
mov eax, DWORD PTR [rbp-20]
add edx, eax
mov eax, DWORD PTR [rbp-24]
add edx, eax
mov eax, DWORD PTR [rbp+16]
add edx, eax
mov eax, DWORD PTR [rbp+24]
add eax, edx
pop rbp
ret