flat assembler
Message board for the users of flat assembler.

Index > Main > Umm... Null strings?

Author
Thread Post new topic Reply to topic
1800askgeek



Joined: 04 Apr 2004
Posts: 10
Location: Hawaii
1800askgeek
Help plz...

How can I print use a null terminated string instead of a '$' ending string in FASM?

Yeah... I know this is a n00b question, but you gotta start somewhere... Embarassed
Post 08 May 2004, 05:34
View user's profile Send private message Visit poster's website AIM Address Reply with quote
coconut



Joined: 02 Apr 2004
Posts: 326
Location: usa
coconut
print to command prompt?
Post 08 May 2004, 06:11
View user's profile Send private message Reply with quote
1800askgeek



Joined: 04 Apr 2004
Posts: 10
Location: Hawaii
1800askgeek
nvrmnd I figured it out. just use a loop and a conditional and print it with ax=0200h int 21h.
Post 08 May 2004, 07:10
View user's profile Send private message Visit poster's website AIM Address Reply with quote
ShortCoder



Joined: 07 May 2004
Posts: 105
ShortCoder
Ah, I was gonna say;)

Yeah, it's all in the function you're going to use (I figured you were DOS programming because I remember tons of example DOS asm progs used to use $ in their strings as well because the particular OS-function called required it as end of string and if you wanted something else you needed use a different function;))
Post 08 May 2004, 08:45
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
how about
Code:
db 'string',0,'$'    


how does DOS beheave when outputting 0 character?
Post 08 May 2004, 17:21
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
ShortCoder



Joined: 07 May 2004
Posts: 105
ShortCoder
vid wrote:
how about
Code:
db 'string',0,'$'    


how does DOS behave when outputting 0 character?


Are you thinking C-string behaviour maybe?

No, the common DOS print text function expects a $ on the end of the string (as terminator) which makes it so that, if the character you wish to output is the $ character, you'll need to use a different function to get it up there;)

I'd imagine DOS would print out 0 as a blank space but you can try it if you want?
Post 08 May 2004, 21:42
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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.