stringassemblyx86dosmasm

what does '$' sign represent in x86 DOS assembly?


STR1 DB "ENTER YOUR STRING : $"
STR2 DB "YOUR STRING IS : $"
INSTR1 DB 30 DUP("$")  

Can someone tell me what does '$' sign mean in the above example? I know that DUP operator causes value to be repeated number of times. For example,

DELTA DB 212 DUP (?)

created an array of 212 uninitialized bytes. Similarly,

GAMMA DW 100 DUP (0)

sets up an array of 100 words, with each entry Initialized to O. But i am confused that would does the INSTR1 DB 30 DUP("$") mean?


Solution

  • '$' marks end of ASCII stream in MS-DOS int 21h call AH = 09, print string; it's substitute in C would be ASCII zero.

    Without more context, I would expect user input to be written over INSTR1, in which case the input (with length between 0 and 29 inclusive) would be automatically terminated by the dollar sign (and thus ready for printing with int 21h).