⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 param.asm

📁 介绍用Java解析网络数据的三种特殊方法
💻 ASM
字号:
; This sample prints out the command
; line parameters.
; In DOS you simply add this line
; after an executable:
; param.com my parameters
; In emulator you should set
; them by selecting "Set command line paramters"
; from "File" menu of emulator window.

#make_COM#

ORG     100h


; address of command line:
MOV     SI, 80h


; copy command line to our buffer:
XOR     CX, CX          ; zero CX register.
MOV     CL, [SI]        ; get command line size.

LEA     DI, buffer      ; load buffer address to DI.

CMP     CX, 0           ; CX = 0 ?
JZ      no_param        ; then skip the copy.

INC     SI              ; copy from second byte.
next_char:
MOV     AL, [SI]
MOV     [DI], AL
INC     SI
INC     DI
LOOP    next_char

; set '$' sign in the end of the buffer:
MOV     BYTE PTR [DI], '$'

; print out the buffer:
LEA     DX, buffer
MOV     AH, 09h
INT     21h

JMP     exit    ; skip error message.

no_param:
; print out the error message:
LEA     DX, msg
MOV     AH, 09h
INT     21h
JMP     exit

; exit here:
exit:
RET

buffer DB 30 dup (' ')
msg DB 'No command line parameters!', 13, 10, '$'

END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -