I'm learning assembly language and I have a doubt. I'm programming a simple "hello world" with this code:
.model small
.stack
.data
message db 'Hello world! $'
.code
start:
mov dx,@data
mov ds.dx
lea dx,message
move ah,09h
int 21h
mov ax,4c00h
int 21h
end start
I'm assuming that message db 'Hello world! $'
works like a String, and now I'm wondering if it is possible to add something like \n to make the output in two lines, like this message db 'Hello\nworld! $'
. Is that possible?
message db 'Hello world! $'
Many assemblers will not interpret the \n embedded in a string.
Most assemblers will accept the following to insert a newline:
message db 'Hello',13,10,'world!',13,10,'$'
The value 13 is carriage return, and the value 10 is linefeed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With