A little problem with assembly

Started by
3 comments, last by Xtremehobo 19 years, 9 months ago

mov dx,Text		; DS:DX points to message
mov ah,9 			; function 9 - display string
int 21h 			; all dos service

mov ax,4C00h  		; exit to dos
int 21h

Text db "This is some text.$"
If I know what I'm doing (which I'm not sure), this little bit of assembly, assembled using nasm and outputted as an exe, should display "This is some text." in the dos shell when I execute it. It prints out a few lines of garbage before it displays my text though. By the way, I'm just assembling it like this: nasm test.asm
pixelwrench.com | [email="matt[nospam]@pixelwrench[nospam]com"]email[/email] lethalhamster: gamedev keeps taking my money, but im too lazy to not let them
Advertisement
nasm? is this like regular assembley
If it's a COM executable (which it _should_ be), then did you remember to ORG 0x100 at the top?
Ra
it looks like your missing a zero (asm doesn't terminate your strings for you) but I doubt that is what's causing your problem.
Quote:Original post by Azrioc
If it's a COM executable (which it _should_ be), then did you remember to ORG 0x100 at the top?


Heh, guess it should be a com.. I added the org 0x100 at the top and now it works :)
pixelwrench.com | [email="matt[nospam]@pixelwrench[nospam]com"]email[/email] lethalhamster: gamedev keeps taking my money, but im too lazy to not let them

This topic is closed to new replies.

Advertisement