Category : Assembly Language Source Code
Archive   : TASMSWAN.ZIP
Filename : SHOWPARM.ASM

 
Output of file : SHOWPARM.ASM contained in archive : TASMSWAN.ZIP
%TITLE "Display DOS command-line parameters"

IDEAL
DOSSEG
MODEL small
STACK 256

DATASEG

exitCode db 0
string db 20 DUP (?)
s1 db 'Number of parameters = ', 0


CODESEG

;---------- from PARAMS.obj
EXTRN ParamCount:proc, GetParams:proc, GetOneParam:proc

;---------- from BINASC.obj, STRINGS.obj, STRIO.obj
EXTRN BinToAscDec:proc, NewLine:proc, StrWrite:proc
EXTRN BinToAscHex:proc, StrUpper:proc

Start:
mov ax,@data
mov es,ax
call GetParams
call NewLine
mov di,offset s1
call StrWrite
call ParamCount
mov ax,dx
mov cx,1
mov di, offset string
call BinToAscDec
call StrWrite
call NewLine
xor cx,cx
@@10:
call ParamCount
cmp cx,dx
je Exit
push cx
call GetOneParam
call StrUpper
call StrWrite
call NewLine
pop cx
inc cx
jmp @@10
Exit:
mov ah,04Ch
mov al,[exitCode]
int 21h

END Start


  3 Responses to “Category : Assembly Language Source Code
Archive   : TASMSWAN.ZIP
Filename : SHOWPARM.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/