Write and run (using appropriate calling program) a near procedure in 8086 assembly language that accepts an ASCII value as a parameter in AL register and displays this value on the output screen.
Answers
Answered by
4
DATA SEGMENT
STR1 DB “MAHESH$”
STR2 DB 7 DUP (‘$’)
MSG1 DB 10,13,’STORED STRING IN MEMORY IS : $’
MSG2 DB 10,13,’REVERSE STRING IS : $’
DATA ENDS
DISPLAY MACRO MSG
MOV AH,9
LEA DX,MSG
INT 21H
ENDM
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
DISPLAY MSG1
DISPLAY STR1
LEA SI,STR2
LEA DI,STR1
ADD DI,5
MOV CX,6
REVERSE:
MOV AL,[DI]
MOV [SI],AL
INC SI
DEC DI
LOOP REVERSE
DISPLAY MSG2
DISPLAY STR2
MOV AH,4CH
INT 21H
CODE ENDS
END START
HOPE THE ANSWER IS USE FUL
STR1 DB “MAHESH$”
STR2 DB 7 DUP (‘$’)
MSG1 DB 10,13,’STORED STRING IN MEMORY IS : $’
MSG2 DB 10,13,’REVERSE STRING IS : $’
DATA ENDS
DISPLAY MACRO MSG
MOV AH,9
LEA DX,MSG
INT 21H
ENDM
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
DISPLAY MSG1
DISPLAY STR1
LEA SI,STR2
LEA DI,STR1
ADD DI,5
MOV CX,6
REVERSE:
MOV AL,[DI]
MOV [SI],AL
INC SI
DEC DI
LOOP REVERSE
DISPLAY MSG2
DISPLAY STR2
MOV AH,4CH
INT 21H
CODE ENDS
END START
HOPE THE ANSWER IS USE FUL
mehranqadiri:
thank u vry much
Similar questions