News:

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

No Commandline?

Started by vasant, April 11, 2006, 08:49:18 PM

Previous topic - Next topic

vasant

How to check is have commandline string for prgram .Com and .Exe ?

Thank you.

Tedd

if (byte ptr [DS:80h] != 00h) there_are_commandline_parameters
No snowflake in an avalanche feels responsible.

minzkn


; http://minzkn.wowdns.com:2744/phpBB2/viewtopic.php?t=79&start=0&postdays=0&postorder=asc&highlight=startup

.386

                ASSUME CS:CODE, DS:CODE, ES:NOTHING, SS:STACK_AREA
CODE            SEGMENT PARA PUBLIC USE16 'CLASS_CODE'
L_STARTUP:
                ; DS:0080H - PSP area : DS세그먼트는 실행시 값이 넘겨져 옵니다.
                MOV SI, 0080H
               
                CLD
                LODSB

                XOR CH, CH
                MOV CL, AL
L_PRINT_LOOP:
                JCXZ L_EXIT
                LODSB
                MOV DL, AL
                MOV AH, 02H
                INT 21H
                DEC CX 
                JMP L_PRINT_LOOP           
L_EXIT:                 
                MOV AX, 4C00H
                INT 21H
                HLT
                JMP $
CODE            ENDS

                ASSUME DS:DATA
DATA            SEGMENT WORD PUBLIC USE16 'CLASS_DATA'
DATA            ENDS

                ASSUME SS:STACK_AREA
STACK_AREA      SEGMENT PARA STACK USE16 'CLASS_STACK'
                DB 4096 DUP (?)
STACK_AREA      ENDS
                END L_STARTUP