Create an assembly language program that switches the case of each letter in a string variable. eg .
mystring BYTE "Hello World",0
output:
hELLO wORLD
I tried the following code, but this convert all characters to upper case. I dnt know how to convert upper case to lower and vise versa in a string
.386
.model flat,stdcall
.stack 4096
ExitProcess proto,dwExitCode:dword
.data
mystring BYTE "Hello World",0
.code
main proc
mov ecx,LENGTHOF mystring
mov esi,OFFSET mystring
L1:
and BYTE PTR \[esi\],11011111b
inc esi
loop L1
invoke ExitProcess,0
main endp
end main