;Entry_ADFWriteProtect
;---------------------
;Write protects the floppy
;
;Entry:
; R0 - command line
; R1 - number of parameters
; R12 - pointer to module private word

.Entry_ADFWriteProtect
 STR     R14, [R13, #-4]!
 LDR     R12, [R12, #0]

 TEQ     R1, #0				;is there a parameter?
 BLNE    On_Off_Option			;YES, read On/Off option
					;NO, presume on

 TEQ     R0, #0				;ON or OFF?
 LDR     R1, [R12, #JFD_tmp + JFD_Bit_Flags - VARS]	;get the bit flags
 BICEQ   R1, R1, #JFD_BF_WriteProtect	;clear write protect flag
 ORRNE   R1, R1, #JFD_BF_WriteProtect	;set write protect flag
 STR     R1, [R12, #JFD_tmp + JFD_Bit_Flags - VARS]

 SUBS    R0, R0, R0			;clear V
LDR     PC, [R13], #4
