% Demonstration of Mach3 IF statement
% Caution - messy and conoluted, but legal and functional
% NOTE: Mach does permit logical variables. TRUE=1, FALSE=0
% Mach also permits m98 with L0, which means 'do not call at all'
#10=3 % Coord to miss
#11=6 % Coord to miss
#12=10 % Steps per rev
#13=[360/#12] % angle of step
g69
g0 x0 y0
#1=0
m98 p10 L#12
g69
g1 x0 y0
m30
o10
#2=[#1-#10]
#2=[1 xor [#2]] % #2 is TRUE when #1=#10
#3=[#1-#11]
#3=[1 xor [#3]] % #3 is TRUE when #1=#11
#4=[#2 or #3] % #4 is TRUE if #1 = #10 OR #1 = #11
#4=[1 xor [#4]] % #4 is TRUE when #1 is not equal to either #10 or #11
m98 p11 L#4 % Call if #4 is TRUE, not if #4 is FALSE
#1=[#1+1]
m99
o11
#5=[#1*#13]
g68 a0 b0 r#5
g1 x10 y0
m98 p12
g1 x0 y0
m99
o12
g0 x12 y0
g2 x8 y0 r2
g2 x12 y0 r2
m99