flat assembler
Message board for the users of flat assembler.
Index
> Linux > Variable Strings |
Author |
|
revolution 06 Feb 2023, 20:55
The length of msg_1 is not correct. Something like this might help.
Code: 47 │ msg1 db NL,NL,"Hello, " 50 │ msg1_len = $-msg1 49 │ 48 │ msg2 db "there!",NL,NL 51 │ msg2_len = $-msg2 |
|||
06 Feb 2023, 20:55 |
|
asmblr_88 07 Feb 2023, 04:32
I tried it and it worked. Thanks revolution!
I am wondering about how string interpolation or how placeholders work (like %d in C for example), because I am trying to understand how printf works. Is it all concatenation of strings? Does the assembler have to convert the numbers into strings? Thanks again! I hope you have a great day! |
|||
07 Feb 2023, 04:32 |
|
revolution 07 Feb 2023, 04:36
The strings are just laid in memory joined together. If you have a hex dump program you can examine the file to see the result.
|
|||
07 Feb 2023, 04:36 |
|
asmblr_88 07 Feb 2023, 10:15
That makes sense.
Thanks again revolution! _________________ asmblr_88 |
|||
07 Feb 2023, 10:15 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.