News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Command line execution of Programs doesn't work

Started by sam, October 16, 2010, 08:37:02 AM

Previous topic - Next topic

sam

Dear All,

I'm trying to print messages through command line execution of programs. Sample programs from MASM32 compiles and executes but do not print any message using INT 21h etc. Please help.

Regards,
SAM.

Neil

INT 21h is 16 bit code. Some code examples of what you are trying to do would get a better response.

Vortex

Hi sam,

The masm32 static library masm32.lib provides Command Line Procedures. Have a look at :

\masm32\help\masmlib.chm

jj2007

This snippet works, but:
- assembler command line is ml.exe %1 /nologo /omf   ; /coff won't work with recent versions of ml.exe
- you need link16.exe

.Model small
.Stack 512

.Data
MsgText db "Hello 16-bit World", 13, 10, 10
db "Hit any key to quit ...", 13, 10, "$"

.Code

_main proc FAR

; set the DS register to DGROUP (will fail with some Masm versions - use ml 6.15 or higher, or JWasm)
mov ax, @DATA
mov ds, ax

; display the message
mov dx, offset MsgText
mov ah, 9
int 21h

; wait for a key
mov ah, 0
int 16h

; the DOS equivalent to ExitProcess
mov ax, 4C00h
int 21h

_main endp

end _main