Write an assembly language program that inputs a single letter and shows the same letter in it’s opposite case in a new line. (Lower-case to Upper-case or vice-versa)
DIS MACRO STR
MOV AH,09H
LEA DX,STR
INT 21H
ENDM
DATA SEGMENT
MSG1 DB \"ENTER YOUR STRING : $\"
MSG2 DB \"CONVERTED STRING IS : $\"
STR1 DB 20 DUP(\'$\')
LINE DB 10,13,\'$\'
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
DIS MSG1
MOV AH,0AH
LEA DX,STR1
INT 21H
DIS LINE
MOV CH,00
MOV CL,BYTE PTR[STR1+1]
LEA SI,STR1+2
L1: MOV AH,BYTE PTR[SI]
CMP AH,\'A\'
JL L4
CMP AH,\'Z\'
JG L2
ADD BYTE PTR[SI],32
JMP L3
L2:CMP AH,\'a\'
JL L4
CMP AH,\'z\'
JG L4
SUB BYTE PTR[SI],32
L3:INC SI
LOOP L1
DIS MSG2
DIS STR1+2
L4:MOV AH,4CH
INT 21H
CODE ENDS
END START
;------
;OUTPUT
;------
ENTER YOUR STRING : JiNeSh
CONVERTED STRING IS : jInEsh
Are there any code examples left?
New code examples in category TypeScript
-
TypeScript 2022-03-27 19:30:45 typescript promise
-
TypeScript 2022-03-27 17:25:44 how to search for imports in vscode
-
TypeScript 2022-03-27 17:15:20 angular formgroup mark as touched
-
TypeScript 2022-03-27 17:05:06 use of slice and splice add elements array
-
TypeScript 2022-03-27 16:50:23 android studio loop through all objects in layout
-
TypeScript 2022-03-27 14:35:08 wergensherts meaning
-
TypeScript 2022-03-27 13:50:15 remove all the elements from a numpy array python
-
TypeScript 2022-03-27 12:35:49 redux toolkit typescript install
-
TypeScript 2022-03-27 12:35:30 laravel middleware for apis