-
Notifications
You must be signed in to change notification settings - Fork 2
/
ps.frt
99 lines (92 loc) · 2.44 KB
/
ps.frt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
( $Id: ps.frt,v 4.5 2018/10/24 11:14:05 albert Exp $)
( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License)
( Generate postscript data sheet. )
( Instructions to compare with, last byte 0..FF )
ALSO ASSEMBLER
DECIMAL
VARIABLE PREFIX 0 PREFIX !
( Mask to compare with, contains valid bytes of PREFIX )
VARIABLE MASK 255 MASK !
CREATE TITLE 256 CELL+ ALLOT
: DEFAULT "QUICK REFERENCE PAGE FOR 8086 ASSEMBLER" ;
DEFAULT TITLE $!
: PRELUDE
CR
." SNIP TILL HERE" CR
." %!" CR
." /Helvetica findfont 10 scalefont setfont " CR
." 60 60 translate /wt 60 def /ht 23 def " CR
;
( Calculate for the N-th line: WHAT number is to printed in the margin )
HEX
: SIDENOTE
1F SWAP - 8 * ( last byte)
MASK @ FFFF = IF
PREFIX @ 100 * +
ELSE MASK @ FFFFFF = IF
PREFIX @ 100 /MOD 100 * ROT + SWAP 10000 * +
THEN THEN ( Else nothing)
;
DECIMAL
: FRAME
9 0 DO
I . ." wt mul 0 ht mul moveto 0 ht 32 mul rlineto stroke" CR
LOOP
8 0 DO
I . ." .3 add wt mul ht 32.3 mul moveto" CR
HEX &( EMIT I U. &/ EMIT SPACE I 8 + U. &) EMIT ." show" CR DECIMAL
LOOP
33 0 DO
." 0 wt mul " I . ." ht mul moveto wt 8 mul 0 rlineto stroke" CR
LOOP
32 0 DO
I . ." .3 add wt mul ht 32.3 mul moveto" CR
." -40 " I . ." .5 add ht mul 5 sub moveto" CR
HEX &( EMIT I SIDENOTE 6 .R &) EMIT
." show" CR DECIMAL
LOOP
;
: POSTLUDE
." 0 wt mul 33 ht mul moveto " CR
." /Times-Roman findfont 14 scalefont setfont" CR
&( EMIT TITLE $@ TYPE &) EMIT ." show" CR
." /Times-Roman findfont 6 scalefont setfont" CR
." 6.5 wt mul -12 moveto " CR
." (By Albert van der Horst DFW Holland) show" CR
." showpage" CR
;
( Print the opcode of the current pifu at place N in the opcode map )
: OPCODE
8 /MOD 31 SWAP - SWAP
. ." .15 add wt mul " . ." .5 add ht mul 5 sub moveto " CR
&( EMIT this %~ID. &) EMIT ." show" CR
;
VARIABLE INCREMENT
( For DEA and N : this dea FITS in box n )
: MATCH? 1+
INCREMENT @ * PREFIX @ + ( Opcode)
DAT XOR ( Difference)
SWAP BI INVERT AND ( Valid bits)
MASK @ AND ( Relevant byte)
0=
;
( Fill in a box of the opcode wherever cuurent pifu fits. )
: OPCODES
MASK @ 1+ 256 / INCREMENT !
256 -1 DO
DUP I MATCH? IF DUP I OPCODE THEN
LOOP
DROP
;
: QUICK-REFERENCE
FRAME
!DISS !TALLY
pifustart BEGIN
this IS-PI this '_""_ <> AND IF
OPCODES
THEN
>next
pifuend? UNTIL
POSTLUDE
;
PREVIOUS