org 0100h

mov dx, msg
mov ah, 09h
int 21h
mov ah, 4ch
int 21h
msg db 'Hello Wold! \nThis is my first program using Assembly', '$'

Hi guys,

I'm learning Assembly Programming using NASM and had a question. Would it be possible to break lines in Assembly?

Say for instance I would like to display the line above as.

Hello World!

This is my
first program
using Assembly

Thanks in advance for the help.

Yes, insert 0ah where you want the line to break.

org 0100h

mov dx, msg
mov ah, 09h
int 21h
mov ah, 4ch
int 21h
msg: db 'Hello World!',0ah,0ah,'This is my',0ah,'first program',0ah,'using Assembly$'

Thank you thines01 :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.