Trailing-Edge
-
PDP-10 Archives
-
TRAFFIC-20_V4_840514
-
traffic-source/tfrunv.mac
There are 2 other files named tfrunv.mac in the archive. Click here to see a list.
UNIVERSAL TFRUNV - UNIVERSAL FOR TRAFFIC-20
; *** COPYRIGHT (C) 1982 DIGITAL EQUIPMENT CORP, MAYNARD, MASS ***
IF1 <PRINTX TRAFFIC-20 VERSION 4 UNIVERSAL FILE>
;
;EDIT HISTORY - THIS VERSION OF TRAFFIC-20 IS DERIVED FROM VERSION 2A,
;AND TWO INTERMEDIATE VERSION 3'S. THE EDIT TRAIL FOR THIS VERSION WILL
;START AT LEVEL 200 AND ALL PREVIOUS PATCHES ARE ASSUMED TO BE INCLUDED.
;
;
;EDIT WHO WHEN WHAT WHY
;----- ------ ------ ------ ---------------------------------------
; 200 C.GILL AUG 82 ALL NEW VERSION OF TRAFFIC-20
CUSTVR==0 ;CUSTOMER VERSION
DECVER==4 ;DEC VERSION
DECMVR==0 ;MINOR VERSION
DECEVR==200 ;EDIT LEVEL
V%TFR==:<CUSTVR>B2!<DECVER>B11!<DECMVR>B17!DECEVR
;
;DATA FILE LAYOUT - THE DATA FILE CONSISTS OF A HEADER FOLLOWED BY A
;NUMBER OF FIELD DATA AREAS. BOTH THE HEADER AND THE FIELD DATA AREAS
;CONSIST OF A FIXED PORTION AND A VARIABLE PORTION WHICH DEPENDS ON
;THE FORM DEFINITION. THE HEADER CONTAINS THE LENGTH OF BOTH ITSELF
;AND THE FIELD DATA AREAS AND ALSO THE NUMBER OF FIELDS.
;
;** NOTE ** BITS 0 - 6 AND 18 - 35 OF THE FIRST WORD MUST BE ZERO.
;
;THE BASIC LAYOUT OF THE HEADER AND FIELD DATA IS AS FOLLOWS:
;
; +---+---------+---------+-----------+-----------+
; | 0 | HDR SIZ | FLD SIZ | 0 | 0
; +---+-------+-+---------+--+---------+----------+
; | VERSION | MAX SECTS |CS| PARAMS | ERR PARM | 1
; +-----------+-----------+--+----+----+--+-------+
; | | ERRLN | MAXLN | MAXCL | 2
; +-----------+-----------+-------+-------+-------+
; | POINTER TO FORM NAME | POINTER TO STRINGS | 3
; +--------+--------------+-+---------------------+
; | TERM | INDEX FIELD | MAX. FIELD NUMBER | 4
; +-------++------+-------+-+-----+----------+----+
; | LOROW | HIROW | COUNT | COUNT | SECT NO. | NF | 5
; +-------+-------+-------+-------+----------+----+
; | FIRST HIDDEN SECTION MASK | 6
; +-----------------------------------------------+
;
;
; +-----------------------+-----------------------+
; | STATIC PARAMETERS | 0
; +-----------------------+-----------------------+
; | DYNAMIC PARAMETERS | 1
; +---------------+-------+--+----------+---------+
; | OFFSET | LENGTH | COLUMN | LINE | 2
; +------+--------+---------++----------+---------+
; | | TYPE | HLP LEN | FILLER | NUMRD. | 3
; +------+--------+-------+-+-----------+---------+
; | POINTER TO FIELD NAME | POINTER TO VALUE | 4
; +-----------------------+-----------------------+
; | LOWER RANGE POINTER | UPPER RANGE POINTER | 5
; +-----------------------+-----------------------+
; | POINTER TO HELP TEXT | POINTER TO TEXT STR. | 6
; +------+--------+-------++---------+------------+
; | TXTLEN | TXTCOL | TXTLIN | TXT ATTRIB | 7
; +------+-----+--+-------++---------+------------+
; | VET NUMBER | SUB FLAG | POINTER TO SUBFIELDS | 10
; +------------+----------+-----------------------+
; | FIRST SECTION MASK WORD | 11
; +-----------------------------------------------+
;
.FLDLN==^D9 ;LENGTH OF FIELDS WITHOUT SECTION INFO
.FRMLN==^D6 ;LENGTH OF HEADER WITHOUT SECTION INFO
HDRWRD=604000 ;ADDRESS OF HEADER
MULTSC=HDRWRD+5 ;MULTIPLE SECTION WORD
STRING=635000 ;ADDRESS OF STRING DATA
.DATA=HDRWRD+.FRMLN ;LOWEST ADDRESS OF FIELD DATA
;
;FORM PARAMETERS - THE FOLLOWING ARE THE PARAMETERS APPLICABLE TO BOTH
;THE FORM AND THE ERROR LINE.
;
%FRVRS==1B35 ;REVERSE VIDEO
%FBLNK==1B34 ;BLINKING
%FBOLD==1B33 ;BOLD
%FUNDR==1B32 ;UNDERSCORE
%ALIGN==1B31 ;FIELDS ARE WORD ALIGNED
%CSUS==0 ;US (SHIFT 3 = HASH SIGN)
%CSUK==1 ;UK (SHIFT 3 = POUND SIGN)
%CSGR==2 ;GRAPHIC SET
%CSAL==3 ;ALTERNATE SET
;
;TERMINAL TYPES - THE FOLLOWING TERMINALS ARE SUPPORTED BY TRAFFIC-20.
;THE VT100 REPRESENTS THE WHOLE FAMILY.
;
%VTALL==0
%VT05==1
%VT50H==2
%VT52==3
%VT100==4
%VT132==5
;DATE TYPE NUMBERS
%DATCA==0 ;DATE CANADA
%DATCB==1 ;DATE COBOL
%DATDA==2 ;DATE DASH
%DATDE==3 ;DATE DEC
%DATJU==4 ;DATE JULIAN
%DATMI==5 ;DATE MILITARY
%DATSL==6 ;DATE SLASH
%LONGD==40 ;LONG FORMAT DATE
;
;FIELD PARAMETERS - THE FOLLOWING PARAMETERS ARE HELD IN BOTH THE FIELD
;STATIC AND DYNAMIC PARAMETER AREAS, AND THE LEFT-HALF IS ALSO USED AS
;THE CHARACTER ATTRIBUTE MASK.
;
%LOWER==1B35 ;LOWER CASE ALLOWED IN FIELD
%RANGL==1B34 ;LOWER RANGE DEFINED
%RANGU==1B33 ;UPPER RANGE DEFINED
%RANGE==%RANGL+%RANGU
%NUMER==1B32 ;NUMERIC CHARACTERS ALLOWED
%ALPHA==1B31 ;ALPHABETIC CHARACTERS ALLOWED
%ZERO==1B30 ;FILL WITH LEADING ZEROS (NUMERIC)
%SPACE==1B30 ;FILL WITH LEADING SPACES (ALPHA)
%PUNCT==1B29 ;PUNCTUATION CHARACTERS ALLOWED
%CLASS==%PUNCT+%NUMER+%ALPHA
%DATE==1B28 ;FIELD IS A DATE FIELD
%YN==1B27 ;FIELD ACCEPTS ONLY 'Y' OR 'N'
%MONEY==1B26 ;MONEY FIELD
%TYPE==%DATE+%YN+%MONEY
%PRDUP==1B25 ;PREVIOUS DUPED FIELD
%MSDUP==1B24 ;MASTER DUPED FIELD
%DUPE==%PRDUP+%MSDUP
%PROT==1B23 ;PROTECTED FIELD
%FULL==1B22 ;FIELD MUST BE FILLED
%REQD==1B21 ;FIELD IS REQUIRED
%ATRIB==%PROT+%FULL+%REQD
%SIGND==1B20 ;LEADING SIGN IS ALLOWED
%RJUST==1B19 ;RIGHT JUSTIFY
%NAUTO==1B18 ;FIELD IS NOT AUTO TAB ON FILL
;LEFT HALF
%MULT==1B17 ;MULTIPLE FIELD (SCROLLED)
%INDEX==1B16 ;THIS IS THE INDEX FIELD
%DFDT==1B15 ;DEFAULT DATE FIELD
%TEXT==1B14 ;FIELD HAS PROTECTED TEXT
%HELP==1B13 ;FIELD HAS A HELP MESSAGE
%HIDE==1B12 ;FIELD (SECTION) IS HIDDEN
%NEKO==1B11 ;FIELD IS SECURE (NO ECHO)
%DSPLY==1B10 ;FIELD IS DISPLAYED
%SFDEF==1B9 ;FIELD IS A DESCRIPTOR
;CHARACTER ATTRIBUTES
%RVRS==1B8 ;REVERSE VIDEO
%BLNK==1B7 ;BLINKING
%BOLD==1B6 ;BOLD
%UNDR==1B5 ;UNDERSCORE
%WIDE==1B4 ;DOUBLE WIDTH (SO IS WHOLE LINE)
%TALL==1B3 ;DOUBLE HEIGHT (TAKES TWO LINES)
%GRAPH==1B2 ;GRAPHIC CHARACTER SET (PER FIELD)
%REND==%RVRS+%BLNK+%BOLD+%UNDR+%WIDE+%TALL+%GRAPH
%VERT==1B0 ;VERTICAL
;
;SUBFIELD SPECIFICATION - A FIELD WHICH IS DIVIDED INTO SUBFIELDS
;WILL HAVE A SUBFIELD DESCRIPTOR STRING STORED IN THE STRING AREA
;OF THE FORM FILE. DESCRIPTORS ARE STRINGS OF 9-BIT BYTES TERMINATED
;BY A ZERO BYTE. THE GENERAL FORMAT OF EACH BYTE IS:
;
; +------+------------------+
; | TYPE | DATA |
; +------+------------------+
;
;WHERE,
; TYPE IS THE TYPE OF THE DATA IN THE BYTE, IT IS TWO BITS:
%SFLEN==400 ;DATA IS SUBFIELD LENGTH
%SFSEP==200 ;DATA IS SEPARATOR CHARACTER
%SFEND==0 ;END IF DATA=0, ELSE SUBFIELD FLAGS
; DATA CONTAINS FLAGS, A SEPARATOR CHARACTER, OR THE LENGTH
; OF THE SUBFIELD. IF THE DATA IS FLAGS, THEN THE VALUES
; ARE AS FOLLOWS:
%SFLGL==170 ;MASK FOR LEGAL CHARACTERS FIELD
%T.PUN==%PUNCT ;PUNCTUATION ALLOWED
%T.ALP==%ALPHA ;ALPHABETIC CHARACTERS ALLOWED
%T.SPC==%SPACE ;SPACE ALLOWED
%T.ZER==%NUMER+%ZERO ;LEADING ZEROS (SAME AS %SPACE)
%T.DIG==%NUMER ;DIGIT ALLOWED
%SFTYP==7 ;SUBFIELD TYPE MASK
%T.MIN==1 ;MINUTES/SECONDS (0 TO 59 ONLY)
%T.HOR==2 ;HOURS (0 TO 23 ONLY)
%T.DAY==3 ;DAYS (1 TO 31 ONLY - FURTHER TESTING IF DATE)
%T.MON==4 ;MONTH (SEE BELOW)
%T.YER==5 ;YEAR (0 TO 99 ONLY)
%T.JUL==6 ;JULIAN DAYS (1 TO 366 ONLY)
;
;THESE ARE COMBINED IN CERTAIN STANDARD GROUPS:
;
; NAME CONTAINS RANGE LENGTH
; ------------------ ------------- ------- ------
%T.D==%T.DAY+%T.ZER ;DAYS 1 TO 31 2
%T.JD==%T.JUL+%T.ZER ;JULIAN DAYS 1 TO 366 3
%T.NM==%T.MON+%T.ZER ;MONTH (NUM) 1 TO 12 2
%T.AM==%T.MON+%T.ALP ;MONTH (ALP) JAN-DEC 3
%T.Y==%T.YER+%T.ZER ;YEAR 0 TO 99 2
%T.H==%T.HOR+%T.ZER ;HOUR 0 TO 23 2
%T.MS==%T.MIN+%T.ZER ;MIN/SEC 0 TO 59 2
%T.X==%T.ALP+%T.DIG ;ANY
;
;A SUBFIELD DESCRIPTOR IS NORMALLY OF THE FORM:
;
; <LENGTH><TYPE OR SEPARATOR><LENGTH><TYPE OR SEPARATOR>...<0>
;
;IF THE LENGTH IS ONE, THIS BYTE MAY BE OMITTED, EG,
;
; <TYPE OR SEPARATOR><TYPE OR SEPARATOR>...<0>
;
;A DESCRIPTOR MAY BE A MIXTURE OF EITHER OF THE ABOVE FORMATS. IF,
;HOWEVER, THE LENGTH BYTE IS OMITTED WITH CERTAIN TYPE BYTES, THEN
;THE LENGTH IS ASSUMED TO BE THE NUMBER SHOWN IN THE ABOVE TABLE.
;
;WHEN A FIELD CONTAINS SUBFIELDS, THE OVERALL TYPE IS ASSUMED TO BE
;ALPHANUMERIC, AND INDIVIDUAL SUBFIELDS ARE PARSED ACCORDING TO THE
;TYPE BYTES. THESE TYPE BYTES CANNOT BE CHANGED WITH TFRCHG.
;
;IF THERE IS ONLY ONE SUBFIELD, THEN THE FIELD TYPE IS TAKEN FROM
;.SPARM AND THE SUBFIELD DESCRIPTOR, IF PRESENT, IS IGNORED.
;
;IN THE EVENT THAT TWO SEPARATOR BYTES FOLLOW EACHOTHER, THEY WILL
;BE ASSUMED TO BE ALTERNATIVES WHEN JUSTIFYING THE SUBFIELD ON DEMAND.
;THUS, EITHER '.' OR ',' COULD BE USED TO CAUSE THE FIRST SUBFIELD
;TO BE JUSTIFIED IN THE FOLLOWING,
;
; <%SFLEN+4><%T.DIG><%SFSEP+"."><%SFSEP+","><%SFLEN+2><%T.DIG><0>
;
;
;BYTE POINTERS - THE FOLLOWING POINTERS ARE DEFINED SO THAT ALL DATA
;CAN BE RETRIEVED FROM THE HEADER AND FIELD AREAS OF THE FORM FILE.
;
DEFINE PTR(TAG,LEN,BIT,OFF)
<
TAG: POINT LEN,OFF,BIT
>
DEFINE PTRGEN
<
; PTR TAG ,LN,BT,OFF
PTR .HDSIZ,05,11,HDRWRD+0 ;HEADER SIZE
PTR .FDSIZ,06,17,HDRWRD+0 ;FIELD DATA SIZE
PTR .VERSN,09,08,HDRWRD+1 ;VERSION NUMBER
PTR .MXSEC,09,17,HDRWRD+1 ;MAX SECTION NUMBER
PTR .CSET,02,19,HDRWRD+1 ;CHARACTER SET
PTR .FPARM,08,27,HDRWRD+1 ;FORM PARAMETERS
PTR .EPARM,08,35,HDRWRD+1 ;ERROR LINE PARAMETERS
PTR .ERRLN,05,22,HDRWRD+2 ;ERROR LINE NUMBER
PTR .MAXLN,05,27,HDRWRD+2 ;MAXIMUM LINE NUMBER
PTR .MAXCL,08,35,HDRWRD+2 ;MAXIMUM COLUMN NUMBER
PTR .FORMN,18,17,HDRWRD+3 ;POINTER TO FORM NAME
PTR .STRPT,18,35,HDRWRD+3 ;POINTER TO STRINGS
PTR .TERMS,12,11,HDRWRD+4 ;TERMINALS ALLOWED
PTR .INDEX,12,23,HDRWRD+4 ;INDEX FIELD NUMBER
PTR .NMFLD,12,35,HDRWRD+4 ;NUMBER OF FIELDS IN FORM
PTR .MLLOR,05,04,HDRWRD+5 ;TOP ROW OF MULT SECT
PTR .MLHIR,05,09,HDRWRD+5 ;LOW ROW OF MULT SECT
PTR .MLTDC,05,14,HDRWRD+5 ;ROW COUNT FOR MULT SECT
PTR .MLTRC,07,21,HDRWRD+5 ;REPEAT COUNT FOR MULT SECT
PTR .MLSEC,10,31,HDRWRD+5 ;MULTIPLE SECTION NUMBER
PTR .MLFCT,04,35,HDRWRD+5 ; # FIELDS IN MULT SECT
PTR .HIDSC,36,35,HDRWRD+6 ;FIRST HIDDEN SECTION MASK
;;POINTERS TO FIELD DATA
PTR .SPARM,36,35,0 ;STATIC PARAMETERS
PTR .DPARM,36,35,1 ;DYNAMIC PARAMETERS
PTR .OFFST,15,14,2 ;OFFSET TO FIELD IN DATA
PTR .LENG,08,22,2 ;TOTAL LENGTH OF FIELD
PTR .COLM,08,30,2 ;STARTING COLUMN NUMBER
PTR .LINE,05,35,2 ;LINE NUMBER
PTR .TYPE,06,13,3 ;SUBFIELD TYPE (USED BY TFR)
PTR .LNHLP,07,20,3 ;LENGTH OF HELP STRING
PTR .FILLR,07,27,3 ;FILLER CHARACTER (ASCII)
PTR .NUMRD,08,35,3 ;NUMBER OF CHARACTERS READ
PTR .FIELD,18,17,4 ;POINTER TO FIELD NAME
PTR .VALUE,18,35,4 ;POINTER TO VALUE
PTR .LRANG,18,17,5 ;POINTER TO LOWER RANGE
PTR .URANG,18,35,5 ;POINTER TO UPPER RANGE
PTR .HELP,18,17,6 ;POINTER TO HELP MESSAGE
PTR .TXTPT,18,35,6 ;POINTER TO TEXT STRING
PTR .TLENG,14,13,7 ;TEXT LENGTH
PTR .TCOLM,08,21,7 ;TEXT STARTING COLUMN
PTR .TLINE,05,26,7 ;TEXT LINE
PTR .TPARM,09,35,7 ;TEXT PARAMETERS
PTR .VETNO,09,08,10 ;VET ROUTINE NUMBER (1 TO 511)
PTR .SFSEP,09,17,10 ;SUB FIELD FLAGS
PTR .SFDES,18,35,10 ;SUB FIELD DESCRIPTOR POINTER
PTR .SECTN,36,35,11 ;FIRST SECTION MASK WORD
>
;
;The following values define table lengths in TFR and TFRCOB and are
;set up here for reference.
;
FLDTLN==^D31 ;FIELD HASHING TABLE LENGTH
DF%SEC==^D72 ;DEFAULT NUMBER OF SECTIONS
MX%SEC==^D360 ;MAXIMUM NUMBER OF SECTIONS
WD%DSC==<DF%SEC+^D35>/^D36 ;NUMBER OF WORDS PER DEFAULT
WD%MSC==<MX%SEC+^D35>/^D36 ;NUMBER OF WORDS FOR MAXIMUM
MX%CHG==^D30 ;MAXIMUM NUMBER OF CHANGE ATTRIBUTES
MX%INC==^D25 ;MAXIMUM NUMBER OF NESTED INCLUDE FILES
END