	page	78,132
	.sall
	.sfcond
	page
comment *

     This program was written by Joseph Sarkes for use under
PC-DOS 2.0.  Proper operation may not result if used under
DOS versions not compatible with 2.0 function calls.     *
	name	chmod
	title	file attribute control program
if1
.xlist
	include	mac.mac
	include	jlong.mac
.list
endif
cseg	segment	para public 'code'
	assume	cs:cseg,ds:cseg,es:cseg,ss:cseg
	org	100h
start	proc	far
comment *         place com program code here         *
	cld
	mov	cl,ds:[80h]	;get size of param string
	xor	ch,ch
	jlong	cxz,no_param_string
	mov	si,81h	;start offset of parameter string
skip_spaces:
	lodsb
	cmp	al,' '
	loope	skip_spaces
	cmp	al,09h	;(tab)
	je	skip_spaces
	jlong	cxz,no_param_string
	mov	dx,si
	dec	dx	;offset of name
find_end_of_name:
	lodsb
	cmp	al,'/'
	je	end_of_name
	cmp	al,' '
	je	end_of_name
	cmp	al,','
	je	end_of_name
	cmp	al,09h	;(tab)
	je	end_of_name
	loop	find_end_of_name
end_of_name:
	mov	byte ptr [si],0	;terminate asciiz string
get_current_attr:
	mov	ax,4300h	;get current attributes in cx
	int	21h
	jnc	filename_good
	print$	13,10,'error accessing file'
	exit	8
filename_good:
	mov	ax,4301h	;set attributes to cx
	or	cx,0003h	;write protect and hide
	int	21h
no_param_string:
	exit
start	endp
cseg	ends
	end	start


,0˜Ñà»Ø‹èßÿëŠÐ´Í!X¨€tØ^Z[XÃEº9	¸ =Í!s= uºßé„üè‡