Why is it when I output two strings to the console, the just overwrite each other?
The code is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Message db "Line tests!",10,13,"$"
Message2 db "Skipped a line!",10,13,"$"
mov ah,09
mov dx,offset Message
int 21h
mov ah,09
mov dx,offset Message2
int 21h
exit:
mov ah,4ch
mov al,00
int 21h
I thought including the 'line feed' and 'carriage return' characters in the strings was supposed to cause a break to a new line? Or are these for something completely different? I'm very early in learning this, so sorry if this is a 'duh' question.
Not too familiar with what you are doing exactly, but it looks like it really wanted the hex values for the characters. '0A' and '0D' are the hex values for 10 and 13, respectively, which are, as you know, the LF and CR characters.
I don't think the assembler cares whether you express a numerical value as a decimal or as a hexadecimal - most assemblers automatically assume a value is decimal unless it has the 'h' suffix.
And I am pretty sure you have to put carriage return first, and THEN the line feed. Message db "Line tests!",13,10,"$"
It is traditionally CR-LF, but order doesn't really matter.
Have you checked to make sure you are using the DOS I/O subfunction properly?
(Or that you are running a version of Windows that still supports it properly?)