根据this site,命令行的长度存储在DS:80h(单字节),而实际命令行本身从DS:81h开始。下面是从那篇文章打印命令行一些示例代码:
; ----------------------------------------------------------------------------
; echo.asm
;
; Echoes the command line to standard output. Illustrates DOS system calls
; 40h = write to file, and 4ch = exit process.
;
; Processor: 386 or later
; Assembler: MASM
; OS: DOS 2.0 or later only
; Assemble and link with "ml echo.asm"
; ----------------------------------------------------------------------------
.model small
.stack 64 ; 64 byte stack
.386
.code
start: movzx cx,byte ptr ds:[80h] ; size of parameter string
mov ah, 40h ; write
mov bx, 1 ; ... to standard output
mov dx, 81h ; ... the parameter string
int 21h ; ... by calling DOS
mov ah, 4ch
int 21h
end start
你在打什么实体?另一个程序? BIOS?汇编程序如何期望传递参数? – wallyk
我在MS-DOS外壳上调用shutdown.com。就像我把其他程序称为MOVE,FORMAT,FDISK一样。 – MendaxRox
'shutdown.com'是命令行程序吗?也就是说,要从命令行使用它,你能输入'shutdown -r'吗? – wallyk