WndLpt Script Instructions

Basic masked output

111000111000 [count]
; Basic commands - directly set 12 output states.
111000!!xx?? [count]
; Extended commands for complex direction.
mask <mask> [count] ; Mask with complex syntax.
[+|-|~|&|?] <mask> [count]
; Change by mask

Cycles

for (while, try) <count>
; Perform next command(s) for count times.
repz (rep) <count>
; Same as for, but without pauses.

Sequence

goto <label>
; Goto label. Skipped if label is not exist.
jmp (jump) <label>
; Goto label. Error if label is not exist.
label <label>
; Defines a label for using with goto/jump/jmp.
gosub <function> [count]
; Call function. Skipped if function is not exist.
call <function> [count]
; Call function. Error if function is not exist.
sub (func, psub) <function>
; Defines a function (subroutine) for using with gosub/call.
return, ret
; Performs return from function.

Branches

test <i | q | pin> <addr> ; Test input or output signal of LPT port.
jz, jnz <function> ; Conditional jump.
callz, callnz <function> ; Conditional call.

Keywords

random [[set] add] ; Change random counter for Sequence and Branch commands.
random <command> ; Modify Sequence and Branch commands.

Logic

on [count]
; Set all outputs to High state.
off [count]
; Set all outputs to LOW state.
nop [count]
; Do nothing.
or (+) [<mask> [count]]
; Set pointed pins to 1.
clr (-) [<mask> [count]]
; Set pointed pins to 0.
xor (~) [<mask> [count]]
; Invert pointed pins (eor, inv).
and (&) [<mask> [count]]
; Logical AND.
rol (rlc) [count]
; Circular Shift Left.
ror (rrc) [count]
; Circular Shift Right.
lsl [count]
; Logical Shift Left.
lsr [count]
; Logical Shift Right.
asl [count]
; Arithmetic Shift Left.
asr [count]
; Arithmetic Shift Right.
ssl [count]
; Circular Shift Left with 1 priority.
ssr [count]
; Circular Shift Right with 1 priority.
nsl [count]
; Circular Shift Left with 0 priority.
nsr [count]
; Circular Shift Right with 0 priority.
not [count]
; Invert all outputs.
inc [number]
; Add number.
dec [number]
; Subtract number.
mul [number]
; Mul to number.
div [number]
; Div to number.
shift [=] [+|–] number [count]
; Shift LPT outputs.

Pauses

sleep ms[sec[min[hours]]]
; Set pause only for current step.
sleeps ms[sec[min[hours]]]
; Set regular pause.
delay ms[sec[min[hours]]]
; Perform the delay.
skip
; Skip pause once.
wait ms[sec[min[hours]]]
; Wait while system time less or equal to specified time.
speed [number]
; Set SPEED. (PAUSE = MULTIPLIER * SPEED)

Environment

cmd count [number]
; Sets amount of used pins.
cmd leds <leds> [outs]

; Sets amount of used leds.
leds - count of leds
outs - count of outputs for operations

cmd remap [numbers...]
; Remap LPT pins outputs
cmd ms [number]
; Set MULTIPLIER. (PAUSE = MULTIPLIER * SPEED)
cmd restart
; Restart the script.
cmd show
; Show WndLpt window.
cmd hide
; Hide WndLpt window.
cmd bkgnd
; Hide WndLpt window.
cmd priority [number]
; Set thread priority. Min 1, max 7. Default is 7.

Music Visualization with script

cmd enable_music [ 1 | 0 ]
; Turn on/off internal music visualization by script.
cmd music_preset [=|+|-] <number>
; Change music visualization preset.
cmd switch_to_music
; Switch to the "Music" Tab (and turn script to stop).

Tower clock emulation (for LEDs arranged in a circle)

cmd enable_clock [ 1 | 0 ]
; Turn on/off tower clock emulation.
cmd clock_timings <ms> <ms> ... ; Change clock timings.

Other

cmd set_lpt_port_addr_in_decimal_at_owners_risk [addr]
; Specify basic LPT port address.

Old description