You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
672 B
NASM
44 lines
672 B
NASM
.686p
|
|
.model flat
|
|
include kernel32.inc
|
|
includelib kernel32.lib
|
|
includelib msvcrt.lib
|
|
extern _printf:proc
|
|
extern _scanf:proc
|
|
extern _strlen:proc
|
|
.data
|
|
strScanfFmt db "%d%d%d",0
|
|
strPrintfFmt db "%d",0
|
|
.code
|
|
_main proc
|
|
var1=-4
|
|
var2=-8
|
|
var3=-12
|
|
mov ebp, esp
|
|
sub esp, 12
|
|
lea edx, dword ptr [ebp+var3]
|
|
push edx
|
|
lea edx, dword ptr [ebp+var2]
|
|
push edx
|
|
lea edx, dword ptr [ebp+var1]
|
|
push edx
|
|
push offset strScanfFmt
|
|
call _scanf
|
|
add esp, 16
|
|
imul ecx, dword ptr var1[ebp], -5
|
|
mov eax, dword ptr var2[ebp]
|
|
neg eax
|
|
cdq
|
|
idiv dword ptr var3[ebp]
|
|
mov ebx, edx
|
|
mov eax, ecx
|
|
cdq
|
|
idiv ebx
|
|
push eax
|
|
push offset strPrintfFmt
|
|
call _printf
|
|
add esp, 8
|
|
push 0
|
|
call ExitProcess
|
|
_main endp
|
|
end _main |