Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write in assembly code? code INSTRING, reads in a string from the keyboard. Befo

ID: 3717776 • Letter: W

Question

 write in assembly code? code   INSTRING, reads in a string from the keyboard. Before the call, the caller must supply: 
          R0: address of new string, 
          R1: size of new storage (which you may ignore) The routine provides no prompt. 
 It echoes chars as they're typed. Back space is NOT required to work properly. String entry stops on ENTER. You may not write trap calls as part of your solution to this function. You have to program your own I/O instead and use polling correctly. On return, only register changed is R7. 

Explanation / Answer

.data ; Data Segment

address DB ? ; variable address is the variable to contain the String's address

.code ; Code Segment

MOV AX,@data;

MOV DS,AX

MOV DX, OFFSET address; copies address value to DX for display

BL INSTRING ;Jump to Instring

INSTRING PROC

MOV AH,3FH;

INT 21H;

MOV AH,4CooH;

INT 21H;

ENDP

END