You are on page 1of 7

Submitted to :

Mr. Muhammad jabbar


Submitted by :
21011519-023
Course title:
Computer organization and assembly language
Course code:
cs-225
Submission date:
22-12-2022

Lab# 6 task:
include irvine32.inc
.data
a dd ?

b dd ?
;d dd
s1 byte"input two number",0
s2 byte"greater is",0
.code
main proc
mov edx,offset s1
call writestring
call crlf
call readint
mov a,eax
call crlf
call readint
mov b,eax
mov eax,a
cmp eax,b
jg a1
cmp eax,b
jl a2
jmp next
a1:
mov edx,offset s2
call writestring
call crlf
call writedec
jmp next

a2:
call crlf
mov edx,offset s2
call writestring
call crlf
mov eax,b
call writedec

next :

;call dumpregs
exit
main endp
end main

output:
input two number
8

7
greater is
8
include irvine32.inc
.data
a dd ?

b dd ?
;d dd
s1 byte"input two number",0
s2 byte"smallest is",0
.code
main proc
mov edx,offset s1
call writestring
call crlf
call readint
mov a,eax
call crlf
call readint
mov b,eax
mov eax,a
cmp eax,b
jl a1

jl a2
jmp next
a1:
mov edx,offset s2
call writestring
call crlf
call writedec
jmp next

a2:
call crlf
mov edx,offset s2
call writestring
call crlf
mov eax,b
call writedec

next :

;call dumpregs
exit
main endp
end main
output:
input two number
7

8
smallest is
7
Task 3:
include irvine32.inc
.data
a dd ?

b dd ?
;d dd
s1 byte"inpuT MARKS",0
s2 byte"grade A",0
s3 byte"grade B ",0
s4 byte"grade C ",0

s5 byte"grade F ",0

.code
main proc
MOV EDX,OFFSET S1
CALL WRITESTRING
CALL READINT
CMP EAX,80
JGE A1
CMP EAX,70
JGE A2
CMP EAX,60
JGE A3
CMP EAX,50
JGE A4
JMP NEXT
A1:
MOV EDX,OFFSET S2
CALL WRITESTRING
;CALL WRITEDEC
JMP NEXT
A2:
MOV EDX,OFFSET S3
CALL WRITESTRING
;CALL WRITEDEC
JMP NEXT

A3:
MOV EDX,OFFSET S4
CALL WRITESTRING
;CALL WRITEDEC
JMP NEXT
A4:
MOV EDX,OFFSET S5
CALL WRITESTRING

JMP NEXT

next :

;call dumpregs
exit
main endp
end main
output:

inpuT MARKS97
grade A

You might also like