File FORMAT.PA (PAL assembler source file)

Directory of image this file is from
This file as a plain text file

/ TEXT OUTPUT FORMATTER TASK			24-JUL-78

	VERS=	2

/
/
/   THIS PACKAGE CONTAINS  AN  RTS/8  TASK  DESIGNED  TO
/   ACCEPT  A  FORTRAN  STYLE  FORMAT STATEMENT AND DATA
/   VALUES, PRODUCE A FORMATTED OUTPUT STRING, AND  SEND
/   THE  OUTPUT TO A SPECIFIED TASK.  THE INPUT DATA CAN
/   BE IN SEVERAL  FORMS:  SINGLE  OR  DOUBLE  PRECISION
/   OCTAL OR BCD, PACKED OR UNPACKED ASCII. THE REQUIRED
/   DATA CONVERSIONS ARE MADE TO CREATE AN ASCII  OUTPUT
/   TEXT STRING IN THE SPECIFIED FORMAT.


/
/EDIT HISTORY:
/
/15-AUG-77: (LHN)
/	1) CREATED THIS DATE.
/21-APR-78: (LHN)
/	1) FIXED PROBLEM WITH "D" OUTPUT SPECIFICATION.
/23-MAY-78: (LHN)   [N1]
/	1) ADDED CONDITIONAL NULL CHARACTER OPTION.



IFNDEF	FRMFLD	<FRMFLD=20>
IFNDEF	FRMLOC	<FRMLOC=200>




	TASK=	FORMAT
	CUR=	FRMFLD
	INIWT=	0





IFNDEF FRMNUL <FRMNUL=0>/[N1] DEFAULT IS NO NULL CHARACTER.
OUTBLN=	122		/LOCAL OUTPUT BUFFER LENGTH.

/ / / GENERAL PROGRAM DESCRIPTION / / / THE FORMAT TASK IS CALLED AT TASK LEVEL BY STANDARD / RTS/8 MESSAGES. THE CALLING MESSAGE SPECIFIES THE / TEXT FORMAT CONTROL, THE FORMAT STATEMENT ADDRESS, / AND THE ADDRESS AND TYPE OF THE INPUT DATA. DETAILS / OF THIS MESSAGE ARE GIVEN BELOW. / / THE FORMAT STATEMENT CONTAINS A DESCRIPTION OF THE / DESIRED OUTPUT TEXT STRING, INCLUDING SPACING, / NUMERIC FORMAT, SPECIAL TEXT AND CONTROL CHARACTERS. / THIS STATEMENT IS AN ASCII TEXT STRING (AS GENERATED / BY THE "TEXT" PSEUDO-OP). DETAILS OF THE FORMAT / STATEMENT ARE GIVEN BELOW. / / THE INPUT DATA TO THE FORMATTER CAN BE ONE OR MORE / OF THE FOLLOWING FORMS: OCTAL, BINARY CODED DECIMAL, / ASCII, PACKED, UNPACKED, SINGLE OR DOUBLE PRECISION. / THE CALLING MESSAGE CAN CONTAIN EITHER THE INPUT / DATA ITSELF OR THE LOCATION OF THE INPUT DATA. / DETAILS OF THE DATA ARGUMENTS ARE GIVEN BELOW. / / WHILE THE INPUT DATA MAY BE IN OCTAL, BCD OR ASCII, / THE ONLY MODE CONVERSION INCLUDED HERE IS SINGLE OR / DOUBLE PRECISION OCTAL TO DECIMAL. UP TO 8 DIGITS / CAN BE CONVERTED. THE OCTAL AND ASCII OUTPUT MODES / ARE SIMILAR IN FUNCTION, HOWEVER OCTAL OUTPUT IS / CURRENTLY LIMITED TO 8 DIGITS, WHERE THE LIMIT FOR / ASCII OUTPUT IS THE LENGTH OF THE OUTPUT BUFFER. / LEADING ZERO SUPPRESSION APPLIES ONLY TO OCTAL AND / DECIMAL OUTPUT SPECIFICATIONS. / / THE FORMATTER SENDS THE GENERATED OUTPUT STRING TO / THE TASK SPECIFIED IN THE FORMAT CONTROL WORD, AS A / STANDARD RTS/8 MESSAGE. A "SENDW" IS USED TO TRANS- / MIT THE OUTPUT, REQUIRING THE RECEIVING TASK TO POST / THE FORMATTER'S MESSAGE. THE CALLING TASK'S MESSAGE / IS POSTED AFTER THE FORMATTED STRING (OR STRINGS) / HAS BEEN ACCEPTED BY THE SPECIFIED RECEIVING TASK. / THEREFORE, IF THE CALLING TASK WANTS TO RECEIVE THE / FORMATTED OUTPUT, IT MUST SEND THE REQUEST TO THE / FORMATTER VIA A "SEND" DIRECTIVE AND NOT A "SENDW". /
/ / / CALLING MESSAGE FORMAT: / / /FORMSG, ZBLOCK 3 RTS8 OVERHEAD / FORMAT CONTROL WORD / FORMAT ADDRESS / OUTPUT BUFFER FIELD (OPTIONAL) / OUTPUT BUFFER ADDRESS (OPTIONAL) / INPUT DATA TYPE (1) / INPUT DATA ADDRESS (1) / . . . / . . . / . . . / INPUT DATA TYPE (N) / INPUT DATA ADDRESS (N) / MESSAGE TERMINATOR / / / / /WHERE: / / / FORMAT CONTROL WORD / / BITS 0-2 FIELD OF THE FORMAT STATEMENT / / BIT 3 OUTPUT BUFFER PACKING / 0 = 2 CHARACTERS PER WORD (PACKED) / 1 = 1 CHARACTER PER WORD (UNPACKED) / / BIT 4 OUTPUT BUFFER LOCATION / 0 = RTS8 MESSAGE TO DESTINATION / TASK USING LOCAL BUFFER / 1 = USE SPECIFIED BUFFER LOCATION / / BITS 5-11 TASK NUMBER TO RECEIVE OUTPUT / / / FORMAT ADDRESS ADDRESS OF THE FORMAT CONTROL TEXT / STATEMENT / / / / OUTPUT BUFFER FIELD THESE TWO WORDS ARE OPTIONAL AND / OUTPUT BUFFER ADDRESS ARE INCLUDED ONLY IF THE CALLING / TASK WANTS TO SPECIFY THE BUFFER / AREA FOR THE FORMATTED OUTPUT. THE / BUFFER FIELD MUST BE IN BITS 0-2. / UNDER RTS/8 THROUGH V2B, THE OUTPUT / BUFFER MUST BE IN THE SAME FIELD AS / THE FORMATTER OR THE RECEIVING TASK / MUST KNOW THE FIELD OF THE BUFFER.
/ / / CALLING MESSAGE FORMAT, CONTINUED / / / INPUT DATA TYPE THIS WORD DESCRIBES THE TYPE OF THE / INPUT DATA AND FORMATTING ARGUMENTS / / BITS 0-2 FIELD OF THE INPUT DATA / / BITS 3-4 UNUSED AT PRESENT / / BIT 5 CONTIGUOUS INPUT DATA / / BIT 6 LEADING ZERO SUPPRESSION / 0 = SUPPRESS LEADING ZEROES / 1 = PRINT LEADING ZEROES / / BIT 7 DATA ORDER OR SIGNIFICANCE / 0 = DATA IN ASCENDING ORDER / 1 = DATA IN DESCENDING ORDER / / BIT 8 INPUT ADDRESS MODE / 0 = ADDRESS WORD IS POINTER TO DATA / 1 = ADDRESS WORD IS THE INPUT DATA / / BIT 9 DIGITS (OR CHARACTERS) PER WORD / 0 = PACKED DATA WHICH ASSUMES: / 2 PER WORD FOR ASCII DATA / 3 PER WORD FOR BCD DATA / 4 PER WORD FOR OCTAL DATA / 1 = 1 DIGIT OR CHARACTER PER WORD / / BITS 10-11 INPUT DATA TYPE / 00 = OCTAL DATA (3 BIT DATA) / 01 = BCD DATA (4 BIT DATA) / 10 = 6 BIT ASCII DATA (6 BIT DATA) / 11 = 8 BIT ASCII DATA (8 BIT DATA) / / / INPUT DATA ADDRESS EITHER THE INPUT DATA (IF BIT 5 OF / THE INPUT DATA TYPE = 1), OR THE / ADDRESS OF THE MOST SIGNIFICANT / WORD OF THE INPUT DATA IF ASCII, OR / THE LEAST SIGNIFICANT WORD OF THE / DATA FOR OCTAL AND BCD INPUT. / / / / MESSAGE TERMINATOR A WORD OF ZEROES TERMINATES THE / FORMAT STATEMENT
/ / / FORMAT STATEMENT SPECIFICATIONS / / / THIS STATEMENT TAKES THE FORM OF A PACKED ASCII / TEXT STRING. THIS IS NORMALLY FORMED BY A "TEXT" / PSEUDO STATEMENT. ALLOWABLE ENTRIES ARE: / / / / SPACE OPTIONAL DELIMITER USED BETWEEN STATEMENT / OR , ARGUMENTS. / / ' ENCLOSES TEXT WITHIN THE FORMAT STATEMENT / WHICH IS TO BE MOVED TO THE OUTPUT STRING. / / NX ADD "N" SPACES TO THE OUTPUT STRING. / / NT ADD SPACES TO THE OUTPUT UNTIL THE NEXT / CHARACTER WILL BE PLACED IN COLUMN "N" OF / THE OUTPUT STRING. / / / MULTIPLE OUTPUT LINE CONTROL. EACH TIME A / "/" IS ENCOUNTERED, THE CONTENTS OF THE / OUTPUT BUFFER ARE SENT TO THE DESTINATION / TASK, AND THE OUTPUT BUFFER IS RESET. / MULTIPLE "/"'S GENERATE BLANK LINES. / / ND MOVE "N" DECIMAL DIGITS TO THE OUTPUT / STRING BASED UPON THE INPUT DATA SPECIFIED. / IF THE INPUT DATA IS IN OCTAL, IT IS FIRST / CONVERTED TO DECIMAL, THEN MOVED TO THE / OUTPUT STRING. UP TO 8 DIGITS OF DATA CAN / BE PROCESSED. IF "N" IS GREATER THAN 8, / LEADING SPACES WILL BE ADDED TO SATISFY "N". / / NO MOVE "N" OCTAL DIGITS TO THE OUTPUT STRING / BASED UPON THE INPUT DATA SPECIFIED. UP TO / 8 DIGITS CAN BE PROCESSED. IF "N" IS / GREATER THAN 8, LEADING SPACES WILL BE / ADDED TO SATISFY "N". / / NA MOVE "N" ASCII CHARACTERS FROM INPUT DATA / TO THE OUTPUT STRING. / / / / NOTE: "N" IS A D E C I M A L NUMBER !!!
/ / / DESIGN CRITERIA AND DATA RESTRICTIONS / /
/ / / THE FOLLOWING EXAMPLE IS TO QUIDE USER / UNDERSTANDING / AND DOES NOT DEMONSTRATE ALL THE INPUT/OUTPUT / COMBINATIONS OF THE ABOVE SPECIFICATIONS. / / / CAL / SENDW / FORMAT / MSG1 / / /MSG1, ZBLOCK 3 / CUR^100+LPT /FORMAT STATEMENT IS IN THE / /CURRENT FIELD, SEND OUTPUT / /TO THE LPT TASK, USING THE / /FORMATTER'S LOCAL BUFFER. / FORM1 /ADDRESS OF THE FORMAT / /STATEMENT. / CUR^100+0002 /ASCII DATA IN THIS FIELD. / ASCII /DATA ADDRESS ** / CUR^100+0044 / / OCTAL / CUR^100+0010 / / 0123 / 0 / / /FORM1, TEXT "4A' IS'/4O' IN ASCII OR'/4D' IN DECIMAL'" / /ASCII, TEXT /0123/ / / 260 / 261 / 262 /OCTAL, 263 / / / WILL GENERATE: / / / 0123 IS / 0123 IN ASCII OR / 83 IN DECIMAL / /
/ / / RECEIVE THE CONTROL MESSAGE AND INITIALIZE TASK / / FIELD FRMFLD%10 *FRMLOC START, CLB CAL /GO TO SLEEP 'TIL WE'RE NEEDED. RECEIVE MADDR, 0 /ADDRESS OF THE INPUT MESSAGE. DCA CDFMSG /SAVE CDF TO THE FIELD OF MESSAGE. AC7775 /SAVE THE ADDRESS OF THE MESSAGE'S TAD MADDR / EVENT FLAG FOR POSTING. DCA MSGEVF JMS INITFM /GO INITIALIZE THE FORMAT INPUTTER. JMS I (INITOU) /GO INITIALIZE THE OUTPUT CODE. JMP I (DOFORM) /GO PROCESS THE FORMAT STATEMENT. / / / FORMATTER EXIT SEQUENCE / / FRMXIT, CLB /FIRST GO CLOSE THE OUTPUT BUFFER JMS I (OCLOSE) / AND SEND IT TO THE SPECIFIED / DESTINATION TASK. TAD CDFMSG /GET THE CDF TO THE MESSAGE FIELD. DCA FRMX1 TAD MSGEVF /GET THE ADDRESS OF THE MESSAGE'S CAL / EVENT FLAG AND GO POST IT. POST FRMX1, 0 JMP START /NOW GO BACK FOR THE NEXT MESSAGE. MSGEVF, 0 /ADDRESS OF THE MESSAGE EVENT FLAG.
/ / / INITIALIZE THE FORMAT TEXT INPUTTER / / INITFM, 0 JMS GETMSG /GO GET THE FIRST 2 MESSAGE WORDS. OUTCRL /(OUTPUT CONTROL WORD) TXTFLD /(FIELD OF THE FORMAT TEXT) TXTADR /(ADDRESS OF THE FORMAT TEXT) TAD (GETF1) /RESET THE FORMAT INPUT ROUTINE TO DCA GETF2 / THE FIRST CHARACTER SEQUENCE. DCA I (INCONT) /RESET THE CONTIGUOUS INPUT DATA JMP I INITFM /FLAG AND RETURN. / / / GET A CHARACTER FROM THE FORMAT STATEMENT / / GETFRM, 0 CLB TXTFLD, HLT /CDF TO FIELD OF FORMAT STATEMENT. TAD I TXTADR /GET THE NEXT WORD OF THE FORMAT. CDF CUR JMP I GETF2 /ENTER THE PROPER CHARACTER FETCH / SEQUENCE. GETF1, IFZERO PDP8E+PDP8A < CLL RTR /SHIFT FIRST CHARACTER RIGHT AND RTR RTR > IFNZRO PDP8E+PDP8A <BSW> JMS GETF2 / RETURN IT TO THE CALLER. ISZ TXTADR /INCREMENT FORMAT ADDRESS POINTER. JMS GETF2 /NOW DO THE SECOND CHARACTER. JMP GETF1 /GO BACK TO THE FIRST SEQUENCE. GETF2, GETF1 AND (0077) /MASK OFF UNWANTED BITS. SNA /IS THE NEW CHARACTER A ZERO ? JMP FRMXIT /YES, THE FORMAT IS EXHAUSTED, ALL / DONE, EXIT TO THE CONTROL CODE. TAD (240) /NO, CONVERT THE NEW CHARACTER TO AND (0077) / FULL 8 BIT ASCII, IN CASE WE'RE TAD (240) / PROCESSING IMBEDDED TEXT AND THE / OUTPUT IS IN UNPACKED MODE. JMP I GETFRM /RETURN. TXTADR, 0 /FORMAT STATEMENT ADDRESS POINTER.
/ / / GETMSG - PROCESS THE NEXT 2 WORDS FROM THE INPUT MESSAGE / / / THIS SUBROUTINE READS THE NEXT 2 WORDS FROM THE / INPUT MESSAGE AND SAVES THEM IN THE LOCATIONS / SPECIFIED BY THE 3 ARGUMENTS WHICH FOLLOW THE / CALL. THE FIRST MESSAGE WORD IS USED TO SATISFY / THE FIRST TWO ARGUMENTS. / / THIS ROUTINE ALSO MAINTAINS THE INPUT MESSAGE / ADDRESS POINTER. THIS POINTER AND A CDF TO THE / INPUT MESSAGE FIELD ARE SET UP WHEN THE INPUT / MESSAGE IS RECEIVED. / / CALLING SEQUENCE: / / JMS GETMSG / ADDRESS TO RECEIVE THE CONTROL WORD / ADDRESS TO RECEIVE THE CDF TO DATA POINTER / ADDRESS TO RECEIVE THE DATA POINTER / / GETMSG, 0 TAD I GETMSG /GET THE ADDRESS TO RECEIVE THE ISZ GETMSG / CONTROL WORD LOCALLY. DCA GETMA JMS GETM1 /GO GET THE CONTROL WORD AND SAVE DCA GETMB / IT. TAD GETMB /NOW PUT THE CONTROL WORD AWAY. DCA I GETMA TAD I GETMSG /GET THE ADDRESS TO RECEIVE THE CDF ISZ GETMSG / LOCALLY. DCA GETMA TAD GETMB /FORM A CDF TO THE FIELD SPECIFIED AND (7000) / BY BITS 0-2 OF THE CONTROL WORD, IFZERO PDP8E+PDP8A < CLL RTR RTR RTR > IFNZRO PDP8E+PDP8A <BSW> TAD (CDF) DCA I GETMA / AND PUT IT WHERE THE CALLER SAID. TAD I GETMSG /GET THE ADDRESS TO RECEIVE THE DATA ISZ GETMSG / POINTER LOCALLY. DCA GETMA JMS GETM1 /NOW GET THE NEXT WORD FROM THE DCA I GETMA / MESSAGE, PUT IT AWAY AND JMP I GETMSG / RETURN TO THE CALLER.
/ / / GET THE NEXT WORD FROM THE INPUT MESSAGE / / GETM1, 0 CDFMSG, HLT /WILL BE A CDF TO THE INPUT MESSAGE. TAD I MADDR /GET THE NEXT WORD OF THE MESSAGE, CDF CUR ISZ MADDR / INCREMENT THE MESSAGE POINTER, AND JMP I GETM1 / RETURN. GETMA, 0 /LOCAL TEMPORARIES. GETMB, 0 / / / SINGLE QUOTE FORMAT TYPE (IMBEDDED TEXT) SERVICE ROUTINE / / FRMTXT, CLB JMS GETFRM /GET THE NEXT TEXT CHARACTER FROM / THE FORMAT STATEMENT. TAD (-247) /IS IT A SINGLE QUOTE (TERMINATOR) ? SNA JMP I (DOFORM) /YES, ALL DONE RETURN FOR ANOTHER. TAD (247) /NO, REFORM THE CHARACTER AND JMS I (CHROUT) / GO ADD IT TO THE OUTPUT BUFFER. JMP FRMTXT /GO AROUND AGAIN. / / / "T" FORMAT TYPE SERVICE ROUTINE / / FRMCOL, TAD I (CHRCTR) /ADD IN CURRENT COLUMN POSITION, IAC / PLUS 1, THEN OUTPUT THE REQUIRED / SPACES. / / / "X" FORMAT TYPE SERVICE ROUTINE / / FRMSPC, SMA /TEST FOR NEGATIVE NUMBER OF SPACES! JMP I (DOFORM) /NOT NEGATIVE IS AN ERROR, RETURN. DCA FRMSA /SAVE THE LOOP COUNTER. TAD (240) /GO ADD A SPACE TO THE OUTPUT JMS I (CHROUT) / BUFFER. ISZ FRMSA /DONE ENOUGH SPACES ? JMP .-3 /NO, DO ANOTHER. JMP I (DOFORM) /YES, RETURN TO THE FORMAT SCANNER. FRMSA, 0 /LOCAL TEMPORARY.
/ PAGE
/ / / PROCESS THE FORMAT STATEMENT / / DOFORM, CLB DOF1, DCA FRMARG /CLEAR THE NUMERIC ARGUMENT. DOF2, JMS I (GETFRM) /GET THE NEXT FORMAT CHARACTER AND DCA DOFA / SAVE IT LOCALLY. TAD DOFA TAD (-271) /CAN THE CHARACTER BE A NUMBER ? SMA SZA JMP DOF3 /NO, TRY THE FORMAT TYPE LIST. TAD (11) /NOW, IS THE CHARACTER A NUMBER ? SPA JMP DOF3 /NO, ON TO THE FORMAT TYPE LIST. DCA DOFA /IT REALLY IS A NUMBER, SAVE IT. TAD FRMARG /MULTIPLY PREVIOUS DIGITS BY 10(10), CLL RTL TAD FRMARG CLL RAL TAD DOFA / ADD IN THE NEW DIGIT AND JMP DOF1 / GO TRY THE NEXT CHARACTER. DOF3, CLB TAD (FRMTBL-1) /SET UP A POINTER INTO THE FORMAT DCA DOFB /TYPE DISPATCH TABLE. DOF4, ISZ DOFB TAD I DOFB /GET THE NEXT VALID FORMAT TYPE. ISZ DOFB SNA /IS IT ZERO (TABLE TERMINATOR) ? JMP DOF2 /YES, THEN IGNORE THE INPUT ! TAD DOFA /DOES IT MATCH THE REQUESTED FORMAT? SZA CLA JMP DOF4 /NO, TRY THE NEXT FORMAT TYPE. TAD I DOFB /YES, FOUND A MATCH, GET THE ADDRESS DCA DOFB / OF THE SELECTED FORMAT ROUTINE. TAD FRMARG /GET THE NUMERIC ARGUMENT. SNA /IS IT ZERO ? AC0001 /YES, MAKE IT 1 !!!! CIA /NOW, MAKE IT NEGATIVE, AND JMP I DOFB / GO TO THE FORMAT SERVICE ROUTINE. FRMARG, 0 /FORMAT NUMERICAL ARGUMENT. DOFA, 0 /LOCAL TEMPORARIES. DOFB, 0
/ / / GET AN OCTAL OR BCD NUMBER STRING INTO THE DIGIT BUFFER / / NUMIN, 0 TAD (10) /TEST THAT THE DIGIT COUNT IS WITHIN SPA / OUR BUFFER RANGE. CLB /IT IS NOT, FORCE IT WITHIN RANGE. TAD (-10) /NOW REFORM THE DIGIT COUNTER, AND DCA NUMIA / SAVE IT FOR OUR LOOP COUNTER. TAD (NUMBUF+10) /SET UP AN ADDRESS POINTER TO THE DCA NUMIC / END OF THE BUFFER, SINCE DIGITS / COME IN LEAST SIGNIFICANT FIRST. NUMI1, CLB CMA /DECREMENT THE BUFFER POINTER AS TAD NUMIC / WE GO ALONG. DCA NUMIC JMS I (INCHAR) /GET THE NEXT INPUT DIGIT AND DCA I NUMIC / PUT IT IN THE DIGIT BUFFER. ISZ NUMIA /HAVE WE GOT ALL THE DIGITS ? JMP NUMI1 /NO, GET ANOTHER DIGIT. JMP I NUMIN /DIGIT BUFFER IS SET, RETURN. NUMBUF, ZBLOCK 10 /THE DIGIT BUFFER, IN THE FLESH. NUMIA, 0 /ORIGINAL DIGIT LOOP COUNTER. NUMIB, 0 /WORKING DIGIT LOOP COUNTER. NUMIC, 0 /ORIGINAL DIGIT BUFFER POINTER. NUMID, 0 /WORKING DIGIT BUFFER POINTER.
/ / / MOVE THE DIGIT BUFFER TO THE OUTPUT BUFFER / / / LEADING ZERO SUPRESSION IS ALSO DONE HERE / IF REQUIRED / / NUMOUT, 0 DCA NUMIA /SAVE THE DIGIT LOOP COUNTER. TAD NUMIA /CHECK THAT THE COUNT IS WITHIN OUR TAD (10) / BUFFER RANGE. SMA JMP NUMO1 /DIGIT COUNT IS OK, GO ON. DCA NUMIB /DIGIT COUNT IS TOO LARGE ! TAD (240) /WHEN THE DIGIT COUNT EXCEEDS OUR JMS I (CHROUT) / LIMIT, FILL THE EXCESS WITH ISZ NUMIB / SPACES. JMP .-3 TAD (-10) /SET THE DIGIT COUNTER TO -8(10), DCA NUMIA / OUR CURRENT LIMIT. NUMO1, CLB /USING THE DIGIT LOOP COUNTER, TAD NUMIA / COMPUTE THE LOCATION OF THE FIRST TAD (NUMBUF+10) / DIGIT WE WANT FROM THE DIGIT DCA NUMIC / BUFFER. TAD I (INPCRL) /IS ZERO SUPPRESSION REQUIRED ? AND (0040) SZA CLA JMP NUMO3 /NO, GO ON. CLB IAC /YES, SET UP A LOOP COUNTER 1 LESS TAD NUMIA / THAN THE NUMBER OF DIGITS WE HAVE SNA / IN THE DIGIT BUFFER. JMP NUMO3 /ONLY ONE DIGIT PRESENT, NO CAN DO. DCA NUMIB TAD NUMIC /SET UP A WORKING POINTER TO THE DCA NUMID / DIGIT BUFFER. NUMO2, TAD I NUMID /IS THE NEXT DIGIT A ZERO ? SZA CLA JMP NUMO3 /NO, LEADING ZEROES ARE ALL GONE. TAD (-20) /YES, REPLACE IT WITH A -20, WHICH DCA I NUMID / GENERATE A SPACE LATER. ISZ NUMID ISZ NUMIB /FINISHED SUPPRESSABLE DIGITS ? JMP NUMO2 /NO, LOOK AT THE NEXT DIGIT.
/ NUMO3, TAD I NUMIC /GET THE NEXT DIGIT, TAD (260) / MAKE IT FULL ASCII, AND JMS I (CHROUT) / GO ADD IT TO THE OUTPUT BUFFER. DCA I NUMIC /ZERO THIS DIGIT TO KEEP THE BUFFER ISZ NUMIC / CLEAR. ISZ NUMIA /DIGIT BUFFER EXHAUSTED ? JMP NUMO3 /NO, DO ANOTHER DIGIT. JMP I NUMOUT /ALL DONE, RETURN. PAGE
/ / / INITIALIZE THE DATA INPUT ROUTINES / / INITIN, 0 CLB TAD INCONT /IS THE CONTIGUOUS INPUT FLAG SET ? SZA CLA JMP INITI3 /YES, JUST RESET THE INPUTTER. JMS I (GETMSG) /GO GET THE NEXT 2 MESSAGE WORDS. INPCRL /(INPUT DATA TYPE) INPFLD /(INPUT DATA FIELD) INPADR /(INPUT DATA ADDRESS) TAD (JMS INCH3) /PRESET "INCHAR" TO USE "INPFLD" DCA INCH2 / AND "INPADR" FOR DATA INPUT. TAD INPCRL /GET THE DATA ADDRESS MODE BIT FROM AND (0010) / THE INPUT CONTROL WORD. SNA CLA /IF THE CALLING MESSAGE CONTAINS A JMP INITI1 / POINTER TO THE DATA, THE CDF AND / ADDRESS TO THE DATA WERE SET UP / BY "GETMSG". TAD (JMS I (GETM1)) /THE INPUT DATA IS ACTUALLY IN DCA INCH2 / THE CALLING MESSAGE, SO RESET CLB CMA / "INCHAR" TO USE THE "GETM1" CODE TAD I (MADDR) / TO FETCH THE INPUT DATA. ALSO DCA I (MADDR) / BACK UP THE MESSAGE POINTER SINCE / SINCE WE'RE NOW PAST THE DATA. INITI1, TAD INPCRL /GET THE ASCENDING-DESCENDING BIT AND (0020) / FROM THE INPUT CONTROL WORD. SZA CLA CLB CMA RAL /-2 HERE FOR DECSENDING INPUT DATA. IAC /1 HERE FOR ASCENDING INPUT DATA. DCA ININCR /SAVE IN THE ADDRESS INCREMENT WORD. TAD INPCRL /GET THE INPUT DATA TYPE CODE AND AND (0003) / COMPUTE THE TABLE POSITION FOR DCA INCHA / THE PARAMETERS TO CONFIGURE THE TAD INCHA / INPUTTER CODE FOR THIS DATA TYPE. CLL RTL TAD INCHA TAD (INCTBL) DCA INCHA TAD I INCHA /GET THE DATA MASK PARAMETER. ISZ INCHA DCA INMASK TAD I INCHA /AND THE ROTATE INSTRUCTION FOR ISZ INCHA / EITHER OCTAL OR BCD DATA. DCA INCH8
/ TAD INPCRL /IS DATA PACKED OR UNPACKED ? AND (0004) SNA CLA JMP INITI2 /IT'S PACKED, GO ON. ISZ INCHA /FOR UNPACKED DATA, SKIP THE PACKED CLB CMA / PARAMETERS AND SET "INCHRS" TO -1. SKP INITI2, TAD I INCHA /GET THE CHARACTERS PER PACKED WORD. ISZ INCHA DCA INCHRS TAD I INCHA /AND FINALLY, GET THE ADDRESS OF DCA INSHFT / REQUIRED SHIFT CODE SEQUENCE. TAD INPCRL /GET THE CONTIGUOUS INPUT CONTROL AND (0100) / BIT, IF ANY, AND SAVE IT FOR THE DCA INCONT / NEXT TIME THROUGH. INITI3, TAD (INCH2) /RESET THE INPUTTER CODE TO THE DCA INCH1 / FIRST CHARACTER SEQUENCE. TAD INPCRL /GET THE INPUT DATA TYPE CODE FOR JMP I INITIN / THE CALLER AND RETURN. / / / GET A CHARACTER FROM THE INPUT DATA / / COME HERE TO GET THE NEXT DIGIT OR CHARACTER FROM / THE INPUT DATA. "INITIN" HAS PRESET THIS SUBROUTINE / FOR THE CURRENT INPUT DATA TYPE AND PACKING. / / INCHAR, 0 JMP I INCH1 /ENTER THE NEXT INPUT SEQUENCE. INCH1, INCH2 TAD INCHA /NOW GET THE INPUT DATA WORD AND GO JMP I INSHFT / SHIFT IT AS REQUIRED. INCH2, JMS INCH3 /START OF THE FIRST INPUT SEQUENCE, / GO GET THE NEXT DATA WORD. DCA INCHA /SAVE THE INPUT DATA LOCALLY. TAD ININCR /INCREMENT (OR MAYBE DECREMENT) THE TAD INPADR / INPUT DATA ADDRESS POINTER. DCA INPADR TAD INCHRS /RESET THE LOOP COUNTER FOR THE DCA INCHB / NUMBER OF DATA DIGITS PER WORD. JMS INCH1 /END OF THE FIRST INPUT SEQUENCE. ISZ INCHB /IS THE INPUT DATA WORD EXHAUSTED ? JMP .-2 /NO, LET'S USE IT AGAIN. JMP INCH2 /YES, ON TO THE NEXT INPUT WORD.
/ / / GET THE NEXT WORD OF THE INPUT DATA / / INCH3, 0 INPFLD, HLT /WILL BE CDF TO FIELD OF INPUT DATA. TAD I INPADR /GET THE NEXT WORD FORM THE INPUT, CDF CUR JMP I INCH3 / AND RETURN. / / / SHIFT SEQUENCES FOR THE VARIOUS INPUT TYPES / / / / HERE FOR UNPACKED 8 BIT ASCII INPUT DATA / / INCH4, AND INMASK /MASK OUT USEABLE DATA, AND JMP I INCHAR / RETURN TO OUR CALLER. / / / HERE FOR PACKED ASCII CHARACTER DATA / / INCH5, IFZERO PDP8E+PDP8A < RTL /SHIFT HIGH ORDER CHARACTER AROUND RTL / TO THE LOW ORDER POSITION. RTL > IFNZRO PDP8E+PDP8A <BSW> DCA INCHA /SAVE IT FOR THE NEXT TIME. TAD INCHA IFZERO PDP8E+PDP8A < RAL > /NOW FINISH THE SHIFT. / / / HERE FOR UNPACKED 6 BIT ASCII INPUT DATA / / INCH6, AND (0077) /NOW MAKE THE CHARACTER INTO A FULL TAD (240) / ASCII CHARACTER IN CASE WE'RE AND (0077) / DOING UNPACKED OUTPUT. TAD (240) JMP I INCHAR /RETURN.
/ / / HERE FOR OCTAL AND BCD INPUT DATA / / INCH7, DCA INCHC /SAVE THE DATA FOR A MOMENT. TAD INCHA /SHIFT THE NEXT DIGIT INTO POSITION RTR / FOR THE NEXT TIME THROUGH. INCH8, RAR /(THIS SHIFT DEPENDS ON INPUT TYPE.) DCA INCHA TAD INCHC /GET THE CURRENT DIGIT, INCH9, AND INMASK /MASK OUT THE USEABLE BITS, AND JMP I INCHAR / RETURN TO OUR CALLER. INCHA, 0 /TEMPORARY INPUT DATA STORAGE. INCHB, 0 /DIGITS PER WORD LOOP COUNTER. INCHC, 0 /TEMPORARY STORAGE FOR OCTAL & BCD. INCONT, 0 /CONTIGUOUS INPUT DATA FLAG. INSHFT, INCH5 /ADDRESS OF THE SHIFT SEQUENCE FOR / THIS INPUT TYPE. INMASK, 0377 /BIT MASK FOR THIS DATA TYPE. ININCR, 1 /INPUT ADDRESS INCREMENT (+ OR -). INCHRS, -2 /NUMBER OF DIGITS PER INPUT WORD. INPADR, 0 /THE INPUT DATA ADDRESS POINTER. INPCRL, 0 /THE INPUT DATA TYPE WORD. PAGE
/ / / INITIALIZE THE OUTPUT ROUTINES / / INITOU, 0 TAD OUTCRL /WAS AN OUTPUT BUFFER SPECIFIED ? AND (0200) SNA CLA JMP INITO1 /NO, USE OUR LOCAL BUFFER AREA. JMS I (GETMSG) /YES, GO GET THE BUFFER SPECS. OUTFLD /(DUMMY) OUTFLD /(FIELD OF OUTPUT BUFFER) OUTADR /(ADDRESS OF OUTPUT BUFFER) JMP INITO2 INITO1, TAD (CDF CUR) /RESET THE POINTERS FOR OUR LOCAL DCA OUTFLD / BUFFER AREA. TAD (LOCBUF) DCA OUTADR TAD (-OUTBLN) /GET THE LENGTH OF OUR BUFFER AND INITO2, DCA CHRLEN /RESET THE BUFFER LENGTH COUNTER. TAD OUTCRL /OUTPUT TO BE PACKED OR UNPACKED ? AND (0400) SNA CLA TAD (CHR2-CHR5) /USE "CHR2" FOR PACKED. TAD (CHR5) /USE "CHR5" FOR UNPACKED. DCA CHR1 TAD OUTADR /SAVE THE OUTPUT BUFFER ADDRESS AND DCA OCLOA / BUFFER LENGTH COUNTER IN CASE WE TAD CHRLEN / ENCOUNTER MULTIPLE LINES. THE DCA OCLOB / BUFFER CLOSER WILL USE THEM. JMP I INITOU /ALL DONE HERE, RETURN. OUTCRL, 0 /THE OUTPUT CONTROL WORD. OUTADR, 0 /THE OUTPUT BUFFER POINTER. CHRLEN, 0 /THE OUTPUT BUFFER LENGTH COUNTER. CHRCTR, 0 /THE OUTPUT CHARACTER COUNTER. CHRA, 0 /LOCAL TEMPORARY.
/ / / COME THROUGH HERE TO THE CORRECT OUTPUT SEQUENCE / / CHROUT, 0 JMS I CHR1 /GO TO THE REQUIRED OUTPUT SEQUENCE. ISZ CHRCTR /INCREMENT THE OUTPUT CHAR COUNTER. JMP I CHROUT /RETURN. CHR1, HLT /(ADDRESS SET UP BY "INITOU".) / / / PACK CHARACTERS FOR OUTPUT / / CHR2, 0 AND (0077) /STRIP TO 6 BIT ASCII. JMP I CHR3 /GO TO THE NEXT CHARACTER SEQUENCE. CHR3, CHR4 JMP I CHR2 /RETURN. CHR4, IFZERO PDP8E+PDP8A < CLL RTL /FIRST SEQUENCE, SHIFT LEFT AND SAVE RTL / IT 'TIL NEXT CHARACTER COMES RTL > / ALONG. IFNZRO PDP8E+PDP8A <BSW> DCA CHRA JMS CHR3 TAD CHRA /SECOND SEQUENCE, ADD THIS CHARACTER JMS CHR5 / TO FIRST AND THEN PUT THEM IN THE JMS CHR3 / OUTPUT BUFFER. JMP CHR4 /NOW BACK TO FIRST SEQUENCE. / / / PUT A WORD IN THE OUTPUT BUFFER / / CHR5, 0 OUTFLD, HLT /CDF TO THE OUTPUT BUFFER. DCA I OUTADR /PUT THE WORD IN THE BUFFER. CDF CUR DCA CHRA /CLEAR PACKED CHARACTER, IF ANY. ISZ OUTADR /INCREMENT THE OUTPUT POINTER. ISZ CHRLEN /STILL WITHIN THE BUFFER LENGTH ? JMP I CHR5 /YES, RETURN. TAD CHR5 /THE OUTPUT BUFFER IS FULL, MOVE DCA OCLOSE / OUR RETURN ADDRESS TO SIMULATE A / JMS TO "OCLOSE". THIS IS NECESSARY / BECAUSE "OCLOSE" CAN CALL US. AC2000 /NOW SEND WHAT OUTPUT WE HAVE TO THE JMP OCLO1 / DESTINATION TASK, THEN WE CAN GO / DO SOME MORE OUTPUT.
/ / / CLOSE THE OUTPUT BUFFER AND SEND IT ON IT'S WAY / / OCLOSE, 0 OCLO1, DCA OCLO3 /THE AC MAY CONTAIN A "NO LINE FEED" / CONTROL BIT. DCA CHRLEN /RESET THE BUFFER COUNTER, IN CASE / THE TERMINATOR FILLS THE BUFFER. TAD CHRA /ADD THE LAST CHARACTER AND A ZERO JMS CHR5 / TO TERMINATE THE OUTPUT BUFFER. TAD OUTCRL /MOVE THE PACKED/UNPACKED BIT TO THE AND (0400) / OUTPUT MESSAGE'S CONTROL WORD, AND CLL RTL RAL TAD OCLO3 / MAYBE THE LINE FEED CONTROL BIT. DCA I (MSGCRL) TAD OUTCRL /GET THE OUTPUT DESTINATION TASK AND (0177) / NUMBER. SNA /IS THE TASK NUMBER VALID ? JMP OCLO4 /NO, JUST RESET OUR STUFF AND EXIT. DCA OCLO3 /NUMBER OK, SAVE IT FOR THE CAL. TAD OUTCRL /WAS AN OUTPUT BUFFER SPECIFIED ? AND (0200) SNA CLA JMP OCLO2 /NO, GO ON. TAD (1000) /YES, SET UP THE MESSAGE PACKET TO TAD I (MSGCRL) / POINT TO THE SPECIFIED BUFFER. DCA I (MSGCRL) TAD OCLOA /MOVE THE ADDRESS OF THE SPECIFIED DCA I (LOCBUF) / OUTPUT BUFFER. OCLO2, CAL /NOW SEND THE OUTPUT BUFFER TO THE SENDW / DESTINATION TASK AND WAIT. OCLO3, 0 OUTMSG OCLO4, CLB TAD (CHR4) /RESET THE OUTPUT PACKER FOR THE DCA CHR3 / FIRST OUTPUT SEQUENCE. TAD OCLOA /RESET THE OUTPUT BUFFER ADDRESS, DCA OUTADR TAD OCLOB / THE BUFFER LENGTH COUNTER, AND DCA CHRLEN DCA CHRCTR / ZERO THE OUTPUT CHARACTER COUNTER. JMP I OCLOSE /ALL DONE, RETURN. OCLOA, 0 /STORAGE FOR THE BUFFER ADDRESS. OCLOB, 0 /STORAGE FOR THE BUFFER LENGTH.
/ / / "/" FORMAT TYPE SERVICE ROUTINE - BEGIN A NEW LINE / / FRMMPL, CLB JMS OCLOSE /CLOSE THIS OUTPUT LINE. "OCLOSE" / WILL RESET ALL THE POINTERS AND / COUNTERS IT NEEDS. JMP I (DOFORM) / RETURN TO DO MORE OUTPUT. PAGE
/ / / CONVERT DOUBLE PRECISION OCTAL INPUT DATA TO DECIMAL / DIGITS FOR OUTPUT, BY CONTINUOUS SUBTRACTION. / / IFNZRO EAE-PDP8E < /PDP8/E TYPE EAE ONLY !! CONVRT, 0 JMS CONV4 /GO FORM THE LEAST SIGNIFICANT WORD DCA CONVL / OF THE OCTAL DATA. TAD FRMAA /NOW LOOK AT THE DIGIT COUNTER, IF TAD (4) / IT IS 4 OR LESS, JUST ZERO THE SPA CLA / MOST SIGNIFICANT DATA WORD. JMS CONV4 /MAYBE GO FORM THE MOST SIGNIFICANT DCA CONVH / WORD OF THE OCTAL DATA. TAD (NUMBUF) /RESET THE WORKING POINTER TO THE DCA CONVA / START OF THE DIGIT BUFFER. TAD (-10) /RESET THE LOOP COUNTER. DCA CONVB TAD (CONVHO) /SET UP A POINTER TO THE HIGH ORDER DCA CONVPH / CONVERSION CONSTANTS, TAD (CONVLO) / AND A POINTER TO THE LOW ORDER DCA CONVPL / CONVERSION CONSTANTS. CONV1, DCA I CONVA /CLEAR THIS DIGIT BUFFER LOCATION. CONV2, CLL TAD I CONVPL /ADD IN THE LOW ORDER CONVERSION TAD CONVL / CONSTANT FOR THIS POWER OF TEN. DCA CONVL RAL /PROPAGATE THE CARRY, IF ANY. TAD I CONVPH /NOW ADD IN THE HIGH ORDER CONSTANT TAD CONVH / FOR THIS POWER OF TEN. SNL /"DIVIDE" OVERFLOW ? JMP CONV3 /YES, GO ON. DCA CONVH /NO, SAVE THE NEW HIGH ORDER DATA. ISZ I CONVA /INCREMENT THE DEVELOPING DIGIT, JMP CONV2 / AND GO AROUND AGAIN. CONV3, CLB TAD I CONVPL /RESTORE THE LOW ORDER DATA FOR THIS CIA / POWER OF TEN. TAD CONVL DCA CONVL ISZ CONVPL /INCREMENT THE CONVERSION POINTERS, ISZ CONVPH ISZ CONVA / AND THE DEVELOPING DIGIT POINTER. ISZ CONVB /FINISHED ALL POWERS OF TEN ? JMP CONV1 /NO, DO THE NEXT. JMP I CONVRT /FREE AT LAST, RETURN.
/ / / PACK 4 OCTAL DIGITS INTO ONE WORD / / CONV4, 0 TAD (-4) /LOOP COUNTER FOR 4 DIGITS. DCA CONVB CONV5, CLL RTR /SHIFT THE CURRENT DATA RIGHT ONE RAR / OCTAL DIGIT AND SAVE IT. DCA CONVA JMS I (INCHAR) /GO GET THE NEXT INPUT CHARACTER, CLL RTR / AND SHIFT IT TO BITS 0-2. (THE RTR / DATA COMES IN LEAST SIGINIFICANT / DIGIT FIRST.) TAD CONVA /ADD IN THE NEW DIGIT. ISZ CONVB /FINSIHED ALL 4 DIGITS ? JMP CONV5 /NO, DO ANOTHER. JMP I CONV4 /YES, RETURN. CONVA, 0 /LOCAL TEMPROARIES. CONVB, 0 CONVL, 0 /LEAST SIGNIFICANT OCTAL DATA. CONVH, 0 /MOST SIGNIFICANT OCTAL DATA. CONVPL, 0 /POINTER TO LOW ORDER CONSTANTS. CONVPH, 0 /POINTER TO HIGH ORDER CONSTANTS. / / / CONVERSION CONSTANTS FOR THE POWERS OF TEN / / CONVLO, 4600 /LOW ORDER CONVERSION CONSTANTS. 6700 4540 4360 6030 7634 7766 7777 CONVHO, 3166 /HIGH ORDER CONVERSION CONSTANTS. 7413 7747 7775 7777 7777 7777 7777 > /END OF NON-EAE CONDITIONAL
/ / / CONVERT DOUBLE PRECISION OCTAL INPUT DATA TO DECIMAL / DIGITS FOR OUTPUT, USING THE PDP8E TYPE EAE. / / IFZERO EAE-PDP8E < /PDP8/E TYPE EAE ONLY !! CONVRT, 0 JMS CONV4 /GO FORM THE LEAST SIGNIFICANT WORD DCA CONVL / OF THE OCTAL DATA. TAD FRMAA /NOW LOOK AT THE DIGIT COUNTER, IF TAD (4) / IT IS 4 OR LESS, JUST ZERO THE SPA CLA / MOST SIGNIFICANT DATA WORD. JMS CONV4 /MAYBE GO FORM THE MOST SIGNIFICANT DCA CONVH / WORD OF THE OCTAL DATA. TAD (NUMBUF) /RESET THE WORKING POINTER TO THE DCA CONVA / START OF THE DIGIT BUFFER. TAD (-10) /RESET THE LOOP COUNTER. DCA CONVB TAD (CONVO) /SET UP A POINTER TO THE CONVERSION DCA CONVP / CONSTANTS. SWAB /SET THE EAE TO MODE B !! CONV1, DCA I CONVA /CLEAR THIS DIGIT BUFFER LOCATION. DLD /LOAD THE OCTAL DATA (OR WHAT'S LEFT CONVL / OF IT). CONV2, DAD /ADD IN THE CONVERSION CONSTANT FOR CONVP, 0 / THIS POWER OF TEN. SNL /"DIVIDE" OVERFLOW ? JMP CONV3 /YES, GO ON. DST /SAVE THE CURRENT RESULT IN CASE OF CONVL / "OVERFLOW" THE NEXT TIME AROUND. ISZ I CONVA /INCREMENT THE DEVELOPING DIGIT, AND JMP CONV2 / GO AROUND AGAIN. CONV3, CAM /CLEAR AC AND MQ. ISZ CONVP /INCREMENT THE CONVERSION POINTER, ISZ CONVP ISZ CONVA / AND THE DEVELOPING DIGIT POINTER. ISZ CONVB /FINISHED ALL POWERS OF TEN ? JMP CONV1 /NO, DO THE NEXT. JMP I CONVRT /FREE AT LAST, RETURN.
/ / / PACK 4 OCTAL DIGITS INTO ONE WORD / / CONV4, 0 TAD (-4) /LOOP COUNTER FOR 4 DIGITS. DCA CONVB CONV5, CLL RTR /SHIFT THE CURRENT DATA RIGHT ONE RAR / OCTAL DIGIT AND SAVE IT. DCA CONVA JMS I (INCHAR) /GO GET THE NEXT INPUT CHARACTER, CLL RTR / AND SHIFT IT TO BITS 0-2. (THE RTR / DATA COMES IN LEAST SIGINIFICANT / DIGIT FIRST.) TAD CONVA /ADD IN THE NEW DIGIT. ISZ CONVB /FINSIHED ALL 4 DIGITS ? JMP CONV5 /NO, DO ANOTHER. JMP I CONV4 /YES, RETURN. CONVA, 0 /LOCAL TEMPROARIES. CONVB, 0 CONVL, 0 /LEAST SIGNIFICANT OCTAL DATA. CONVH, 0 /MOST SIGNIFICANT OCTAL DATA. / / / CONVERSION CONSTANTS FOR THE POWERS OF TEN / / CONVO, 4600 /LEAST SIGNIFICANT WORD OF PAIR. 3166 /MOST SIGNIFICANT WORD OF PAIR. 6700 7413 4540 7747 4360 7775 6030 7777 7634 7777 7766 7777 7777 7777 > /END OF EAE CONDITIONAL
/ / / "A", "O", AND "D" FORMAT TYPE SERVICE ROUTINES / / FRMASC, FRMOCT, ISZ FRMAB /SET THE SWITCH TO LOCK OUT THE / OCTAL TO DECIMAL CONVERTER, JUST / IN CASE THE INPUT DATA IS OCTAL. FRMDEC, DCA FRMAA /SAVE THE DIGIT LOOP COUNTER. JMS I (INITIN) /GO INITIALIZE THE DATA INPUTTER. AND (0003) /IS THE INPUT DATA IN ASCII MODE ? RAR /CAREFUL, THE LINK MAY BE USED !! SNA CLA JMP FRMA2 /NO, DO NUMERIC INPUT. FRMA1, JMS I (INCHAR) /GET THE NEXT ASCII INPUT CHARACTER IFNZRO FRMNUL < DCA FRMAC /[N1] AND SAVE IT A MOMENT. TAD FRMAC /[N1] IS THIS THE NULL CHARACTER ? CIA /[N1] TAD (FRMNUL) /[N1] SNA CLA /[N1] JMP FRMA1 /[N1] YES, JUST IGNORE IT. TAD FRMAC /[N1] NO, THEN GET THE CHARACTER, > JMS I (CHROUT) / AND ADD IT TO THE OUTPUT BUFFER. ISZ FRMAA /DONE ENOUGH CHARACTERS ? JMP FRMA1 /NO, TRY ANOTHER. JMP FRMA5 /YES, RETURN. FRMA2, RAL /ADD THE CURRENT NUMERIC DATA TYPE TAD FRMAB / TO THE OCTAL TO DECIMAL SWITCH. SZA CLA /IS THE SWITCH SET ? JMP FRMA3 /YES, GO ON. JMS CONVRT /IF THE OCTAL TO DECIMAL CONVERTER JMP FRMA4 / SWITCH IS ZERO, WE HAVE OCTAL / INPUT AND DECIMAL OUTPUT, AND WE / MUST CONVERT THE OCTAL TO DECIMAL / BEFORE PUTTING THE DIGITS IN THE / OUTPUT BUFFER. FRMA3, TAD FRMAA /WE WANT TO DO OCTAL OUTPUT, SO GET JMS I (NUMIN) / THE DIGIT LOOP COUNTER AND GO GET / THE USER'S NUMERIC DATA. FRMA4, TAD FRMAA /REGARDLESS OF THE DATA TYPES, NOW JMS I (NUMOUT) / SENT THE DATA TO THE OUTPUTTER.
/ FRMA5, DCA FRMAB /CLEAR THE OCTAL TO DECIMAL / CONVERTER SWITCH FOR NEXT TIME. JMP I (DOFORM) /NOW ON TO THE NEXT FORMAT REQUEST. FRMAA, 0 /LOCAL TEMPORARY. FRMAB, 0 /OCTAL TO DECIMAL CONVERTER SWITCH. FRMAC, 0 /[N1] TEMPORARY CHARACTER STORAGE. PAGE
/ / / TABLE OF DEFINED FORMAT SPECIFICATION ARGUMENTS / / FRMTBL, -240 /SPACE, DELIMITOR, IGNORE IT. DOF2 -", /COMMA, DELIMITOR, IGNORE IT. DOF2 -247 /SINGLE QUOTE, IMBEDDED ASCII TEXT. FRMTXT -"X /"X", OUTPUT "N" SPACES. FRMSPC -"T /"T", OUTPUT SPACES TO COLUMN "N". FRMCOL -"/ /"/", BEGIN A NEW OUTPUT LINE. FRMMPL -"D /"D", DO DECIMAL OUTPUT. FRMDEC -"O /"O", DO OCTAL OUTPUT. FRMOCT -"A /"A", DO ASCII OUTPUT. FRMASC 0 /TABLE TERMINATOR.
/ / / TABLE OF PARAMETERS TO CONFIGURE THE INPUTTER CODE / FOR THE VARIOUS INPUT DATA TYPES / / INCTBL, 7 /CHARACTER MASK OCTAL RAR /FINAL ROTATE INSTRUCTION DATA -4 /CHARACTERS PER PACKED WORD INCH7 /PACKED DATA SEQUENCE INCH7 /UNPACKED DATA SEQUENCE 17 /AS ABOVE BCD RTR / DATA -3 INCH7 INCH7 0 /AS ABOVE 6 BIT ASCII 0 / DATA -2 INCH5 INCH6 377 /AS ABOVE 8 BIT ASCII 0 / DATA -1 INCH4 INCH4 / / / LOCAL OUTPUT BUFFER / / OUTMSG, ZBLOCK 3 /NORMAL RTS/8 TYPE MESSAGE. MSGCRL, 0 0 LOCBUF, ZBLOCK OUTBLN+2 PAGE $=$=LHN=$=$



Feel free to contact me, David Gesswein djg@pdp8online.com with any questions, comments on the web site, or if you have related equipment, documentation, software etc. you are willing to part with.  I am interested in anything PDP-8 related, computers, peripherals used with them, DEC or third party, or documentation. 

PDP-8 Home Page   PDP-8 Site Map   PDP-8 Site Search