NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: nobody on March 17, 2008, 10:17:35 PM

Title: print a string
Post by: nobody on March 17, 2008, 10:17:35 PM
I want to print a string.
whats wrong with this code?

segment .data
msg db "abcdefg$"


segment .text
global _prog

_prog:
mov dx, msg
mov ah, 09h
int 21h
ret

pls help
Title: Re: print a string
Post by: nobody on March 17, 2008, 11:17:21 PM
Missing "org 100h"

Best,
Frank
Title: Re: print a string
Post by: nobody on March 17, 2008, 11:50:24 PM
Or... is this supposed to emit a linkable object? "global" would suggest so (doesn't do anything in "-f bin" mode)...

If so:

mov ax, data
mov ds, ax

at the beginning of your code. If it's for Linux, there's a whole lot more than that wrong with it! :) Ya really gotta tell us more about what you're trying to do, and what's happening instead...

Best,
Frank
Title: Re: print a string
Post by: nobody on March 18, 2008, 06:51:37 AM
no its for windows
its not working.
the output is something like...
            ¶?? ??¶ ? ??        ?               ?!?
t???F????                                        ?  ?¶ ?ëÍ???!<
i just want to print the string
pls help