You are on page 1of 5

Assignment #4

Computer Organizations and Assembly Language


Submitted to:
Ma’am Anbreen Kausar
Submitted by:
Zeeshan Rafique

(16201519-026)

(CS-16-B)
Due Date
Thursday, December 14, 2017

Fall – 2017

DEPARTMENT OF COMPUTER SCIENCE


FACULTY OF COMPUTING AND INFORMATION
TECHNOLOGY
UNIVERSITY OF GUJRAT, HAFIZ HAYAT CAMPUS
INCLUDE Irvine32.inc
.data
Lowmsg byte "Enter string in lower case: ", 0
Uppermsg byte "String in upper case: ", 0
Uppermsg1 byte "Enter string in upper case: ", 0
tlmsg byte "String in lower case: ", 0
smsg byte "Enter string in Mixup: ", 0
rsmsg byte "Required string: ", 0
array byte 8 dup(?)
.code
main proc

;Lower to upper..
mov edx, offset Lowmsg
call WriteString
mov edx, offset array
mov ecx, lengthof array
call ReadString
mov esi, offset array
mov ecx, lengthof array
mov eax, 0
L1:
mov al, [esi]
AND al, 11011111b
mov[esi], al
inc esi
loop L1
mov edx, offset Uppermsg
call WriteString
mov edx, offset array
call WriteString
call Crlf

Upper to lower..

mov edx, offset Uppermsg1


call WriteString
mov edx, offset array
mov ecx, lengthof array
call ReadString
mov ecx, lengthof array
mov esi, offset array
mov eax, 0
L2:
mov al, [esi]
OR al, 00100000b
mov[esi], al
inc esi
loop L2
mov edx, offset tlmsg
call WriteString
mov edx, offset array
call WriteString
call Crlf

;upper to lower & lower to upper..

mov edx, offset smsg


call WriteStringmov edx, offset array
mov ecx, lengthof array
call ReadString
mov esi, offset array
mov ecx, lengthof array
mov eax, 0
L3:
mov al, [esi]
TEST al, 00100000b
jz UC
jnz LC
UC:
OR al, 00100000b
mov [esi], al
jmp N1
LC:
AND al, 11011111b
mov [esi], al
jmp N1
N1:
inc esi
loop L3
mov edx, offset rsmsg
call WriteString
mov edx, offset array
call WriteString
call Crlf
call ReadChar
invoke ExitProcess, 0
main endp
end main
OUTPUT:

You might also like