SETBIT(OPCSDEFS)	Optical Printer Control System	  SETBIT(OPCSDEFS)

    NAME
        setbit - set bit(s) on a port

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

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

    DESCRIPTION
        This command enables bits on port, based on the mask. 
	Basically, the mask is OR'ed with the port's current value.

	[port] is the port number in hex.

	[mask] is a hex byte value which is OR'ed with the current
	value at the port. (In the case of softlatching, the software latched
	value is OR'ed with the mask, to create the new value that it output
	to the port)

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

        o External programs changing port bits defined to OPCS with [softlatch]
          (e.g. the kuper logic I/O port) should be aware that OPCS is
          maintaining its own internal latch for that port, and that latch
          won't know about hardware changes made by external programs.
        
        o Due to these issues, it's best to avoid using hardware that has to
          be latched. It's usually bad hardware practice to make WRITE ONLY
          ports, since different programs cannot co-communicate with them,
          unless some common data area or driver is arranged.

    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.