DIRECTORY Rope; U255: DEFINITIONS = BEGIN Encode: PROCEDURE [INTEGER] RETURNS [INTEGER]; Decode: PROCEDURE [INTEGER] RETURNS [INTEGER]; BitOp: TYPE = PROC [a, b: UNSPECIFIED] RETURNS [UNSPECIFIED]; And: BitOp; Shift: BitOp; Or: BitOp; Swab: PROC [a: UNSPECIFIED] RETURNS [UNSPECIFIED]; Byte: TYPE = [0..377B]; BTab: TYPE = RECORD [d: PACKED SEQUENCE length: CARDINAL OF Byte]; WTab: TYPE = RECORD [d: SEQUENCE length: CARDINAL OF INTEGER]; Offset: CARDINAL = 2048; OffToInt: PROC [i: CARDINAL] RETURNS [INTEGER]; IntToRJInt: PROC [i: INTEGER] RETURNS [INTEGER]; WriteBitsFile: PROC [name: Rope.ROPE, data: REF ANY, byteSwap: BOOL _ FALSE] RETURNS [BOOL]; WriteTableFile: PROC [name: Rope.ROPE, data: REF ANY, byteSwap: BOOL _ FALSE] RETURNS [BOOL]; END. September 20, 1979 3:46 PM, Stewart, created 12-Jan-82 11:38:54, Stewart, Cedar U255.mesa u-255 law conversion Takes 12 bit linear pcm and converts to u-255 8-bit and back. L. Stewart, last updated: May 8, 1982 8:05 pm L. Stewart, last updated: June 12, 1983 3:19 pm Encode expects a left justified 12 bit two's complement integer and will return a right justified 8 bit u255 value; Decode expects a right justified 8 bit u255 value and will return a left justified 12 bit two's complement value; Other useful stuff convert an offset two's complement value (IN [0..4095]) to a left justified two's complement value ( IN [-2048*16..2047*16] ) Convert a left justified two's complement value to a right justified value arithmetic right shift by 4 takes a file name and either a REF WTab or a REF BTab and writes the data to the file in binary. If byteSwap is TRUE, swaps bytes of word tables, byte tables are unaffected. takes a file name and either a REF WTab or a REF BTab and writes the data to the file in the form of a bcpl table. Since tables are written as word tables, swaps bytes for either byte or word tables. ʘJšœ ™ Jšœ™Jšœ=™=Jšœ-™-Jšœ/™/J˜šÏk ˜ J˜J˜—šœ œ˜J˜—Jšœs™sJš Ïnœ œœœœ˜.J˜Jšœq™qJš žœ œœœœ˜.J˜Jšœ™J˜Jš žœœœ œœ œ˜=J˜J˜ J˜ J˜ J˜Jš žœœ œœ œ˜2J˜Jšœœ ˜Jš œœœœœ œœ˜BJš œœœœ œœœ˜>Jšœœ˜J˜Jšœ}™}Jš žœœœœœ˜/J˜Jšœf™fJš ž œœœœœ˜0J˜Jšœ®™®Jšž œœ œœœ œœœœ˜\J˜JšœÈ™ÈJšžœœ œœœ œœœœ˜]J˜Jšœ˜Jšœœ˜-J˜"—…—R ‚