mov bx, offset argv ;↓第一引数の処理 SWCHR: add bx,1 cmp byte ptr [bx],'/' je SWCHR cmp byte ptr [bx],'-' je SWCHR cmp byte ptr [bx],'D' je OP_D cmp byte ptr [bx],'d' je OP_D cmp byte ptr [bx],'P' je OP_P cmp byte ptr [bx],'p' je OP_P cmp byte ptr [bx],'F' je OP_F cmp byte ptr [bx],'f' je OP_F cmp byte ptr [bx],'?' je USAGE cmp byte ptr [bx],'H' je USAGE cmp byte ptr [bx],'h' je USAGE cmp byte ptr [bx],' ' ;スペースなら第二引数の先頭 jb OPERR ; jne USAGE ;それ以外の文字ならHELP sp2: add bx,1 cmp byte ptr [bx],' ' ; jb OPERR ; je sp2 mov FILE2,word ptr bx jmp normal
OP_D: mov OPT_D,1 ; "" jmp SWCHR OP_P: mov OPT_P,1 ; full Pass jmp SWCHR OP_F: mov OPT_F,1 ; Filename opt2 jmp SWCHR OPERR: cmp OPT_F,0 ; 引数が無い je normal
USAGE: print help_usage newline retms ;----------------------------------------------------------------- ;get current disk normal: mov ah,19h int 21h ;-> disk num in AL add al,'A' ;num2char mov BUFF_DP, byte ptr al ;get current directory (LFN) ---- mov dl,0 mov ax,7147h mov si,offset BUFF_FP ;BUFF_DP+3 int 21h cmp ax,7100h jne win
mov ah,47h mov al,byte ptr BUFF_DP add al,1 ;AL num different! A=0 (19h) & A=1 (47h) mov dl,al mov si,offset BUFF_FP ;BUFF_DP+3 int 21h jmp dos
win: mov OPT_W,1 ;check & flag set ---- dos: cmp BUFF_DP[3],0 je FIND1 mov FLAG, byte ptr 1 ;if root 0 not root 1(=add '\')
;findfirst ---- FIND1: mov ax,714eh mov dx,offset FILE1 ;'*.*' cmp OPT_F,0 je FI0 mov word ptr dx,FILE2 ;opt2 FI0: call SET ;set cx, si, di cmp OPT_W,0 jne FI1 mov ah,4eh FI1: int 21h jc BYE ;not found? mov HAND, word ptr ax ;save handle num call print_fn ;print drive+dir
;findnext ---- FINDN: mov bx,HAND mov ax,714fh call SET cmp OPT_W,0 jne FN1 mov ah,4fh FN1: int 21h jc BYEBYE call print_fn jmp FINDN
ERR: print ERR_MSG1 ;not win32 retms
BYE: print ERR_MSG2 ;file not found BYEBYE: mov bx,HAND ;HANDLE CLOSE mov ax,71a1h int 21h retms
; --- print1 subroutines --- PRI: cmp [bx],byte ptr 0 je FIN putchar [bx] inc bx jmp PRI FIN: ret
; --- print filename --- print_fn: cmp OPT_D,0 ;print drive+dir je B0 putchar '"' B0: cmp OPT_P,0 je B1 mov bx,offset BUFF_DP call PRI cmp FLAG,0 je B1 putchar '\' B1: mov bx,offset BUFF_F+2ch call PRI cmp OPT_D,0 je B2 putchar '"' B2: newline ret
OPT_W db 0 ;DOS 0 win 1 OPT_P db 0 ;full Path flag OPT_F db 0 ;Filename opt2 flag OPT_D db 0 ;double quote flag FLAG db 0 ;if root 0 not root 1(=add '\') HAND dw ? ;handle FILE1 db '*.*',0 FILE2 dw 0 ;opt2 filename BUFF_DP db ?,':\' BUFF_FP db 300 dup (0) BUFF_F db 320 dup (0) ERR_MSG1 db 'Run on Windows','$' ERR_MSG2 db 'File Not Found','$' help_usage db 'BLTA.COM file lister for all DOS Ver0.41k',CR,LF db ' usage BLTA opt filename',CR,LF db ' opt D or d Double quote',CR,LF db ' opt P or p full Path',CR,LF db ' opt F or f File name opt',CR,LF db ' opt H or h or ? Help usage',CR,LF db '$'
pend
- No.52 - [コメント元:47] [リストへもどる]
pre 51: blta.com ver0.40k all DOS版のish
投稿者:konno 2012/01/04(水) 20:43 50 番 konno さんへのコメント
<<< blta.com for MS-DOS ( use ish ) [ 27 lines ] >>> 57--- 省略されました。---- [全文表示]
USAGE: print help_usage newline retms ;----------------------------------------------------------------- ;get current disk normal: mov ah,19h int 21h ;-> disk num in AL add al,'A' ;num2char mov BUFF_DP, byte ptr al ;get current directory (LFN) mov dl,0 mov ax,7147h mov si,offset BUFF_FP ;BUFF_DP+3 int 21h cmp ax,7100h jne win
mov ah,47h mov al,byte ptr BUFF_DP add al,1 ;AL num different! A=0 (19h) & A=1 (47h) mov dl,al mov si,offset BUFF_FP ;BUFF_DP+3 int 21h jmp dos
win: mov OPT_W,1 ;check & flag set ---- dos: cmp BUFF_DP[3],0 je FIND1 mov FLAG, byte ptr 1 ;if root 0 not root 1(=add '\')
;findfirst ---- FIND1: mov ax,714eh mov dx,offset FILE1 ;'*.*' cmp OPT_F,0 je FI0 mov word ptr dx,FILE2 ;opt2 FI0: call SET ;set cx, si, di cmp OPT_W,0 jne FI1 mov ah,4eh FI1: int 21h jc BYE ;not found? mov HAND, word ptr ax ;save handle num call print_fn ;print drive+dir
;findnext ---- FINDN: mov bx,HAND mov ax,714fh call SET cmp OPT_W,0 jne FN1 mov ah,4fh FN1: int 21h jc BYEBYE call print_fn jmp FINDN
ERR: print ERR_MSG1 ;not win32 retms
BYE: print ERR_MSG2 ;file not found BYEBYE: mov bx,HAND ;HANDLE CLOSE mov ax,71a1h int 21h retms
; --- print1 subroutines --- PRI: cmp [bx],byte ptr 0 je FIN putchar [bx] inc bx jmp PRI FIN: ret
; --- print filename --- print_fn: cmp OPT_D,0 ;print drive+dir je B0 putchar '"' B0: cmp OPT_P,0 je B1 mov bx,offset BUFF_DP call PRI cmp FLAG,0 je B1 putchar '\' B1: mov bx,offset BUFF_F+2ch call PRI cmp OPT_D,0 je B2 putchar '"' B2: newline ret
OPT_W db 0 ;DOS 0 win 1 OPT_P db 0 ;full Path flag OPT_F db 0 ;Filename opt2 flag OPT_D db 0 ;double quote flag FLAG db 0 ;if root 0 not root 1(=add '\') HAND dw ? ;handle FILE1 db '*.*',0 FILE2 dw 0 ;opt2 filename BUFF_DP db ?,':\' BUFF_FP db 300 dup (0) BUFF_F db 320 dup (0) ERR_MSG1 db 'Run on Windows','$' ERR_MSG2 db 'File Not Found','$' help_usage db 'BLTA.COM file lister for all DOS Ver0.40k',CR,LF db ' usage BLTA opt filename',CR,LF db ' opt D or d Double quote',CR,LF db ' opt P or p full Path',CR,LF db ' opt F or f File name opt',CR,LF db ' opt H or h or ? Help usage',CR,LF db '$'
pend
- No.50 - [コメント元:47] [リストへもどる]
pre 49: blta.com ver0.31k の ish
投稿者:konno 2012/01/04(水) 12:36 48 番 konno さんへのコメント
<<< blta.com for MS-DOS ( use ish ) [ 27 lines ] >>> 57--- 省略されました。---- [全文表示]
USAGE: print help_usage newline retms ;----------------------------------------------------------------- ;get current disk normal: mov ah,19h int 21h ;-> disk num in AL add al,'A' ;num2char mov BUFF_DP, byte ptr al ;get current directory (LFN) mov dl,0 mov ax,7147h mov si,offset BUFF_DF ;BUFF_DP+3 int 21h cmp ax,7100h je ERR ;check & flag set cmp BUFF_DP[3],0 je FIND1 mov FLAG, byte ptr 1 ;if root 0 not root 1(=add '\')
;findfirst FIND1: mov ax,714eh mov dx,offset FILE1 cmp OPT_F,0 je FI0 mov word ptr dx,FILE2 FI0: call SET ;set cx, si, di int 21h jc BYE ;not found ; cmp ax,7100h ;error check ; je BYE ;print drive+dir mov HAND, word ptr ax ;save handle num cmp OPT_D,0 je FI_2 putchar '"' FI_2: cmp OPT_P,0 je A1 mov bx,offset BUFF_DP call PRI cmp FLAG,0 je A1 putchar '\' A1: ;print filename mov bx,offset BUFF_F+2ch call PRI cmp OPT_D,0 je FI_3 putchar '"' FI_3: newline ;findnext FINDN: mov bx,HAND mov ax,714fh call SET int 21h jc BYEBYE ;print drive+dir cmp OPT_D,0 je FN_2 putchar '"' FN_2: cmp OPT_P,0 je B1 mov bx,offset BUFF_DP call PRI cmp FLAG,0 je B1 putchar '\' ;print filename B1: mov bx,offset BUFF_F+2ch call PRI cmp OPT_D,0 je B2 putchar '"' B2: newline jmp FINDN
ERR: print ERR_MSG1 ;not win32 retms
BYE: print ERR_MSG2 ;file not found BYEBYE: mov bx,HAND ;HANDLE CLOSE mov ax,71a1h int 21h retms
PRI: cmp [bx],byte ptr 0 je FIN putchar [bx] inc bx jmp PRI FIN: ret
OPT_P db 0 ;full Path flag OPT_F db 0 ;Filename opt2 flag OPT_D db 0 ;double quote flag FLAG db 0 ;if root 0 not root 1(=add '\') HAND dw ? ;handle FILE1 db '*.*',0 FILE2 dw 0 ;opt2 filename BUFF_DP db ?,':\' BUFF_DF db 300 dup (0) BUFF_F db 320 dup (0) ERR_MSG1 db 'Run on Windows','$' ERR_MSG2 db 'File Not Found','$' help_usage db 'BLTA.COM file lister for Win32 DOS Ver0.31k 2012-01-04',CR,LF db ' usage BLTA opt filename',CR,LF db ' opt D or d Double quote',CR,LF db ' opt P or p full Path',CR,LF db ' opt F or f File name opt',CR,LF db ' opt H or h or ? Help usage',CR,LF db '$'
VTDOS|C:\VZ\T>BLTA.COM ? BLTA.COM file lister for Win32 DOS Ver0.30k 2012-01-02 usage BLTA opt filename opt D or d Double quote opt P or p full Path opt F or f File name opt opt H or h or ? Help usage
USAGE: print help_usage newline retms ;----------------------------------------------------------------- ;get current disk normal: mov ah,19h int 21h ;-> disk num in AL add al,'A' ;num2char mov BUFF_DP, byte ptr al ;get current directory (LFN) mov dl,0 mov ax,7147h mov si,offset BUFF_DF ;BUFF_DP+3 int 21h cmp ax,7100h je ERR ;check & flag set cmp BUFF_DP[3],0 je FIND1 mov FLAG, byte ptr 1 ;if root 0, if not root 1 (=add '\')
;findfirst FIND1: mov ax,714eh mov dx,offset FILE1 cmp OPT_F,0 je FI0 mov word ptr dx,FILE2 FI0: call SET ;set cx, si, di int 21h cmp ax,7100h ;error check je BYE ;print drive+dir mov HAND, word ptr ax ;save handle num cmp OPT_D,0 je FI_2 putchar '"' FI_2: cmp OPT_P,0 je A1 mov bx,offset BUFF_DP call PRI cmp FLAG,0 je A1 putchar '\' A1: ;print filename mov bx,offset BUFF_F+2ch call PRI cmp OPT_D,0 je FI_3 putchar '"' FI_3: newline ;findnext FINDN: mov bx,HAND mov ax,714fh call SET int 21h jc BYEBYE ;print drive+dir cmp OPT_D,0 je FN_2 putchar '"' FN_2: cmp OPT_P,0 je B1 mov bx,offset BUFF_DP call PRI cmp FLAG,0 je B1 putchar '\' ;print filename B1: mov bx,offset BUFF_F+2ch call PRI cmp OPT_D,0 je B2 putchar '"' B2: newline jmp FINDN
ERR: print ERR_MSG1 retms
BYE: print ERR_MSG2 BYEBYE: mov bx,HAND ;HANDLE CLOSE mov ax,71a1h int 21h retms
PRI: cmp [bx],byte ptr 0 je FIN putchar [bx] inc bx jmp PRI FIN: ret
OPT_P db 0 ;full Path flag OPT_F db 0 ;Filename opt flag OPT_D db 0 ;double quote flag FLAG db 0 ;if root 0, if not root 1 (=add '\') HAND dw ? ;handle FILE1 db '*.*',0 FILE2 dw 0 ;opt filename BUFF_DP db ?,':\' BUFF_DF db 300 dup (0) BUFF_F db 320 dup (0) ERR_MSG1 db 'Run on Windows','$' ERR_MSG2 db 'File Not Found','$' help_usage db 'BLTA.COM file lister for Win32 DOS Ver0.30k 2012-01-02',CR,LF db ' usage BLTA opt filename',CR,LF db ' opt D or d Double quote',CR,LF db ' opt P or p full Path',CR,LF db ' opt F or f File name opt',CR,LF db ' opt H or h or ? Help usage',CR,LF db '$'