flat assembler
Message board for the users of flat assembler.

Index > Windows > Assembly language for beginner

Goto page Previous  1, 2, 3
Author
Thread Post new topic Reply to topic
Stefx



Joined: 24 Apr 2020
Posts: 20
Stefx
Hi again,
1) I would like ask why program execute both strings if I only pushed "name1Str" to be printed ?

2) How can I make that string, could be printed few lines lower, keeping empty space upper?


Description:
Filesize: 96.76 KB
Viewed: 183 Time(s)

prt1.jpg


Post 29 Aug 2020, 13:43
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17639
Location: In your JS exploiting you and your system
revolution
Your string needs to be terminated with a zero byte:
Code:
my_string db 'test',0 ; zero terminated    
Post 29 Aug 2020, 14:11
View user's profile Send private message Visit poster's website Reply with quote
Stefx



Joined: 24 Apr 2020
Posts: 20
Stefx
Ohh, thanks.
Do you know maybe how about second point?
How to tell "print this sting few lines lower?"
Post 29 Aug 2020, 17:52
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 814
Roman
Maybe:
down1 db 13,10,0
down5 db 5 dup(13,10)
db 0

push down5
Call [printf]
Post 29 Aug 2020, 18:23
View user's profile Send private message Reply with quote
Stefx



Joined: 24 Apr 2020
Posts: 20
Stefx
Thanks Roman it's works.
btw. what's mean this numbers? 10, 13, 0.
I saw if I put another number like 11, 12, 0. On my string I got some extra symbol or any kind of weird signs.
Post 29 Aug 2020, 18:55
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17639
Location: In your JS exploiting you and your system
revolution
See here for the meaning of the control characters.
https://ascii.cl/control-characters.htm

13 = CR, 10 = LF, etc.
Post 29 Aug 2020, 22:31
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.