Specifications

B-2
Guide to Printers and Printing
%? <IF>
%G_z PUSH: (Page ORIENTATION)
%{1} PUSH: (Integer Constant 1)
%& PUSH: (pop2 & pop1) –– Bitwise AND
%t <THEN>
%GwK PUSH: (Primary Page Length (–z 0) or Secondary
Page Width (–z
1), in pels)
%e <ELSE>
%GwJ PUSH: (Primary Page Width (–z 0) or Secondary Page
Length (–z
1), in pels)
%; <END>
%? <IF>
%G_p PUSH: (PITCH (characters per inch))
%{17} PUSH: (Integer Constant 17)
%= PUSH: (pop2 = pop1 ?)
%t <THEN>
%{171} PUSH: (Integer Constant 171)
%e <ELSE>
%G_p PUSH: (PITCH (characters per inch))
%{10} PUSH: (Integer Constant 10)
%* PUSH: (pop2 * pop1)
%; <END>
%* PUSH: (pop2 * pop1)
%? <IF>
%G_W PUSH: (DOUBLE–WIDE print?)
%t <THEN>
%{6000} PUSH: (Integer Constant 6000)
%e <ELSE>
%{3000} PUSH: (Integer Constant 3000)
%; <END>
%/ PUSH: (pop2 / pop1)
%d POP –> ASCII String –> OUTPUT
The calculation of _w begins by pushing the value of _z, page orientation, onto the stack.
The job submission command being used in this example, qprt –a1 –Pasc –fp –p12
–scourier –C –N3 /etc/motd, specifies a z value of 1, so a 1 is pushed onto the
stack. The %{1} pushes another 1 onto the stack, after which the %& pops the top two
values (both 1 s) off the stack and performs a bitwise AND with the two values. The result of
the bitwise AND, a 1, is pushed onto the stack.
Note: The test is a bitwise AND instead of a simple test for equality because the legal
values for the z flag are 0, 1, 2, and 3, corresponding to the legal number of 90 degree
rotations that can be applied to a printed page.
The next %t finds a true (non–zero) value on the stack and so the then clause, %GwK, is
resolved before any more work is done resolving _w.
As formatted by lsvirprt, wK is defined as follows:
Primary Page Length (–z 0) or Secondary Page Width (–z 1), in pels
wK =
%G_Q%Pq%?%GWu%{3}%<%t%?%gq%{1}%=%t%{3200}%e%gq%{2}%=%t%{4100}%e%g
q%{3}%=%t%{2935}%e%gq%{4}%=%t%{3407}%e%{3050}%;%e%?%gq%{1}%=%t%{2
150}%e%gq%{2}%=%t%{2562}%e%gq%{3}%=%t%{2750}%e%gq%{4}%=%t%{2498}%
e%gq%{5}%=%t%{2604}%e%{2852}%;%;%d