(FILECREATED " 8-Feb-86 10:33:24" {ERIS}<LISPUSERS>KOTO>DPRESS.;2 39329  

      previous date: " 4-Sep-84 22:06:05" {ERIS}<LISPUSERS>DPRESS.;3)


(* Copyright (c) 1986 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT DPRESSCOMS)

(RPAQQ DPRESSCOMS ((* DPRESS -- Disassemble PRESS, by Kelly Roach *)
                   (COMS (* DPRESSLL *)
                         (INITVARS (Show.characters.short 0)
                                (Skip.characters.short 32)
                                (Show.characters.and.skip 64)
                                (Set.space.x.short 96)
                                (Set.space.y.short 104)
                                (Font 112)
                                (..available.. 128)
                                (..spare.. 160)
                                (Skip.control.bytes.immediate 235)
                                (Alternative 236)
                                (Only.on.copy 237)
                                (Set.x 238)
                                (Set.y 239)
                                (Show.characters 240)
                                (Skip.characters 241)
                                (Skip.control.bytes 242)
                                (Show.character.immediate 243)
                                (Set.space.x 244)
                                (Set.space.y 245)
                                (Reset.space 246)
                                (Space 247)
                                (Set.brightness 248)
                                (Set.hue 249)
                                (Set.saturation 250)
                                (Show.object 251)
                                (Show.dots 252)
                                (Show.dots.opaque 253)
                                (Show.rectangle 254)
                                (Nop 255)
                                (Moveto 0)
                                (Drawto 1)
                                (Drawcurve 2)
                                (Set.coding 512)
                                (Set.window 1)
                                (Set.mode 1024)
                                (Set.size 2)
                                (Dots.follow 3)
                                (Get.dots.from.file 4)
                                (Get.dots.from.Press.file 5)
                                (Set.sampling.properties 6)
                                (SSP.input.intensity 0)
                                (SSP.output.intensity 1)
                                (SSP.screen 2))
                         (UGLYVARS ELC.ARRAY)
                         (FNS DPRESS.COMMANDS DPRESS.COMMANDS.PASS1 DPRESS.COMMAND.PASS1 \WIN \DWIN 
                              DPRESS.COMMANDS.PASS2 DPRESS.COMMAND.PASS2))
                   (COMS (* DPRESSHL *)
                         (CONSTANTS (PASSWORD.DD 27183)
                                (\ST.BYTE 0)
                                (BytesPerPage 512)
                                (BytesPerWord 2))
                         (RECORDS DD PDE FDE FONTSET PFD ED ENTITY)
                         (FNS DPRESS.FILE DPRESS.DD DPRESS.PARTDIR DPRESS.FONTSET DPRESS.PAGE))))



(* DPRESS -- Disassemble PRESS, by Kelly Roach *)




(* DPRESSLL *)


(RPAQ? Show.characters.short 0)

(RPAQ? Skip.characters.short 32)

(RPAQ? Show.characters.and.skip 64)

(RPAQ? Set.space.x.short 96)

(RPAQ? Set.space.y.short 104)

(RPAQ? Font 112)

(RPAQ? ..available.. 128)

(RPAQ? ..spare.. 160)

(RPAQ? Skip.control.bytes.immediate 235)

(RPAQ? Alternative 236)

(RPAQ? Only.on.copy 237)

(RPAQ? Set.x 238)

(RPAQ? Set.y 239)

(RPAQ? Show.characters 240)

(RPAQ? Skip.characters 241)

(RPAQ? Skip.control.bytes 242)

(RPAQ? Show.character.immediate 243)

(RPAQ? Set.space.x 244)

(RPAQ? Set.space.y 245)

(RPAQ? Reset.space 246)

(RPAQ? Space 247)

(RPAQ? Set.brightness 248)

(RPAQ? Set.hue 249)

(RPAQ? Set.saturation 250)

(RPAQ? Show.object 251)

(RPAQ? Show.dots 252)

(RPAQ? Show.dots.opaque 253)

(RPAQ? Show.rectangle 254)

(RPAQ? Nop 255)

(RPAQ? Moveto 0)

(RPAQ? Drawto 1)

(RPAQ? Drawcurve 2)

(RPAQ? Set.coding 512)

(RPAQ? Set.window 1)

(RPAQ? Set.mode 1024)

(RPAQ? Set.size 2)

(RPAQ? Dots.follow 3)

(RPAQ? Get.dots.from.file 4)

(RPAQ? Get.dots.from.Press.file 5)

(RPAQ? Set.sampling.properties 6)

(RPAQ? SSP.input.intensity 0)

(RPAQ? SSP.output.intensity 1)

(RPAQ? SSP.screen 2)
(READVARS ELC.ARRAY)
({Y256 POINTER 0 {R32 Show.characters.short} {R32 Skip.characters.short} {R32 Show.characters.and.skip
} {R8 Set.space.x.short} {R8 Set.space.y.short} {R16 Font} {R32 ..available..} {R75 ..spare..} 
Skip.control.bytes.immediate Alternative Only.on.copy Set.x Set.y Show.characters Skip.characters 
Skip.control.bytes Show.character.immediate Set.space.x Set.space.y Reset.space Space Set.brightness 
Set.hue Set.saturation Show.object Show.dots Show.dots.opaque Show.rectangle Nop })
(DEFINEQ

(DPRESS.COMMANDS
  (LAMBDA (STREAM ED)                                                     (* kbr: 
                                                                          " 4-Sep-84 22:05")
                                                                          (* Disassemble ENTITY's 
                                                                          commands *)
    (PROG (ELOCATION ENTITY ELENGTH DLOCATION COMMANDS)
          (SETQ ELOCATION (fetch (ED ELOCATION) of ED))
          (SETQ ELENGTH (fetch (ED ELENGTH) of ED))
          (SETQ DLOCATION (fetch (ED DLOCATION) of ED))
          (SETQ COMMANDS (DPRESS.COMMANDS.PASS1 STREAM ELOCATION ELENGTH))
          (SETQ COMMANDS (DPRESS.COMMANDS.PASS2 STREAM COMMANDS DLOCATION))
          (replace (ED COMMANDS) of ED with COMMANDS)
          (RETURN COMMANDS))))

(DPRESS.COMMANDS.PASS1
  (LAMBDA (STREAM ELOCATION ELENGTH)                                      (* kbr: 
                                                                          " 4-Sep-84 22:05")
                                                                          (* This pass gets info 
                                                                          off the entity list, 
                                                                          returning an unrefined 
                                                                          set of commands *)
    (PROG (COMMANDS)
          (\SETFILEPTR STREAM ELOCATION)
          (SETQ COMMANDS (while (ILESSP (GETFILEPTR STREAM)
                                       (IPLUS ELOCATION ELENGTH -24)) collect (DPRESS.COMMAND.PASS1
                                                                               STREAM)))
          (RETURN COMMANDS))))

(DPRESS.COMMAND.PASS1
  (LAMBDA (STREAM)                                                        (* kbr: 
                                                                          " 4-Sep-84 22:05")
    (PROG (CODE PRESSOP PRESSARGS N COMMAND)
          (SETQ CODE (\BIN STREAM))
          (SETQ PRESSOP (ELT ELC.ARRAY CODE))                             (* Temporary --
                                                                          SELECTQ becomes SELECT 
                                                                          no GETTOPVAL *)
          (SETQ PRESSARGS (SELECTQ PRESSOP
                              ((Reset.space Space Nop) 
                                   NIL)
                              ((Only.on.copy Show.characters Skip.characters Show.character.immediate 
                                      Set.brightness Set.hue Set.saturation) 
                                   (LIST (\BIN STREAM)))
                              ((Set.x Set.y Set.space.x Set.space.y Show.object) 
                                   (LIST (\WIN STREAM)))
                              ((Show.dots Show.dots.opaque) 
                                   (LIST (\DWIN STREAM)))
                              ((Show.characters.short Skip.characters.short Show.characters.and.skip) 
                                   (LIST (ADD1 (IDIFFERENCE CODE (GETTOPVAL PRESSOP)))))
                              ((Font ..available.. ..spare..) 
                                   (LIST (IDIFFERENCE CODE (GETTOPVAL PRESSOP))))
                              ((Set.space.x.short Set.space.y.short) 
                                   (LIST (IPLUS (ITIMES 256 (IDIFFERENCE CODE (GETTOPVAL PRESSOP)))
                                                (\BIN STREAM))))
                              (Alternate (LIST (\WIN STREAM)
                                               (\DWIN STREAM)
                                               (\DWIN STREAM)))
                              (Skip.control.bytes 
                                   (LIST (\WIN STREAM)
                                         (\BIN STREAM)))
                              (Skip.control.bytes.immediate 
                                   (SETQ N (\BIN STREAM))
                                   (CONS N (FOR I FROM 1 TO N COLLECT (\BIN STREAM))))
                              (Show.rectangle 
                                   (LIST (\WIN STREAM)
                                         (\WIN STREAM)))
                              (ERROR "BAD PRESSOP" PRESSOP)))
          (SETQ COMMAND (CONS PRESSOP PRESSARGS))
          (RETURN COMMAND))))

(\WIN
  (LAMBDA (STREAM)                                                        (* kbr: 
                                                                          " 4-Sep-84 22:05")
    (IPLUS (ITIMES 256 (\BIN STREAM))
           (\BIN STREAM))))

(\DWIN
  (LAMBDA (STREAM)                                                        (* kbr: 
                                                                          " 4-Sep-84 22:05")
    (IPLUS (ITIMES 65536 (\WIN STREAM))
           (\WIN STREAM))))

(DPRESS.COMMANDS.PASS2
  (LAMBDA (STREAM COMMANDS DLOCATION)                                     (* kbr: 
                                                                          " 4-Sep-84 22:05")
                                                                          (* This pass takes 
                                                                          unrefined commands from 
                                                                          first pass and info off 
                                                                          the data list to produce 
                                                                          refined commands *)
    (PROG (NEWCOMMANDS)
          (\SETFILEPTR STREAM DLOCATION)
          (SETQ NEWCOMMANDS (for COMMAND in COMMANDS collect (DPRESS.COMMAND.PASS2 STREAM COMMAND)))
          (RETURN NEWCOMMANDS))))

(DPRESS.COMMAND.PASS2
  (LAMBDA (STREAM COMMAND)                                                (* kbr: 
                                                                          " 4-Sep-84 22:05")
    (PROG (PRESSOP PRESSARGS PRESSARG NEWARG NEWARGS NEWOP NEWCOMMAND)
          (SETQ PRESSOP (CAR COMMAND))
          (SETQ PRESSARGS (CDR COMMAND))
          (SETQ PRESSARG (CAR PRESSARGS))                                 (* Temporary --
                                                                          SELECTQ becomes SELECT *)
          (SETQ NEWARGS (SELECTQ PRESSOP
                            ((Show.characters Show.characters.short) 
                                 (SETQ NEWARG (ALLOCSTRING PRESSARG))
                                 (\BINS STREAM (fetch (STRINGP BASE) of NEWARG)
                                        0 PRESSARG)
                                 (LIST NEWARG))
                            (Show.character.immediate 
                                 (SETQ NEWARG (CHARACTER PRESSARG))
                                 (LIST NEWARG))
                            ((Skip.characters Skip.control.bytes Skip.characters.short) 
                                 (APPEND (CDR PRESSARGS)
                                        (FOR I FROM 1 TO PRESSARG COLLECT (\BIN STREAM))))
                            (Show.object                                  (* To be written *)
                                         (FOR I FROM 1 TO PRESSARG COLLECT (\WIN STREAM)))
                            ((Show.dots Show.dots.opaque) 
                                                                          (* To be written *)
                                 (FOR I FROM 1 TO PRESSARG COLLECT (\WIN STREAM)))
                            (Show.characters.and.skip 
                                 (SETQ NEWARG (ALLOCSTRING PRESSARG))
                                 (\BINS STREAM (fetch (STRINGP BASE) of NEWARG)
                                        0 PRESSARG)
                                 (LIST NEWARG (CHARACTER (\BIN STREAM))))
                            (Alternative                                  (* Still need to 
                                                                          implement Alternative *)
                                         (ERROR PRESSOP "NOT IMPLEMENTED"))
                            PRESSARGS))
          (SETQ NEWOP (SELECTQ PRESSOP
                          (Show.characters.short 
                               (QUOTE Show.characters))
                          (Skip.characters.short 
                               (QUOTE Skip.characters))
                          (Set.space.x.short 
                               (QUOTE Set.space.x))
                          (Set.space.y.short 
                               (QUOTE Set.space.y))
                          PRESSOP))
          (SETQ NEWCOMMAND (CONS NEWOP NEWARGS))
          (RETURN NEWCOMMAND))))
)



(* DPRESSHL *)

(DECLARE: EVAL@COMPILE 

(RPAQQ PASSWORD.DD 27183)

(RPAQQ \ST.BYTE 0)

(RPAQQ BytesPerPage 512)

(RPAQQ BytesPerWord 2)

(CONSTANTS (PASSWORD.DD 27183)
       (\ST.BYTE 0)
       (BytesPerPage 512)
       (BytesPerWord 2))
)
[DECLARE: EVAL@COMPILE 

(DATATYPE DD                                                               (* Document Directory *)
             ((PASSWORD WORD)
              (LENGTH WORD)
              (PARTCOUNT WORD)
              (PARTDIRRECORD# WORD)
              (PARTDIRLENGTH WORD)
              (NIL 3 WORD)
              (FIRSTCOPY WORD)
              (LASTCOPY WORD)
              (NIL 118 WORD)
              (\FILENAME 26 WORD)
              (\AUTHOR 16 WORD)
              (\CREATIONDATE 20 WORD)
              (NIL 66 WORD))
             (ACCESSFNS (($PASSWORD (COND
                                       ((IEQP (fetch (DD PASSWORD) of DATUM)
                                              PASSWORD.DD)
                                        (QUOTE OK))
                                       (T (QUOTE ERROR))))
                         ($FILENAME (CREATE STRINGP
                                           LENGTH ←(\GETBASEBYTE DATUM 256)
                                           BASE ← DATUM
                                           OFFST ← 257))
                         ($AUTHOR (CREATE STRINGP
                                         LENGTH ←(\GETBASEBYTE DATUM 308)
                                         BASE ← DATUM
                                         OFFST ← 309))
                         ($CREATIONDATE (CREATE STRINGP
                                               LENGTH ←(\GETBASEBYTE DATUM 340)
                                               BASE ← DATUM
                                               OFFST ← 341))))
             PASSWORD ← 27183)

(DATATYPE PDE                                                              (* Part Directory Entry 
                                                                           *)
              ((TYPE WORD)
               (RECORD# WORD)
               (LENGTH WORD)
               (PADDING WORD))
              (ACCESSFNS (($TYPE (SELECT (fetch (PDE TYPE) of DATUM)
                                        (0 (QUOTE PAGE))
                                        (1 (QUOTE FONTDIR))
                                        (-1 (QUOTE CYPRESS))
                                        ((-2 -3 -4 -5)
                                         (QUOTE OFFICETALK))
                                        (QUOTE ?))))))

(DATATYPE FDE                                                              (* Font Directory Entry 
                                                                           *)
              ((LENGTH WORD)
               (FONTSET BITS 8)
               (FONTNUMBER BITS 8)
               (M BITS 8)
               (N BITS 8)
               (\NAME 10 WORD)
               (FACE BITS 8)
               (SOURCE BITS 8)
               (SIZE WORD)
               (ROTATION WORD))
              (ACCESSFNS (($FAMILY (MKATOM (CREATE STRINGP
                                                  LENGTH ←(\GETBASEBYTE DATUM 6)
                                                  BASE ← DATUM
                                                  OFFST ← 7)))
                          ($FACE (PACKC (LIST (CHCON1 (fetch (FDE $WEIGHT) of DATUM))
                                              (CHCON1 (fetch (FDE $SLOPE) of DATUM))
                                              (CHCON1 (fetch (FDE $EXPANSION) of DATUM)))))
                          ($WEIGHT (SELECT (IQUOTIENT (IREMAINDER (fetch (FDE FACE) of DATUM)
                                                             6)
                                                  2)
                                          (0 (QUOTE MEDIUM))
                                          (1 (QUOTE BOLD))
                                          (2 (QUOTE LIGHT))
                                          (SHOULDNT)))
                          ($EXPANSION (SELECT (IQUOTIENT (fetch (FDE FACE) of DATUM)
                                                     6)
                                             (0 (QUOTE REGULAR))
                                             (1 (QUOTE COMPRESSED))
                                             (2 (QUOTE EXPANDED))
                                             (QUOTE ?)))
                          ($SLOPE (SELECT (IREMAINDER (fetch (FDE FACE) of DATUM)
                                                 2)
                                         (0 (QUOTE REGULAR))
                                         (1 (QUOTE ITALIC))
                                         (SHOULDNT)))
                          (NUMBER (IPLUS (ITIMES 16 (fetch (FDE FONTSET) of DATUM))
                                         (fetch (FDE FONTNUMBER) of DATUM))))))

(DATATYPE FONTSET (NUMBER PDE FDES))

(DATATYPE PFD                                                              (* Press File 
                                                                           Descriptor *)
              (FILE STREAM DD PDES FONTSETS))

(DATATYPE ED                                                               (* Entity Descriptor *)
             (ENTITY ELOCATION DLOCATION COMMANDS)
             (ACCESSFNS ((ELENGTH (ITIMES 2 (fetch (ENTITY EWORDLENGTH) of (fetch (ED ENTITY)
                                                                              of DATUM))))
                         (DLENGTH (fetch (ENTITY DLENGTH) of (fetch (ED ENTITY) of DATUM))))))

(DATATYPE ENTITY ((TYPE BITS 8)
                  (FONTSET BITS 8)
                  (DLOCATION FIXP)
                  (DLENGTH FIXP)
                  (XE WORD)
                  (YE WORD)
                  (LEFT WORD)
                  (BOTTOM WORD)
                  (WIDTH WORD)
                  (HEIGHT WORD)
                  (EWORDLENGTH WORD))
                 (ACCESSFNS ($TYPE (SELECT (fetch (ENTITY TYPE) of DATUM)
                                          (0 (QUOTE PRESS))
                                          (1 (QUOTE CYPRESS))
                                          (4 (QUOTE DRAW))
                                          (6 (QUOTE INTERLISP))
                                          ((64 65 66 67)
                                           (QUOTE OFFICETALK))
                                          (QUOTE ?)))))
]
(/DECLAREDATATYPE (QUOTE DD)
       (QUOTE (WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD))
       (QUOTE ((DD 0 (BITS . 15))
               (DD 1 (BITS . 15))
               (DD 2 (BITS . 15))
               (DD 3 (BITS . 15))
               (DD 4 (BITS . 15))
               (DD 5 (BITS . 15))
               (DD 6 (BITS . 15))
               (DD 7 (BITS . 15))
               (DD 8 (BITS . 15))
               (DD 9 (BITS . 15))
               (DD 10 (BITS . 15))
               (DD 11 (BITS . 15))
               (DD 12 (BITS . 15))
               (DD 13 (BITS . 15))
               (DD 14 (BITS . 15))
               (DD 15 (BITS . 15))
               (DD 16 (BITS . 15))
               (DD 17 (BITS . 15))
               (DD 18 (BITS . 15))
               (DD 19 (BITS . 15))
               (DD 20 (BITS . 15))
               (DD 21 (BITS . 15))
               (DD 22 (BITS . 15))
               (DD 23 (BITS . 15))
               (DD 24 (BITS . 15))
               (DD 25 (BITS . 15))
               (DD 26 (BITS . 15))
               (DD 27 (BITS . 15))
               (DD 28 (BITS . 15))
               (DD 29 (BITS . 15))
               (DD 30 (BITS . 15))
               (DD 31 (BITS . 15))
               (DD 32 (BITS . 15))
               (DD 33 (BITS . 15))
               (DD 34 (BITS . 15))
               (DD 35 (BITS . 15))
               (DD 36 (BITS . 15))
               (DD 37 (BITS . 15))
               (DD 38 (BITS . 15))
               (DD 39 (BITS . 15))
               (DD 40 (BITS . 15))
               (DD 41 (BITS . 15))
               (DD 42 (BITS . 15))
               (DD 43 (BITS . 15))
               (DD 44 (BITS . 15))
               (DD 45 (BITS . 15))
               (DD 46 (BITS . 15))
               (DD 47 (BITS . 15))
               (DD 48 (BITS . 15))
               (DD 49 (BITS . 15))
               (DD 50 (BITS . 15))
               (DD 51 (BITS . 15))
               (DD 52 (BITS . 15))
               (DD 53 (BITS . 15))
               (DD 54 (BITS . 15))
               (DD 55 (BITS . 15))
               (DD 56 (BITS . 15))
               (DD 57 (BITS . 15))
               (DD 58 (BITS . 15))
               (DD 59 (BITS . 15))
               (DD 60 (BITS . 15))
               (DD 61 (BITS . 15))
               (DD 62 (BITS . 15))
               (DD 63 (BITS . 15))
               (DD 64 (BITS . 15))
               (DD 65 (BITS . 15))
               (DD 66 (BITS . 15))
               (DD 67 (BITS . 15))
               (DD 68 (BITS . 15))
               (DD 69 (BITS . 15))
               (DD 70 (BITS . 15))
               (DD 71 (BITS . 15))
               (DD 72 (BITS . 15))
               (DD 73 (BITS . 15))
               (DD 74 (BITS . 15))
               (DD 75 (BITS . 15))
               (DD 76 (BITS . 15))
               (DD 77 (BITS . 15))
               (DD 78 (BITS . 15))
               (DD 79 (BITS . 15))
               (DD 80 (BITS . 15))
               (DD 81 (BITS . 15))
               (DD 82 (BITS . 15))
               (DD 83 (BITS . 15))
               (DD 84 (BITS . 15))
               (DD 85 (BITS . 15))
               (DD 86 (BITS . 15))
               (DD 87 (BITS . 15))
               (DD 88 (BITS . 15))
               (DD 89 (BITS . 15))
               (DD 90 (BITS . 15))
               (DD 91 (BITS . 15))
               (DD 92 (BITS . 15))
               (DD 93 (BITS . 15))
               (DD 94 (BITS . 15))
               (DD 95 (BITS . 15))
               (DD 96 (BITS . 15))
               (DD 97 (BITS . 15))
               (DD 98 (BITS . 15))
               (DD 99 (BITS . 15))
               (DD 100 (BITS . 15))
               (DD 101 (BITS . 15))
               (DD 102 (BITS . 15))
               (DD 103 (BITS . 15))
               (DD 104 (BITS . 15))
               (DD 105 (BITS . 15))
               (DD 106 (BITS . 15))
               (DD 107 (BITS . 15))
               (DD 108 (BITS . 15))
               (DD 109 (BITS . 15))
               (DD 110 (BITS . 15))
               (DD 111 (BITS . 15))
               (DD 112 (BITS . 15))
               (DD 113 (BITS . 15))
               (DD 114 (BITS . 15))
               (DD 115 (BITS . 15))
               (DD 116 (BITS . 15))
               (DD 117 (BITS . 15))
               (DD 118 (BITS . 15))
               (DD 119 (BITS . 15))
               (DD 120 (BITS . 15))
               (DD 121 (BITS . 15))
               (DD 122 (BITS . 15))
               (DD 123 (BITS . 15))
               (DD 124 (BITS . 15))
               (DD 125 (BITS . 15))
               (DD 126 (BITS . 15))
               (DD 127 (BITS . 15))
               (DD 128 (BITS . 15))
               (DD 129 (BITS . 15))
               (DD 130 (BITS . 15))
               (DD 131 (BITS . 15))
               (DD 132 (BITS . 15))
               (DD 133 (BITS . 15))
               (DD 134 (BITS . 15))
               (DD 135 (BITS . 15))
               (DD 136 (BITS . 15))
               (DD 137 (BITS . 15))
               (DD 138 (BITS . 15))
               (DD 139 (BITS . 15))
               (DD 140 (BITS . 15))
               (DD 141 (BITS . 15))
               (DD 142 (BITS . 15))
               (DD 143 (BITS . 15))
               (DD 144 (BITS . 15))
               (DD 145 (BITS . 15))
               (DD 146 (BITS . 15))
               (DD 147 (BITS . 15))
               (DD 148 (BITS . 15))
               (DD 149 (BITS . 15))
               (DD 150 (BITS . 15))
               (DD 151 (BITS . 15))
               (DD 152 (BITS . 15))
               (DD 153 (BITS . 15))
               (DD 154 (BITS . 15))
               (DD 155 (BITS . 15))
               (DD 156 (BITS . 15))
               (DD 157 (BITS . 15))
               (DD 158 (BITS . 15))
               (DD 159 (BITS . 15))
               (DD 160 (BITS . 15))
               (DD 161 (BITS . 15))
               (DD 162 (BITS . 15))
               (DD 163 (BITS . 15))
               (DD 164 (BITS . 15))
               (DD 165 (BITS . 15))
               (DD 166 (BITS . 15))
               (DD 167 (BITS . 15))
               (DD 168 (BITS . 15))
               (DD 169 (BITS . 15))
               (DD 170 (BITS . 15))
               (DD 171 (BITS . 15))
               (DD 172 (BITS . 15))
               (DD 173 (BITS . 15))
               (DD 174 (BITS . 15))
               (DD 175 (BITS . 15))
               (DD 176 (BITS . 15))
               (DD 177 (BITS . 15))
               (DD 178 (BITS . 15))
               (DD 179 (BITS . 15))
               (DD 180 (BITS . 15))
               (DD 181 (BITS . 15))
               (DD 182 (BITS . 15))
               (DD 183 (BITS . 15))
               (DD 184 (BITS . 15))
               (DD 185 (BITS . 15))
               (DD 186 (BITS . 15))
               (DD 187 (BITS . 15))
               (DD 188 (BITS . 15))
               (DD 189 (BITS . 15))
               (DD 190 (BITS . 15))
               (DD 191 (BITS . 15))
               (DD 192 (BITS . 15))
               (DD 193 (BITS . 15))
               (DD 194 (BITS . 15))
               (DD 195 (BITS . 15))
               (DD 196 (BITS . 15))
               (DD 197 (BITS . 15))
               (DD 198 (BITS . 15))
               (DD 199 (BITS . 15))
               (DD 200 (BITS . 15))
               (DD 201 (BITS . 15))
               (DD 202 (BITS . 15))
               (DD 203 (BITS . 15))
               (DD 204 (BITS . 15))
               (DD 205 (BITS . 15))
               (DD 206 (BITS . 15))
               (DD 207 (BITS . 15))
               (DD 208 (BITS . 15))
               (DD 209 (BITS . 15))
               (DD 210 (BITS . 15))
               (DD 211 (BITS . 15))
               (DD 212 (BITS . 15))
               (DD 213 (BITS . 15))
               (DD 214 (BITS . 15))
               (DD 215 (BITS . 15))
               (DD 216 (BITS . 15))
               (DD 217 (BITS . 15))
               (DD 218 (BITS . 15))
               (DD 219 (BITS . 15))
               (DD 220 (BITS . 15))
               (DD 221 (BITS . 15))
               (DD 222 (BITS . 15))
               (DD 223 (BITS . 15))
               (DD 224 (BITS . 15))
               (DD 225 (BITS . 15))
               (DD 226 (BITS . 15))
               (DD 227 (BITS . 15))
               (DD 228 (BITS . 15))
               (DD 229 (BITS . 15))
               (DD 230 (BITS . 15))
               (DD 231 (BITS . 15))
               (DD 232 (BITS . 15))
               (DD 233 (BITS . 15))
               (DD 234 (BITS . 15))
               (DD 235 (BITS . 15))
               (DD 236 (BITS . 15))
               (DD 237 (BITS . 15))
               (DD 238 (BITS . 15))
               (DD 239 (BITS . 15))
               (DD 240 (BITS . 15))
               (DD 241 (BITS . 15))
               (DD 242 (BITS . 15))
               (DD 243 (BITS . 15))
               (DD 244 (BITS . 15))
               (DD 245 (BITS . 15))
               (DD 246 (BITS . 15))
               (DD 247 (BITS . 15))
               (DD 248 (BITS . 15))
               (DD 249 (BITS . 15))
               (DD 250 (BITS . 15))
               (DD 251 (BITS . 15))
               (DD 252 (BITS . 15))
               (DD 253 (BITS . 15))
               (DD 254 (BITS . 15))
               (DD 255 (BITS . 15))))
       (QUOTE 256))
(/DECLAREDATATYPE (QUOTE PDE)
       (QUOTE (WORD WORD WORD WORD))
       (QUOTE ((PDE 0 (BITS . 15))
               (PDE 1 (BITS . 15))
               (PDE 2 (BITS . 15))
               (PDE 3 (BITS . 15))))
       (QUOTE 4))
(/DECLAREDATATYPE (QUOTE FDE)
       (QUOTE (WORD (BITS 8)
                    (BITS 8)
                    (BITS 8)
                    (BITS 8)
                    WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD (BITS 8)
                    (BITS 8)
                    WORD WORD))
       (QUOTE ((FDE 0 (BITS . 15))
               (FDE 1 (BITS . 7))
               (FDE 1 (BITS . 135))
               (FDE 2 (BITS . 7))
               (FDE 2 (BITS . 135))
               (FDE 3 (BITS . 15))
               (FDE 4 (BITS . 15))
               (FDE 5 (BITS . 15))
               (FDE 6 (BITS . 15))
               (FDE 7 (BITS . 15))
               (FDE 8 (BITS . 15))
               (FDE 9 (BITS . 15))
               (FDE 10 (BITS . 15))
               (FDE 11 (BITS . 15))
               (FDE 12 (BITS . 15))
               (FDE 13 (BITS . 7))
               (FDE 13 (BITS . 135))
               (FDE 14 (BITS . 15))
               (FDE 15 (BITS . 15))))
       (QUOTE 16))
(/DECLAREDATATYPE (QUOTE FONTSET)
       (QUOTE (POINTER POINTER POINTER))
       (QUOTE ((FONTSET 0 POINTER)
               (FONTSET 2 POINTER)
               (FONTSET 4 POINTER)))
       (QUOTE 6))
(/DECLAREDATATYPE (QUOTE PFD)
       (QUOTE (POINTER POINTER POINTER POINTER POINTER))
       (QUOTE ((PFD 0 POINTER)
               (PFD 2 POINTER)
               (PFD 4 POINTER)
               (PFD 6 POINTER)
               (PFD 8 POINTER)))
       (QUOTE 10))
(/DECLAREDATATYPE (QUOTE ED)
       (QUOTE (POINTER POINTER POINTER POINTER))
       (QUOTE ((ED 0 POINTER)
               (ED 2 POINTER)
               (ED 4 POINTER)
               (ED 6 POINTER)))
       (QUOTE 8))
(/DECLAREDATATYPE (QUOTE ENTITY)
       (QUOTE ((BITS 8)
               (BITS 8)
               FIXP FIXP WORD WORD WORD WORD WORD WORD WORD))
       (QUOTE ((ENTITY 0 (BITS . 7))
               (ENTITY 0 (BITS . 135))
               (ENTITY 1 FIXP)
               (ENTITY 3 FIXP)
               (ENTITY 5 (BITS . 15))
               (ENTITY 6 (BITS . 15))
               (ENTITY 7 (BITS . 15))
               (ENTITY 8 (BITS . 15))
               (ENTITY 9 (BITS . 15))
               (ENTITY 10 (BITS . 15))
               (ENTITY 11 (BITS . 15))))
       (QUOTE 12))
(DEFINEQ

(DPRESS.FILE
  (LAMBDA (FILE)                                                          (* kbr: 
                                                                          " 4-Sep-84 22:05")
                                                                          (* Return PFD *)
    (PROG (STREAM DD PDES FONTSET FONTSETS FDES PFD)
          (SETQ STREAM (OPENSTREAM FILE (QUOTE INPUT)
                              (QUOTE OLD)))
          (SETQ DDRECORD# (SUB1 (IQUOTIENT (GETFILEINFO STREAM (QUOTE LENGTH))
                                       BytesPerPage)))
          (SETQ DD (DPRESS.DD STREAM DDRECORD#))
          (SETQ PDES (DPRESS.PARTDIR STREAM (fetch (DD PARTDIRRECORD#) of DD)
                            (fetch (DD PARTCOUNT) of DD)))
          (for PDE in PDES when (EQ (fetch (PDE $TYPE) of PDE)
                                    (QUOTE FONTDIR))
             do (SETQ FDES (DPRESS.FONTSET STREAM (fetch (PDE RECORD#) of PDE))) 
                                                                          (* Not sure about the 
                                                                          proper way to get font 
                                                                          set number *)
                (SETQ FONTSET (create FONTSET
                                     NUMBER ←(fetch (FDE FONTSET) of (CAR FDES))
                                     PDE ← PDE
                                     FDES ← FDES))
                (push FONTSETS FONTSET))
          (SETQ FONTSETS (DREVERSE FONTSETS))
          (SETQ PFD
           (create PFD
                  FILE ← FILE
                  STREAM ← STREAM
                  DD ← DD
                  PDES ← PDES
                  FONTSETS ← FONTSETS))
          (RETURN PFD))))

(DPRESS.DD
  (LAMBDA (STREAM RECORD#)                                             (* edited: 
                                                                       " 8-Feb-86 09:27")
                                                                       (* DPRESS Document 
                                                                       Directory *)
    (PROG (DD)
          (SETQ DD (create DD))
          (SETFILEPTR STREAM (ITIMES 512 RECORD#))
          (for I from 0 to 511 do (\PUTBASEBYTE DD I (\BIN STREAM)))
          (RETURN DD))))

(DPRESS.PARTDIR
  (LAMBDA (STREAM RECORD# PARTCOUNT)                                      (* kbr: 
                                                                          " 4-Sep-84 22:05")
                                                                          (* Return list of Part 
                                                                          Directory Entries *)
    (PROG (PDE PDES)
          (\SETFILEPTR STREAM (ITIMES RECORD# BytesPerPage))
          (for I from 1 to PARTCOUNT do (SETQ PDE (create PDE))
                                        (\BINS STREAM PDE 0 8)
                                        (push PDES PDE))
          (SETQ PDES (DREVERSE PDES))
          (RETURN PDES))))

(DPRESS.FONTSET
  (LAMBDA (STREAM RECORD#)                                                (* kbr: 
                                                                          " 4-Sep-84 22:05")
                                                                          (* Return list of Font 
                                                                          Directory Entries *)
    (PROG (FDE FDES)
          (\SETFILEPTR STREAM (ITIMES RECORD# BytesPerPage))
          (for I from 1 to 16 do (SETQ FDE (create FDE))
                                 (\BINS STREAM FDE 0 32)
                                 (COND
                                    ((IEQP (fetch (FDE LENGTH) of FDE)
                                           0)                             (* Last FDE is followed 
                                                                          by word containing zero 
                                                                          *)
                                     (RETURN)))
                                 (push FDES FDE))
          (SETQ FDES (DREVERSE FDES))
          (RETURN FDES))))

(DPRESS.PAGE
  (LAMBDA (STREAM PDE)                                                    (* kbr: 
                                                                          " 4-Sep-84 22:05")
                                                                          (* Returns list of EDs.
                                                                          *)
    (PROG (PTR ENTITY ED EDS)
          (SETQ PTR (IPLUS (ITIMES BytesPerPage (IPLUS (fetch (PDE RECORD#) of PDE)
                                                       (fetch (PDE LENGTH) of PDE)))
                           (IMINUS (ITIMES (fetch (PDE PADDING) of PDE)
                                          2))
                           -24))
          (do (COND
                 ((ILESSP PTR 0)                                          (* No more entities *)
                  (RETURN)))
              (SETQ ENTITY (create ENTITY))
              (\SETFILEPTR STREAM PTR)
              (\BINS STREAM ENTITY 0 24)
              (COND
                 ((IEQP (fetch (ENTITY EWORDLENGTH) of ENTITY)
                        0)                                                (* No more entities *)
                  (RETURN)))
              (SETQ ED (create ED
                              ENTITY ← ENTITY
                              ELOCATION ←(IPLUS PTR 24 (IMINUS (ITIMES 2 (fetch (ENTITY EWORDLENGTH)
                                                                            of ENTITY))))
                              DLOCATION ←(IPLUS (ITIMES 512 (fetch (PDE RECORD#) of PDE))
                                                (fetch (ENTITY DLOCATION) of ENTITY))))
              (push EDS ED)
              (SETQ PTR (IDIFFERENCE PTR (ITIMES 2 (fetch (ENTITY EWORDLENGTH) of ENTITY)))))
          (RETURN EDS))))
)
(PUTPROPS DPRESS COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (4921 13635 (DPRESS.COMMANDS 4931 . 5764) (DPRESS.COMMANDS.PASS1 5766 . 6691) (
DPRESS.COMMAND.PASS1 6693 . 9313) (\WIN 9315 . 9562) (\DWIN 9564 . 9814) (DPRESS.COMMANDS.PASS2 9816
 . 10700) (DPRESS.COMMAND.PASS2 10702 . 13633)) (33278 39252 (DPRESS.FILE 33288 . 35060) (DPRESS.DD 
35062 . 35612) (DPRESS.PARTDIR 35614 . 36329) (DPRESS.FONTSET 36331 . 37459) (DPRESS.PAGE 37461 . 
39250)))))
STOP