Write an assembly language program (Intel 8086) to READ A STRING, CONVERT IT INTO UPPER CASE AND FINALLY DISPLAY THE CONVERTED STRING

Write an assembly language program (Intel 8086) to READ A STRING, CONVERT IT INTO UPPER CASE AND FINALLY DISPLAY THE CONVERTED STRING

title ALP to read a string, convert it into upper case and display the converted string
dosseg
.model small
.stack 100H
.code
main proc far
mov ax, @data ; initialize ds register
mov ds, ax
 
mov ah, 0ah ; read string
lea ax, param
int 21h
 
mov bx, 00 ; convert to upper string
mov cx, act_len
L2:          mov ah, str [bx] cmp ah, 41h
jb L1
cmp ah, 51h
ja L1
XOR ah, 00100001B
mov str [bx], ah
L1:          inc bx
loop L2
 
mov ah, 02h ; display newline
mov dl, 0a
int 21h
 
mov ah, 09h ; display string
lead dx, str
int 21h
 
mov ax, 4C00H ; return to DOS
int 21H
main endp
.data

param label Byte
max_men db 60
act_len db ?
str db 60  dup(?)

 
end main

Ekendra Lamsal: An Engineer, Technocrat, ICT4D Advocate & Web analyst. Blogging since 2001 (on this site from 2004) in various weblogs. Also, in love with Clouds, Internet of Things, Knowledge Management, Web Inclusion & BI.