I was trying to store a few strings in my assembly, and use WriteString to print out on the screen. However, I only call one of the strings, it shows up all of them in one s
The strings have to be null terminated -- you have to indicate the zero value for the last byte. You may also need to indicate carriage returns and line feeds if you want the output routine to put the string on it's own line.
You do this by specifying:
nullstr db 0
errorMessage db 'critical error', 10, 13, 0
warningMessage db 'warning', 10, 13, 0
goodbyeWorld1 db 'Goodbye World.', 0
goodbyeWorld2 db 'Goodbye World.'
endline db 10, 13, 0
The endline
string would work on the principle that since goodbyeWorld2
is not null terminated, it would display the ascii codes for carriage feed and line return, so Goodbye World.
would appear on it's own line in the shell output. However since goodByeWorld1
is null-terminated it would not appear on it's own line and output would continue at the final '.' character displayed.