Monday, August 7, 2017

CONVERSION FROM UPPER TO LOWERCASE IN 8086 PROGRAMMING

TITLE UPPER TO LOWER CASE
.MODEL SMALL
.STACK 64
.DATA
MAXCHR DB 20
ACTCHR DB ?
ACTSTR DB 20 DUP(?)
RESULT DB 20 DUP('$')
.CODE
MAIN PROC FAR
MOV AX,@DATA
MOV DS,AX

MOV DX,OFFSET MAXCHR
MOV AH,0AH
INT 21H

LEA SI,ACTSTR
LEA DI,RESULT
MOV CX,0000H
MOV BX,0000H
LEA BX,ACTCHR
MOV CX,[BX]

L2:
MOV AL,[SI]
CMP AL,41H
JB L1
CMP AL,5AH
JA L1
ADD AL,20H
L1:
MOV [DI],AL
INC SI
INC DI
LOOP L2

MOV DL,0AH
MOV AH,02H
INT 21H

LEA DX,RESULT
MOV AH,09H
INT 21H

MOV AX,4C00H
INT 21H
MAIN ENDP
END MAIN

0 comments:

Post a Comment