MASK

Set pointed pins to 0 or 1. You can also invert pointed pins or stay they untouched.

Syntax

[mask] [+|-|~|&|?] <mask> [count]
[mask] <extmask> [count]
[+|-|~|&] <mask> [count]
<extmask> [count]

Parameters

<mask>
  • 1) Sequense of 0 or 1, for ex. 111000111000.
  • 2) Enum of bit-numbers at bracket, for ex. (1), (2,3,4) or (8,12,5,11), its accordingly to 100000000000, 011100000000 or 000010010011. First left bit is 1 (but not zero).

<extmask>
  • 1) Sequense of 0, 1, !, ? or x, for ex. 111000!!??xx.
count
  • Decimal number from 2 to 100, tells how many times next command or block will be retried.

Remarks

It is necessary to specify new state for all 12 output pins (or less in case using cmd count) then you use 1-st mask syntax (like 111000). All unspecified bits will be filled by same state like last specified byte. For example:
1010 is equivalent to 101000000000
0101 is equivalent to 010111111111
1 is equivalent to 111111111111
0 is equivalent to 000000000000
11110 is equivalent to 111100000000

Examples

// Syntax 1
1            ; Set all outputs to HIGH state
!00000000000 ; Invert first output state and resEt the rest outputs
!xxxxxxxxxxx ; Invert first output state and stay untouched the rest outputs
011111111111 ; Reset first output state and set reset outputs to HIGH state
 
// Syntax 2
mask +(1,2)  ; Set 1 and 2 outputs to HIGH state (rest stay untouched)
+(7)         ; Set output no. 7 to HIGH state (rest stay untouched)
-(1,3,5)     ; Set 1, 3 and 5 outputs to LOW state (rest stay untouched)
~(4,6)       ; Invert 4 and 6 outputs (rest stay untouched)
&(7,8)       ; Say untouched state of 7 and 8 outputs (and resEt the rest outputs)
?(9,10)      ; Randomize state of 9 and 10 outputs

See also "Basic LPT pins direction".
See also "Extended LPT pins direction".