Author Topic: print a string  (Read 8435 times)

nobody

  • Guest
print a string
« 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

nobody

  • Guest
Re: print a string
« Reply #1 on: March 17, 2008, 11:17:21 PM »
Missing "org 100h"

Best,
Frank

nobody

  • Guest
Re: print a string
« Reply #2 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

nobody

  • Guest
Re: print a string
« Reply #3 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