Hi guys
I want to write program in assembly language to read string from user and replace each symbol * in string to E but i do not know how i can replace * to E after read string>>>Iam begginer in this language
this is my code and i hope to help me >>>pl.help me iam wating your help
STACKSEG SEGMENT
DW 32 DUP(?)
STACKSEG ENDS
;============================
DATASEG SEGMENT
LF EQU 0AH
CR EQU 0DH
MSG DB 'Enter the firts string...$'
MSG1 DB CR,LF, 'The string is: $'
STR1 DB 9 DUP(?)
DATASEG ENDS
;===========================
CODESEG SEGMENT
BEGIN PROC FAR
ASSUME SS:STACKSEG,DS:DATASEG,CS:CODESEG
MOV AX,DATASEG
MOV DS,AX
MOV ES,AX
;Reading the messege
LEA DX,MSG
MOV AH,9
INT 21H
;===========================
MOV CX,0
CLD
LEA DI,STR1
MOV AH,1
REPEATE:
INT 21H
STOSB
INC DX
UNTIL:
CMP AL,0DH
JNE REPEATE
DEC DI
MOV AL,'$'
STOSB
;================================
CLD
MOV DX,CX
;Scan symbol * and replace it into E
LEA SI,STR1
;Looking for the * in string
MOV AL,'*'
REPNE SCASB
JE FOUND
FOUND:
MOV AL,'E'
STOSB
DEC DX
;=================================
;Print string1
LEA DX,MSG1
MOV AH,9
INT 21H
LEA SI,STR1
REP:
LODSB
MOV DL,AL
MOV AH,2
INT 21H
DEC CX
CMP CX,0
JE END_PROG
LOOP REP
;Return control for assembler
END_PROG:
MOV AH,4CH
INT 21H
BEGIN ENDP
CODESEG ENDS
END BEGIN