Answered step by step
Verified Expert Solution
Question
1 Approved Answer
DONT COPY OTHER CHEGG ANSWER PLEASE . Make reverse code output correctly as shown in the screenshot. Base - Plus - Index Read then Write
DONT COPY OTHER CHEGG ANSWER PLEASE Make reverse code output correctly as shown in the screenshot. BasePlusIndex Read then Write Exercise: displaying a string of characters to the monitor
This program will display a message of your choice by reading the input line then print it to the monitor.
a
Assemble the following code at the default location just enter a
a Note only the offsets are shown as the line numbers below dont type the offsets or comments after the semicolon
MOV AX; ;et data segment
MOV DSAX
MOV SI ;point to storage location
MOV AH ;read command WAITFORLF TOP
INT ; read one char into AL this is Hex in debug
CMP ALD ;test for line feed
JE ;if line feed exit loop
MOV SIAL ;save character to array
INC SI ;increment byte array pointer to save next char
JMP ;JMP TO WAITFORLF TOP
MOV BX ;set base of stored array data
SUB SI ;find number of entries
MOV CXSI
MOV AH ;write command WRITELOOPTOP
MOV DL; get byte for write command
INT ;write to monitor
INC BX ;increment byte array pointer
DEC CX ;down count loop counter when exit
JNZ ; JUMP TO WRITELOOPTOP
INT
Save the program either mark and copy the program in windows then paste to notepad,
Run the code by typing for go
The message may repeat on the same line and overwrite itself
If it does add the following code before displaying the message back to cause it to display on the next line
MOV AH ;write monitor command
MOV DL; carriage return
INT ;write to monitor
Reverse the pattern that was input to the monitor so is prints out backwards in debug first then translate the code into the MASM template of part
For full credit, fix the code by using the SI register for the down count loop counter instead of CX then use to point to the data this will save having two down count registers in your code
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started