I am running under Win95 on a Pentium using MASM. I have the following code:
<code>
.model small
.stack 0100h
.data
inputstring label byte
maxkeys db 80
charsinput db ?
buffer db 80,dup(0)
crlf db 0Dh,0Ah,'$'
.code
main proc
.startup
mov AH,0Ah ;get an input string
mov DX,offset inputstring ;place it in mem
int 21h
mov AH,9 ;output a
mov DX,offset crlf ;CR/LF combination
int 21h
<<<need help here>>>
mov AH,9 ;output the buffer
mov DX,offset buffer ;but....it's not terminated
int 21h
.....and so on....
</code>
The problem is that I need to stuff a '$' into buffer at the end of the string so that function 09h of int 21h will know where to terminate the string. If I enter a "$" at the end of the string during the 0Ah call, the program behaves well. My real problem is that I don't know how to get the contents of 'charsinput' so that I can add it to the address of buffer. So the real question is:
How do I refer to the contents of a pointer labeled in the .data segment?
Thanks for your help,
S
Simplicus
**186,000 miles per second. . . not just a good idea, it's the LAW!
<code>
.model small
.stack 0100h
.data
inputstring label byte
maxkeys db 80
charsinput db ?
buffer db 80,dup(0)
crlf db 0Dh,0Ah,'$'
.code
main proc
.startup
mov AH,0Ah ;get an input string
mov DX,offset inputstring ;place it in mem
int 21h
mov AH,9 ;output a
mov DX,offset crlf ;CR/LF combination
int 21h
<<<need help here>>>
mov AH,9 ;output the buffer
mov DX,offset buffer ;but....it's not terminated
int 21h
.....and so on....
</code>
The problem is that I need to stuff a '$' into buffer at the end of the string so that function 09h of int 21h will know where to terminate the string. If I enter a "$" at the end of the string during the 0Ah call, the program behaves well. My real problem is that I don't know how to get the contents of 'charsinput' so that I can add it to the address of buffer. So the real question is:
How do I refer to the contents of a pointer labeled in the .data segment?
Thanks for your help,
S
Simplicus
**186,000 miles per second. . . not just a good idea, it's the LAW!