Professional Documents
Culture Documents
Task 1: Irvine32.inc
Task 1: Irvine32.inc
Task 1: Irvine32.inc
inc
.data
marks dd ?
Task 1
msg byte "please enter marks in percentage form : ",0
s1 byte "grade A",0
s2 byte "grade B ",0
s3 byte "grade C",0 ;creating required data
s4 byte "grade D",0
s5 byte "grade F",0
.code
main proc
cmp eax , 80
jge l2
cmp eax , 70
jge l3
cmp eax , 60
jge l4
cmp eax , 50
jge l5
l2:
mov edx , offset s2 ; similar process for all other labels
call writestring
jmp next
l3:
mov edx , offset s3
call writestring
jmp next
l4:
mov edx , offset s4
call writestring
jmp next
l5:
mov edx , offset s5
call writestring
jmp next
next:
exit
main endp
end
include Irvine32.inc
.data
num1 dd ?
num2 dd ?
Task 2
s1 byte "enter 1st number:",0 ; asking for two numbers
s2 byte "enter 2nd number:",0
s3 byte "greater :",0
s4 byte "equal",0
.code
main proc
l1:
mov edx , offset s3 ;print s3
call writestring
call writeint ; print greater number
jmp ntt ; break after code is successfully execute
nxt:
call crlf ;mov to output to next line
mov eax , num1 ;if number 2 is lesser then num1 is moved to eax
mov edx , offset s3
call writestring
call writeint ; now eax is with greater number and it will be printed
jmp hh ; break for this code of block
l3:
mov edx , offset s4 ;this will execute If both numbers are equal
call writestring
ntt:
hh:
exit
main endp
end
include Irvine32.inc
.data
num1 dd ?
num2 dd ?
Task 3
s1 byte "enter 1st number:",0 ; asking for two numbers
s2 byte "enter 2nd number:",0
s3 byte "greater :",0
s4 byte "equal",0
.code
main proc
l1:
mov edx , offset s3 ;print s3
call writestring
call writeint ; print lesser number
jmp ntt ; break after code is successfully execute
nxt:
call crlf ;mov to output to next line
mov eax , num1 ;if number 2 is greater then num1 is moved to eax
mov edx , offset s3
call writestring
call writeint ; now eax is with lesser number and it will be printed
jmp hh ; break for this code of block
l3:
mov edx , offset s4 ;this will execute If both numbers are equal
call writestring
ntt:
hh:
exit
main endp
end