Posts

Showing posts with the label masm

Passing parameters in assembly language irvine Library

Passing parameters in assembly language irvine Library I'm trying to write a program to calculate the area of a circle by passing parameter. the program prompts a user to enter radius through the main PROC. the are is computed in another procedure say; Area and the results returned in the main PROC. this is done using Irvine32 library. I cant fugure out how to pass parameters. this is what i've done INCLUDE Irvine32.inc .data varx BYTE "Enter radius: " radius DWORD ? y DWORD 22d z DWORD 7d varz BYTE "The Area of the circle is " .code area PROC mov ecx, eax mov eax, y mov ebx, z mul ecx mul ecx div ebx mov edx, OFFSET varz call WriteString call WriteInt call DumpRegs ret area ENDP main PROC mov edx, OFFSET varx call WriteString call ReadInt mov ebx, eax call area exit main ENDP END main What is y and z ? What kind of formula do you want to use to calculate circle ...