Using the write protect function -11, 3 using the write protect function – Acrosser AR-B1047 User Manual
Page 26

AR-B1047 User’s Guide
3-11
3.3 USING THE WRITE PROTECT FUNCTION
The AR-B1047 provides software write protect functions for small page 5V FLASH disk and only software write
protect function for SRAM disk to prevent your data on 5V FLASH or SRAM disk from accidental deletion or
overwrite. If your FLASH/SRAM disk is write protected, any write operation to the protected FLASH/SRAM disk will
get a write protect error
Write protect error writing drive A
Abort, Retry, Fail?
If you need the write protect function and sometimes you have to write or update data on your FLASH/SRAM disk,
you can use the software write protect instead of hardware write protect. The software write protect function is
enabled or disabled by writing data to an I/O port.
(1) Enable the Software Write Protect
Writes 80H to the base port+0 address
Example 1: (in assembly language)
MOV DX,224H ;
If the AR-1047’s base I/O address is 224H
MOV AL,80H ;
Enable byte=80H
OUT DX,AL
Example 2: (in BASICA language)
OUT &H224,&H80 :
REM If the AR-B1047’s base I/O address is 224H
Example 3: (in Turbo C language)
outportb(0x224,0x80) ; /*If the AR-B1047’s base I/O address is 224H*/
(2) Disable the Software Write Protect
Writes 0H to the base port+0 address
Example 1: (in assembly language)
MOV DX,224H ;
If the AR-1047’s base I/O address is 224H
MOV AL,00H ;
Disable byte=00H
OUT DX,AL
Example 2: (in BASICA language)
OUT &H224,&H00 :
REM If the AR-B1047’s base I/O address is 224H
Example 3: (in Turbo C language)
outportb(0x224,0x00) ; /*If the AR-B1047’s base I/O address is 224H*/