Error getting a command line parameter in the assembler

xiaoxiao2021-03-05  22

I want to get the parameters in the command line in the DOS assembler.

I checked some information on the Internet. Probably it is said that the value of 80h in the DS segment is the length of the parameters.

I wrote the following small test program.

The length of the parameter can be obtained, but it is also possible to obtain parameters.

. Model small .stack 100h .datamsg db 13, 10, '$' .codestart: Mov Ax, @ Data MoV DS, AX; ------------------- --------- Mov Si, ES ADD SI, 80H MOV DL, [Si] MOV AH, 02H Add DL, 30H INT 21H

LEA DX, MSG MOV AH, 09H INT 21h; ------------------------------; below is the parameters A character's code can not normalize Add Si, 2 MOV DL, [Si] Mov Ah, 02H INT 21H; ---------------------------------------------------------------------------------- ------- Mov Ah, 4CH INT 21h End Start

转载请注明原文地址:https://www.9cbs.com/read-37920.html

New Post(0)