Results 1 to 6 of 6

Thread: how to print a new line?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Location
    Some where on Earth
    Posts
    98

    how to print a new line?

    Hi guys!

    Im starting off with a super simple program that prints only words on the screen. I want to print 2 words and seperate each word in another line. The command for c is "\n" and im not sure what is the command for assembly. What is the command for printing a new line? I'll paste part of my code here...

    Code:
                    mov ah,09h
    		mov dx,offset hello_message
    		int 21h
    
    		mov ah,09h
    		mov dx,offset hello_message2
    		int 21h
    Thanks!
    Anime is what i LIVE for, BREATH for, and DIE for!

  2. #2
    Hyperactive Member Maven's Avatar
    Join Date
    Feb 2003
    Location
    Greeneville, TN
    Posts
    322

    Re: how to print a new line?

    Quote Originally Posted by RedDevil
    Hi guys!

    Im starting off with a super simple program that prints only words on the screen. I want to print 2 words and seperate each word in another line. The command for c is "\n" and im not sure what is the command for assembly. What is the command for printing a new line? I'll paste part of my code here...

    Code:
                    mov ah,09h
    		mov dx,offset hello_message
    		int 21h
    
    		mov ah,09h
    		mov dx,offset hello_message2
    		int 21h
    Thanks!
    look up the asci code =)

    hint below umm lets say 30
    Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Location
    Some where on Earth
    Posts
    98

    Re: how to print a new line?

    Quote Originally Posted by Maven
    look up the asci code =)

    hint below umm lets say 30
    I have no idea what are you trying to say Maven >_<! I'm still learning very slowly.
    Anime is what i LIVE for, BREATH for, and DIE for!

  4. #4
    Hyperactive Member Maven's Avatar
    Join Date
    Feb 2003
    Location
    Greeneville, TN
    Posts
    322

    Re: how to print a new line?

    Quote Originally Posted by RedDevil
    I have no idea what are you trying to say Maven >_<! I'm still learning very slowly.
    You would print 0DH to screen.

    You could also use it in you're variable like:

    myvar db "Some message", 0DH
    Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde

  5. #5
    Hyperactive Member Maven's Avatar
    Join Date
    Feb 2003
    Location
    Greeneville, TN
    Posts
    322

    Re: how to print a new line?

    Quote Originally Posted by Maven
    You would print 0DH to screen.

    You could also use it in you're variable like:

    myvar db "Some message", 0DH
    0DH which is 13 in ascii, is the number for the newline charecter. Print it to screen anytime you want to have a newline.
    Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde

  6. #6
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: how to print a new line?

    Don't you need both char 13 and 10? (i'm a n00b at ASM myself )

    13 is CR (Carriage Return)
    10 is LF (Line Feed)
    I don't live here any more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width