CLRBIT(OPCSDEFS)	Optical Printer Control System	  CLRBIT(OPCSDEFS)

    NAME
        clrbit - clear bit(s) on an IBMPC port

    USAGE
        clrbit [port] [mask] [softlatch]    # (values hex!)

    EXAMPLES
        clrbit 0378 04 0        # lpt1 port bit #2 (1=#0, 2=#1, 4=#2)
        clrbit 0306 01 1        # kuper card logic connector,
	                        # bit #1 (note softlatch=1)

    DESCRIPTION
        This command disables bits on a port, based on the mask. 
	All bits in the mask are cleared.  All values are in hex.

	    [port] is the port number in the range 0000-03ff

	    [mask] is a hex byte value indicating the bits
	    to be cleared on that port. 

        SETBIT(OPCSDEFS) and CLRBIT(OPCSDEFS) commands can be used
	in the OPCSDEFS.OPC file to initialize port hardware bits
	to known states on startup.

        o With [softlatch] set to 1, only ports 0x0000 - 0x07ff are allowed.
	  Any ports referenced above 0x07ff with [softlatch] enabled will
	  cause an error.

        o External programs that modify a port defined to OPCS as a [softlatch]
	  port (such as would be the case for the kuper logic I/O port) should
	  beware that the OPCS software will be maintaining it's own internal
	  latch for that port, and this latch value will not reflect any 
	  changes that have been made by the external program.
	
	  This is not really a bug, just a fact that cannot be changed. It 
	  is usually bad hardware practice to make WRITE ONLY ports, since 
	  different programs cannot co-communicate with such a port, unless 
	  some common data area is arranged to latch the settings, which can
	  be hard to enforce on PCs.

    BUGS
        o With [softlatch] set to 1, only ports 0x0000 - 0x07ff are allowed.
	  Any ports referenced above 0x07ff with [softlatch] enabled will
	  cause an error.

        o External programs that modify a port defined to OPCS as a [softlatch]
	  port (such as would be the case for the kuper logic I/O port) should
	  beware that the OPCS software will be maintaining it's own internal
	  latch for that port, and this latch value will not reflect any 
	  changes that have been made by the external program.
	
	  This is not really a bug, just a fact that cannot be changed. It 
	  is usually bad hardware practice to make WRITE ONLY ports, since 
	  different programs cannot co-communicate with such a port, unless 
	  some common data area is arranged to latch the settings, which can
	  be hard to enforce on PCs.

    SEE ALSO
        DEENERGIZE(OPCSDEFS)  - define port/bit to deenergize motors
        ALLSTOP(OPDSDEFS)     - define port/bit to detect the allstop key
        BUCKLE(OPCSDEFS)      - define port/bit to detect film buckles
        VIEWER(OPCSDEFS)      - define port/bit to detect viewer open
        TRIPSWITCH(OPCSDEFS)  - define port/bit to detect trip switches
        SETBIT(OPCSDEFS)      - set bit(s) on a port
        CLRBIT(OPCSDEFS)      - clear bit(s) on a port
        XORBIT(OPCSDEFS)      - invert bit(s) on a port

    ORIGIN
	Version K1.12d+ Gregory Ercolano, Venice California 03/04/98
© Copyright 1997 Greg Ercolano. All rights reserved.