MY DOLLAR SIGN PROBLEM AND MEANING OF DB
I don't know what's wrong with my code here:
.MODEL TINY
.CODE
ORG 0100H
MAIN:
JMP START
STRING1 DB "Enter Your Name: $"
STRING2 DB "HELLO$"
STRING3 DB 30, ?, 29 DUP (?)
START:
; =========== SHOW "ENTER YOUR NAME"
MOV AH, 09H
MOV DX, OFFSET STRING1
INT 21H
; =========== ASK THE NAME
MOV AH, 0AH
MOV DX, OFFSET STRING3
INT 21H
; =========== SHOW "HELLO"
MOV AH, 09H
MOV DX, OFFSET STRING2
INT 21H
; =========== THIS IS WHERE THE PROBLEM STARTS
MOV AH, 09H
MOV DX, OFFSET STRING3
INT 21H
;=========== TERMINATE THE PROGRAM
INT 20H
END MAIN
MAIN
The output sound be:
Enter Your Name: Paul Mark
HELLO Paul Mark
But it prints out gibberish things (much like "memory things"). But if put a dollar sign at the end "Paul Mark$", it will not show that gibberish things but the HELLO would overwrite the "Enter Your Name: " PLUS adding two symbols and then the name.
1.) Is there any way so that I don't need anymore to put a Dollar Sign at the end when inputting?
2.) What is that two symbols after the HELLO message?
3.) Is there any good Debugger that is compatible with Windows XP? Coz I tried to use Turbo Debugger 5.0, but it gave me Windows errors.
MEANING OF DB
And this:
STRING3 DB 30, ?, 29 DUP (?)
Then followed a code like this:
MOV AH, 09H
MOV DX, OFFSET STRING3
INT 21H
But I don't what's the whole "STRING3 DB 30, ?, 29 DUP (?)" means. All I know is that when I increase 30 & 29, my variable size increases.
4.) Why DB? They said it means Define Byte, but I'm inputting more than one byte.
5.) Why it needs three things? 30, ?, 29
6.) What is the meaning of "?"?
7.) What DUP do? DUP, they said it means DUPLICATE, but what things do I need to duplicate?
I need also a thorough explanation about DB...
[Edited by - Fruny on October 21, 2005 9:38:33 PM]