# A little problem with assembly

## Recommended Posts

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

##### Share on other sites
nasm? is this like regular assembley

##### Share on other sites
If it's a COM executable (which it _should_ be), then did you remember to ORG 0x100 at the top?

##### Share on other sites
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.

##### Share on other sites
Quote:
 Original post by AzriocIf 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 :)

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628385
• Total Posts
2982391

• 10
• 9
• 15
• 24
• 11