프로그래밍 언어/서브루틴
-
어셈블리어 - MASM프로그래밍 언어/서브루틴 2013. 6. 4. 20:20
TITLE Calculating a Factorial (Fact.asm) .386.MODEL flat,stdcallINCLUDE SmallWin.inc.STACK 4096 .codemain PROCpush 12; calculate 12 factorialcall Factorial; calculate factorial (eax)INVOKE ExitProcess,0main ENDP Factorial PROCpush ebpmov ebp,espmov eax,[ebp+8]; get ncmp eax,0; n < 0?ja L1; yes: continuemov eax,1; no: return 1jmp L2 L1: dec eaxpush eax; Factorial(n-1)call Factorial mov ebx,[ebp+8..
-
어셈블리어프로그래밍 언어/서브루틴 2013. 5. 8. 01:44
function name(label)a symbol that represents the address where the function’s code starts call instructionCopying the stack pointer into the base pointer at the beginning of a function%ebp is a constant reference to the stack framefunction parameterspushes all of the parameters for the function onto the stack in the reverse order%ebp # fixed indexes from the base pointerreturn addresscall instru..