Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Mutahra Eman

22021519-061
Quiz no: 03
Question no:01
include irvine32.inc
include macros.inc
.data
msg byte"entr a number",0
a dd ?
b dd ?
.code
main proc
mov edx,offset msg
call writestring
call readint
mov a,eax
mov edx,offset msg
call writestring
call readint
mov b,eax
push a
push b
call check
main endp
check proc
push ebp
mov ebp,esp
mov eax,[ebp+8]
mov ebx,[ebp+12]
cmp eax,0
js l1
l2:
call crlf
mwrite" first number is negative"
cmp ebx,0
js l4
l3:
mwrite"number is psitive"
l1:
mwrite" first number is positive"
l4:
call crlf
mwrite"second number is negative"
ret
check endp
End main

Description
First we took two value from user and store them in two variables. Then we push these values
and stack and pop them in a function that would check either the entered values are positive or
negative. For this we compare these values with 0 to check either the value is positive or not.
And at the end we call that user-defined function in main function.

You might also like