[HOME]  [全部表示 会議室風]  [全部表示 保存用]  [HOME]  [リストへもどる] [リストへもどる]

一括表示


  blta.asm (オプション付き改造版) ver0.30k - konno 12/01/04-01:10 No.47
 ┣ blta.asm ver0.31k - konno 12/01/04-02:09 No.48
 ┃ ┗ blta.com ver0.31k の ish - konno 12/01/04-12:36 No.49
 ┣ blta.asm ver0.40k all DOS版 - konno 12/01/04-20:42 No.50
 ┃ ┗ blta.com ver0.40k all DOS版のish - konno 12/01/04-20:43 No.51
 ┗ blta.asm ver0.41k all DOS版 バグ修正 - konno 12/01/08-02:03 No.52

(47) 47blta.asm (オプション付き改造版) ver0.30k  投稿者:konno   2012/01/04(水) 01:10
   コメント数 4

#kyo5724 から転載

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

このように、最初の引数が動作のオプションで、何もつけなければ、Bll と同じ動作
オプションは複数同時指定できます。"-" や "/" は無視します。
第一引数に "f" を指定して半角スペース1個空け第二引数にファイル名を指定できます。

VTDOS|C:\VZ\T>BLTA.COM f blt*.*
BLT.000
BLT1.ASM
BLT1.COM
BLT1.EXE
BLT1.LST
BLT2.ASM
blt2.com
blt2.exe
blt2.map
BLTA.000
BLTA.ASM
BLTA.COM
blta.exe
BLTA.MAP

こんな感じになります。どうでしょうか。以下ソースです。

;-------------------------------------------------------------------------
;blta.asm (Long Fullpath BLT All for win32_DOS)
INCLUDE STDIO.H

	CODE	SEGMENT BYTE
	ASSUME	CS:CODE, DS:CODE, SS:CODE
	org	80h
	argc		db	?
	argv		db	127 dup (?)
	org	100h
;-----------------------------------------------------------------
START:
	mov	bx,80h          	;↓ファイル名をASCIIZにする
	add	bl,[bx]
	inc	bx
	mov	[bx],byte ptr 0 	;↑ここまで

	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],' '		;↓ファイル名の先頭を求める
	jne	normal
	add	bx,1
	mov FILE2,word ptr bx
	jmp	normal

OP_D:	mov	OPT_D,1
	jmp	SWCHR
OP_P:	mov	OPT_P,1
	jmp	SWCHR
OP_F:	mov	OPT_F,1
	jmp	SWCHR

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

	;--- subroutines ---

SET:	mov	cx,28h			;directory, volume 除く
	mov	si,1
	mov	di,offset BUFF_F
	ret

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	'$'

	pend

      - No.47 -    このTreeへ           [リストへもどる] pre


(47) 48blta.asm ver0.31k  投稿者:konno   2012/01/04(水) 02:09
    47 番 konno さんへのコメント    コメント数 3

;-------------------------------------------------------------------------
;blta.asm (Long Fullpath BLT All for win32_DOS ver0.31k)
INCLUDE STDIO.H

	CODE	SEGMENT BYTE
	ASSUME	CS:CODE, DS:CODE, SS:CODE
	org	80h
	argc		db	?		;引数のサイズ 127bytes
	argv		db	127 dup (?)
	org	100h
;-----------------------------------------------------------------
START:
	mov	bx,80h          		;↓ファイル名をASCIIZにする
	add	bl,[bx]				;引数のサイズ取得
	inc	bx
	mov	[bx],byte ptr 0 		;引数終わりの0Dhをnullに

	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				; pass
	jmp	SWCHR
OP_F:	mov	OPT_F,1				; Fname
	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_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

	;--- subroutines ---

SET:	mov	cx,28h				;directory, volume 除く
	mov	si,1
	mov	di,offset BUFF_F
	ret

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	'$'

	pend


      - No.48 -    このTreeへ    コメント元:47 へ [リストへもどる] pre


(47) 49blta.com ver0.31k の ish  投稿者:konno   2012/01/04(水) 12:36
    48 番 konno さんへのコメント

<<< blta.com for MS-DOS ( use ish ) [ 27 lines ] >>>
!!C*!'9Q!4"P$n$uSD9|!C$oR6nt!&"H-w)f!GCE}al4k9\2&$!!!!!!!!!!!!!!!!!!!!!!!!m0M2
!!C*!'9Q!4"P$n$uSD9|!C$oR6nt!&"H-w)f!GCE}al4k9\2&$!!!!!!!!!!!!!!!!!!!!!!!!m0M2
!!C*!'9Q!4"P$n$uSD9|!C$oR6nt!&"H-w)f!GCE}al4k9\2&$!!!!!!!!!!!!!!!!!!!!!!!!m0M2
""d3v駄蘇!)1U習刃!"穽20g0技?外3d柮"%j~AE!@grn7繍將甑珸5D^宗W$24f{蝟妖孛Hl幄@4$h
$w兼%M3d慚|(W糞!檗"&~wA<,PslU20b)(-0U$N罔yR*Uc喨)(--U$KHe'--fn(/,/-Nwm*除袋wyi\
%jN9b}灸F8W岶&S0QjN*[YU"U"ZdCuL喧>+譜DKa0yO(\wB蛍!$PT賀}b$/毟uL益!$yF!M_O9癧5畤
&'pT8DT4l)9~寧廟$察莞!M_O叛3~H銚!3I^!8瑚a]-Ee'!8e'-2fn"w$挑明鐸*zwF&襦v剽!$妖WW
'叛3~H銚YAn豌^覃$挑披鐸2從秋8年[5>)4撹DSP!!'廼Q尿l=1顳v剿!$?較RE隼"W蛤O羨蛤DbAX
('q廷_"郊*[K縫DHP!!'廼Q尿l=1驗!z1B)aP$QIt8QLq|$dI>Y;h新特匪wiK%同:7布!Mx5>蹠褥L
)=Y2!;,!,%q琥膩信袙DH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F3|f僉瑞>R嬬]尻Re3隆y+E8*LDXb蕕253|g:7C&>3甸"両&:Wz彰MwSJX妾L病>m!2!!]ET5
g蜻1_hkC"睹M筈j-SE$;Ys憤KM衄tJ@Rf4DB娵ZT牆{Y$:緝?4^X蛍6B詼Xd孅繩94Y-今戟E筆苗f)
i^EgCqcxR褥j*$疇Bq號Ri殻&$狙w</>Ma1Kg0?汚9劫奇8I~f廳]bp刄F@F{&惣羆J5X箟E布徭置+
--- blta.com (27/27) ---

      - No.49 -    このTreeへ    コメント元:48 へ [リストへもどる] soft


(47) 50blta.asm ver0.40k all DOS版  投稿者:konno   2012/01/04(水) 20:42
    47 番 konno さんへのコメント    コメント数 2

blta.asm ver0.40k   all DOS版です、16ビットDOSでは試してません。

;blta.asm (Long Fullpath BLT All for all DOS ver0.40k  2012-01-04 )

INCLUDE STDIO.H

	CODE	SEGMENT BYTE
	ASSUME	CS:CODE, DS:CODE, SS:CODE
	org	80h
	argc	db	?		;引数のサイズ 127bytes
	argv	db	127 dup (?)
	org	100h
;-----------------------------------------------------------------
START:
	mov	bx,80h          	;↓引数をASCIIZにする
	add	bl,[bx]			;引数のサイズ取得
	inc	bx
	mov	[bx],byte ptr 0 	;引数終わりの0Dhをnullに

	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			; pass
	jmp	SWCHR
OP_F:	mov	OPT_F,1			; Fname
	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

;	--- subroutines ---

SET:	mov	cx,28h			;directory, volume 除く
	mov	si,1
	mov	di,offset BUFF_F
	ret

;	--- 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 -    このTreeへ    コメント元:47 へ [リストへもどる] pre


(47) 51blta.com ver0.40k all DOS版のish  投稿者:konno   2012/01/04(水) 20:43
    50 番 konno さんへのコメント

<<< blta.com for MS-DOS ( use ish ) [ 27 lines ] >>>
!!Sa!&9Q!4"P$n$uSD9|!C$oR6nt!&"H!_\P!GCE}a"x)l{P${!!!!!!!!!!!!!!!!!!!!!!!!xG,B
!!Sa!&9Q!4"P$n$uSD9|!C$oR6nt!&"H!_\P!GCE}a"x)l{P${!!!!!!!!!!!!!!!!!!!!!!!!xG,B
!!Sa!&9Q!4"P$n$uSD9|!C$oR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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!琥$_
1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Lqvo
2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;邉6
3!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Mv互盂1OPL袴絣圈5蛻Vu(mz痊ggN梵V
4冥G怦4<{}^L枴70倒Vu(m兇攵9z)Y蒲懾&xmt*Xv_"N$-}"懺^)%S泣,[!d\j穏潰!dj曵D饌hU;^4
5ggrART\Y急貰"H3|f凩m櫻3|g67C&>3預!d$-xK蘖Vg(m結壻9zE8*LDXb蕕253|gB7C&>3嫗!do[Y
6f儿n@?<wRx賠hM3vf僉)?AGDX"4Ke*YD|!d$-*O払9j崇温嬬b蕕SZ'?f僉愾@AD高$Mu)3岫b蛞,P
7ge$(Mx[Tgc?燦澗0禝^Z,Z!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!演zo
g緩roMgH婆dsv嚮Fla&寺伺|脾O珪uR*牆R蜀潟(R却^T栂*淇]矧ST0j4覲望塢/霎,M毒5塩WwzGK
i喀v=岨_'WVC?U9e-坩~)u]%8Z$p^梅宅熱bAxtj4L//F3姚b&h/t&Lv_皀Sg"Q'軅b"V燕i惧c+"哢
--- blta.com (27/27) ---

      - No.51 -    このTreeへ    コメント元:50 へ [リストへもどる] soft


(47) 52blta.asm ver0.41k all DOS版 バグ修正  投稿者:konno   2012/01/08(日) 02:03
    47 番 konno さんへのコメント    コメント数 2

;blta.asm (Long Fullpath BLT All for all DOS ver0.41k  2012-01-08 )

INCLUDE STDIO.H

	CODE	SEGMENT BYTE
	ASSUME	CS:CODE, DS:CODE, ES:CODE, SS:CODE
	org	80h
	argc	db	?		;引数のサイズ 0-127bytes
	argv	db	127 dup (?)
	org	100h
;-----------------------------------------------------------------
START:
	mov	bx,80h          	;↓引数をASCIIZにする
	add	bl,[bx]			;引数のサイズ取得
	inc	bx
	cmp	bx,83h			;★ 引数が無い時
	jb	normal			;★
	mov	[bx],byte ptr 0 	;引数終わりの0Dhをnullに

	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

;	--- subroutines ---

SET:	mov	cx,28h			;directory, volume 除く
	mov	si,1
	mov	di,offset BUFF_F
	ret

;	--- 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 -    このTreeへ    コメント元:47 へ [リストへもどる] pre