Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi-line strings NASM

Tags:

string

nasm

I feel like this is a dumb question, but somehow I can't find the answer. I just want a multi-line string (kind of like """this""" in Python) in NASM. I feel stupid for asking this.

Thanks.

like image 864
R-Rothrock Avatar asked Sep 20 '26 11:09

R-Rothrock


1 Answers

NASM doesnt support multi-line strings, but you can do this to make your strings cleaner:

; instead of this:
string1: db "Hello", 0xA, "World", 0xA, "!!!!!", 0xA, 0

; you can define the lines separately 
; don't forget 0xA from the end of the line
string2: db "Hello", 0xA
         db "World", 0xA
         db "!!!!!", 0xA, 0

I hope it helped.

like image 54
Berc07 Avatar answered Sep 25 '26 01:09

Berc07



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!