.MCALL .MODULE .MODULE SETUP,VERSION=67,COMMENT=,AUDIT=YES ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. ; ; Author: David Fingerhut July 1983 ; ; 11-JUL-88 IHZ Add "R SETUP" re-prompt logic. Add logic to detect an ; invalid command terminator. Also, test BUS$C CTI bus ; bit for PRO series in configuration word 2. ; ; 16-May-90 WFG V64 - Fix error message when no printer is available. ; ; 18-Oct-1990 JFW V65 - add support for TOY clock in 11/9x ; ; 22-Oct-1990 JFW V66 - fix bug introduced in V55 that would not allow ; operation on non-J11s ; ; 7-Oct-1998 DC/TDS V67 - fix TOY support in SETCLK through 2071. .AUDIT .SETUP,.SETPRE,.SETCLK,.SETCOM,.SETLAN,.PISET .AUDIT .IWEEKD,.CALL$F .MCALL .PVAL .MCALL ...CMZ,...CMY ;Define the PSECTS in order .PSECT CODE .PSECT PURE VERSON::.ASCII /SETUP / .NLCSI PART=RLSVER,TYPE=I .BYTE 40,0 .EVEN .PSECT IMPURE .PSECT PTXT COMTXT:: ;Start of regular command texts .PSECT PADD COMADD:: ;Start of escape sequence addresses .PSECT PSET COMSET:: ;Start of PISET offsets .PSECT PFLAG COMFLG:: ;Start of regular command flag words .PSECT LTXT LANTXT:: ;Start of language command texts .PSECT LADD LANADD:: .PSECT PHELP HELADD:: ;Start of help text addresses MFPT.J =: 5 ;Value returned by MFPT for J11s CMR =: 177750 ;CPU Maintenance Register (J11s) CMR.ID =: 000360 ;Area containing module ID J11E =: 05*20 ;Value for KDJ11-E .TITLE HARDWARE SETUP PROGRAM .SBTTL Command Definitions ;+ ; Command definition ; ; All commands are defined here. The arguments for SETCOM are: ; ; TXT - The text of the command. An asterisk separates the non-ambiguous ; portion of the command. ; ; ESCADD - ; If neither FLSUB or FLSET is set in FLAGS, ESCADD contains the address ; of the escape sequence used to execute the command on a VT100. ; ; If FLSUB is set in FLAGS, then ESCADD contains the name of a ; subroutine to execute rather than an escape sequence to send. ; ; If FLDES is set in FLAGS, the command is a destination, and ESCADD ; contains the bit to set in DESTIN. ; ; PISET - ; The contents of this field depends on the command. It is stuffed ; to R3 and passed to the subroutine. It's use is described under the ; appropriate subroutine. ; ; If neither FLSET nor FLRST are set and PISET contains a value, this ; command is a color and PISET contains the address of the address of ; the appropiate bitmask for the colormap. ; ; FLAGS - Miscellaneous flags used for the program which are associated with ; the command. The flag bits are shown below. ; ; HPMSG - The address of the HELP text for the command. ; ; NOTES: ; 1. The COLOR command below is there only so it will print for HELP. ; 2. If PRINTER is specified, the processor type can be anything. ;- DE.TER == 1 ;Command can be used for Terminal or TT DE.PRI == 2 ;Command can be used for Printer or LS DE.CLK == 4 ;Command can be used for Clock DE.KBD == 10 ;Command can be used for Keyboard DE.VDO == 20 ;Command can be used for Video PR.11 == 40 ;Command can be used for a PDP-11 processor PR.PC == 100 ;Command can be used for a PC300 processor FLNO4 == 200 ;Command can be changed to "mode off" by ;masking byte 4 FLNO5 == 400 ;Change command to "mode off" by masking ;byte 5 FLNO == 1000 ;Command takes NO but not by masking FLSUB == 2000 ;Command is handled through a subroutine FLSET == 4000 ;Command SETS a byte in PI setup table FLRST == 10000 ;Command RESETS a byte in PI setup table FLDES == 20000 ;Command is a destination FLSCCA == 40000 ;Disable control/c during command processing FLPARM == 100000 ;Command can be followed by : .MACRO SETCOM TXT,ESCADD,PISET,FLAGS,HPMSG .PSECT PTXT .ASCIZ /TXT/ .PSECT PADD .WORD ESCADD .PSECT PSET .WORD PISET .PSECT PFLAG .WORD FLAGS .PSECT PHELP .WORD HPMSG .ENDM SETCOM AM*BER,COLOR,LOCAMB,,0 SETCOM AN*SWERBACK,ANSWER,0,,HPANS SETCOM BC*D,BCD,0,,HPBCD SETCOM BLA*CK,COLOR,LOCBLA,,0 SETCOM BLO*CK,BLOCK,0,,HPBLO SETCOM BLU*E,COLOR,LOCBLU,,0 SETCOM BO*LD,BOLD,0,,HPBOL SETCOM CA*PS,0,S$LOCK,,HPCAP SETCOM CLE*AR,ESCCLR,0,,HPCLE SETCOM CLI*CK,0,S$CLIC,,HPCLI SETCOM CLO*CK,DE.CLK,0,,0 SETCOM COL*OR,0,D$COLR,,HPCOLO SETCOM COM*POSE,0,S$COMP,,0 SETCOM CU*RSOR,ESCCRR,D$CUR,,HPCUR SETCOM CY*AN,COLOR,LOCCYA,,0 SETCOM DAR*K,ESCDRK,D$SCNM,,HPDAR SETCOM DATA,DATA,S$KBDT,,0 SETCOM DATE,DATE,0,,HPDAT SETCOM DEF*AULTS,DEFALT,0,,HPDEF SETCOM DEN*SE,ESCDEN,0,,HPDEN SETCOM DO*WN,ESCDWN,0,,HPDOW SETCOM DR*AFT,ESCNDE,0,,HPDRA SETCOM DS*T,DST,0,,HPDST SETCOM F*ACTORY,COLOR,FACCL,,HPFAC SETCOM GE*NERIC100,VT100,ESCGEN,,HPGEN SETCOM GRA*PHIC,ESCGRA,0,,HPGRA SETCOM GRE*EN,COLOR,LOCGRE,,0 SETCOM HE*LP,HELP,0,,HPHEL SETCOM HO*RIZONTAL,HORIZ,0,,HPHOR SETCOM IN*TERLACE,ESCINT,0,,HPINT SETCOM J*UMP,ESCJMP,D$SCLM,,HPJUM SETCOM K*EYBOARD,DE.KBD,0,,0 SETCOM KB,DE.KBD,0,,0 SETCOM LAND*SCAPE,ESCWID,0,,HPWID SETCOM LANG,LANG,0,,HPLAN SETCOM LE*TTER,ESCLET,0,,HPLET SETCOM LIG*HT,ESCLHT,D$SCNM,,HPLIG SETCOM LIS*TING,ESCLST,0,,HPLIS SETCOM LP,DE.PRI,PRI.LP,,0 SETCOM LQ*NG,LANG,0,,0 SETCOM LS,DE.PRI,PRI.LS,,0 SETCOM MAG*ENTA,COLOR,LOCMAG,,0 SETCOM MAR*GINBELL,0,S$MARB,,HPMAR SETCOM ME*MO,ESCMEM,0,,HPMEM SETCOM MO*NOCHROME,0,D$COLR,,HPMONO SETCOM NE*WLINE,ESCNWL,A$LNM,,HPNEW SETCOM NORM*AL,ESCNRM,0,,HPNOR SETCOM ON,BACKG,0,,0 SETCOM PA*GELENGTH,PAGE,0,,HPPAG SETCOM PO*RTRAIT,ESCTAL,0,,HPTAL SETCOM PR*INTER,DE.PRI,PRI.PR,,0 SETCOM RED,COLOR,LOCRED,,0 SETCOM REP*EAT,ESCRPT,D$ARM,,HPREP SETCOM RES*ET,ESCRES,0,,HPRES SETCOM RET*AIN,RETAIN,0,,0 SETCOM REV*ERSE,REVERS,0,,HPREV SETCOM SA*VE,SAVE,0,,HPSAV SETCOM SE*TCOLOR,COLOR,SETCL,,HPSET SETCOM SHI*FT,0,S$LOCK,,HPSHI SETCOM SHO*W,SHOW,0,,HPSHO SETCOM SM*OOTH,ESCSMO,D$SCLM,,HPSMO SETCOM TA*BS,TABS,0,,HPTAB SETCOM TER*MINAL,DE.TER,0,,0 SETCOM TEX*T,ESCTXT,0,,HPTEX SETCOM TI*ME,TIME,0,,HPTIM SETCOM TT*,DE.TER,0,,0 SETCOM TY*PE,DATA,S$KBDT,,0 SETCOM UNDERL*INE,UNDERL,0,,HPUNL SETCOM UNDERS*CORE,BLOCK,1,,HPUND SETCOM UP,ESCUP,0,,HPUP SETCOM VE*RTICAL,VERT,0,,HPVER SETCOM VI*DEO,DE.VDO,0,,0 SETCOM VT100,VT100,0,,HPVT1 SETCOM VT52,ESCVT5,0,,HPVT5 SETCOM WH*ITE,COLOR,LOCWHI,,0 SETCOM WR*AP,ESCWRP,D$AWM,,HPWRA SETCOM Y*ELLOW,COLOR,LOCYEL,,0 SETCOM 132*COLUMNS,ESC132,D$COLM,,HP132 SETCOM 12*HOUR,HOUR12,0,,HP12H SETCOM 24*HOUR,HOUR24,0,,HP24H SETCOM 240*INTERLACE,ESCINT,0,,HP240 SETCOM 480*INTERLACE,INT480,0,,HP480 SETCOM 80*COLUMNS,ESC80,D$COLM,,HP80C SETCOM COLOR,DE.TER,0,,HPCOL .PSECT PTXT ;Command table ends with zero byte .BYTE 0 .PSECT PADD .WORD 0 .PSECT PSET .WORD 0 .PSECT PFLAG .WORD 0 .PSECT PHELP .WORD -1 ;Macro to generate COLORS. NAM=3 char identifier. FAC = 350 Default mask. ; .MACRO COLORS NAM,FAC CL'NAM:: .WORD FAC ;Current mask for color LOC'NAM::.WORD CL'NAM ;Address of address of mask FA'NAM::.WORD FAC ;350 or 380 Factory setting .ENDM .LIST ME COLORS AMB,320 COLORS BLA,0 COLORS BLU,30003 COLORS GRE,30 COLORS RED,100340 COLORS YEL,160374 COLORS MAG,130343 COLORS CYA,70037 COLORS WHI,170377 .NLIST ME .MACRO SETLAN TXT,ESCADD .PSECT LTXT .ASCIZ /TXT/ .PSECT LADD .WORD ESCADD .ENDM ;Languages must be listed in alphabetical order or ambiguous value may result. SETLAN A,ESLD ;Austria SETLAN AUS,ESLUSA ;Australia SETLAN B,ESLF ;Belgium SETLAN CDNE,ESLGB ;English Canada SETLAN CDNF,ESLCDN ;French Canada SETLAN CHF,ESLF ;French Switzerland SETLAN CHD,ESLD ;German Switzerland SETLAN D,ESLD ;German SETLAN DK,ESLDK ;Denmark SETLAN F,ESLF ;France SETLAN GB,ESLGB ;Great Britain SETLAN I,ESLI ;Italy SETLAN IRL,ESLGB ;Ireland SETLAN N,ESLDK ;Norway SETLAN NL,ESLDK ;Netherlands SETLAN NZ,ESLGB ;New Zealand SETLAN S,ESLS ;Sweden SETLAN SF,ESLSF ;Finland SETLAN SP,ESLSP ;Spain SETLAN US*A,ESLUSA ;USA .PSECT LTXT .BYTE 0 ;Command text table ends with zero byte .SBTTL Constants CHAIN = 510 ;RT11 Chain area VID350 = 1002 ;PC350 VIDEO ID VID380 = 50 ;PC380 VIDEO ID VID38E = 10050 ;PC380 with EBO VIDEO ID S$EERB == 52 ;EMT error byte ; RMON == 54 ;Base of RMON JSW = 44 ;Job Status Word TCBIT$ = 100 ;Inhibit terminal wait bit TTSPC$ = 10000 ;Special mode terminal bit TTLC$ = 40000 ;Lowercase bit in JSW LINSIZ = 81. ;Size of .GTLIN buffer OUTCHN = 1 ;Output channel number for escape seq's PICHN == 2 ;Channel for PI for SPFUNs FPICHN == 3 ;Channel for file SY:PIx.SYS HIGHAD = 50 ;Program high limit ANSMAX == 20. ;Max length of answerback message in bytes DS.HLA = 4 ;DSTATUS Handler load address DS.HSZ = 2 ;DSTATUS Handler size CR == 15 ;Carraige return LF == 12 ;Line feed ESCAPE == 33 ;Escape character BL == 40 ;Space EOD = 200 ;End of data HANUSE == 1 ;Copy from handler to user USEHAN == -1 ;Copy from user to handler H.DATA = 70 ;Offset in PI block zero to SETUPT SETCHN == 17 ;Channel for SETUP.SAV .SBTTL Pure Area .PSECT PURE .NLIST BEX ; ; Escape sequences for the commands ; ESC132: .ASCIZ <33>/[?3h/ ;132 COLUMNS ESC80:: .ASCIZ <33>/[?3l/ ;80 COLUMNS ESCBOL::.ASCIZ <33>/[1m/ ;BOLD ESCCLR: .ASCII <33>/[H/<33>/[J/;SOFT RESET - Clear screen .ASCII <33>/[m/ ;SOFT RESET - reset current rendition .ASCII <17> ;SOFT RESET - Reset G0 (shift in) .ASCII <33>/[r/ ;SOFT RESET - Reset scrolling regions .ASCII <33>/[?6l/ ;SOFT RESET - Origin mode -> absolute .ASCII <33>/[?7l/ ;SOFT RESET - Autowrap -> off .ASCII <33>/[?1l/ ;SOFT RESET - Cursor key mode -> cursor .ASCII <33>/>/ ;SOFT RESET - Keypad mode -> numeric .ASCII <33>/[4l/ ;SOFT RESET - Insert/replace mode -> replace .BYTE 0 ESCCRR::.ASCIZ <33>/[?25h/ ;CURSOR VISIBLE ESCCRT::.ASCIZ <33>/[?25l/ ;CURSOR INVISIBLE ESCCUR::.ASCIZ <33>/[00;C/ ;Move cursor to right ESCDEN: .ASCIZ <33>/[3"z/ ;DENSE ESCDRK::.ASCIZ <33>/[?5l/ ;DARK ESCDWN: .ASCIZ <33>/K/ ;PARTIAL LINE DOWN ESCGEN: .ASCIZ <33>/[61"p/ ;VT100 ESCGRA: .ASCIZ <33>/Pq/ ;ENTER GRAPHICS MODE ESCHOR::.ASCIZ <33>/[0w/ ;HORIZONTAL PITCH .EVEN ESCIDD::.ASCIZ <33>/[?1;1c/ ;Reply - VT100 FB .EVEN ESCID1::.ASCIZ <33>/[?1;3c/ ;Reply - VT100 XM .EVEN ESCIDF::.ASCIZ <33>/[?61c/ ;Reply - Generic (FB) .EVEN ESCIDX::.ASCIZ <33>/[?61;1c/ ;Reply - Generic (XM) ESCINT: .ASCIZ <33>/[?9h/ ;INTERLACE ESCJMP: .ASCIZ <33>/[?4l/ ;JUMP ESCLET: .ASCIZ <33>/[3"z/<33>/[0w/ ;LETTER (DENSE+HORIZ:10) ESCLFT::.ASCIZ <33>/[200D/ ;Move cursor to left margin ESCLF1::.ASCIZ <33>/[D/ ;Move on position to left ESCLST: .ASCIZ <33>/[0"z/<33>/[4w/;LISTING (DRAFT+HORIZ:16.5) ESCLHT: .ASCIZ <33>/[?5h/ ;LIGHT ESCMEM: .ASCIZ <33>/[2"z/ ;MEMO ESCNBO::.ASCIZ <33>/[22m/ ;NOBOLD ESCNDE: .ASCIZ <33>/[0"z/ ;DRAFT (NODENSE) ESCNUN::.ASCIZ <33>/[24m/ ;NOUNDERLINE ESCNRE::.ASCIZ <33>/[27m/ ;NOREVERSE ESCNWL: .ASCIZ <33>/[20h/ ;NEWLINE ESCNRM:: ESCOFF::.ASCIZ <33>/[m/ ;NORMAL - ALL ATTRIBUTES OFF ESCPAG::.ASCIZ <33>/[066t/ ;SET PAGE LENGTH ESCRES::.ASCIZ <33>/c/ ;Reset to Initial State ESCREV::.ASCIZ <33>/[7m/ ;CHARACTER REVERSE VIDEO ESCRPT: .ASCIZ <33>/[?8h/ ;REPEAT ESCSCR::.ASCIZ <33>/[H/<33>/[J/;Clear the screen ESCSMO: .ASCIZ <33>/[?4h/ ;SMOOTH ESCTAB::.ASCIZ <33>/H/ ;Set horizontal tab at active position ESCTAL: .ASCIZ <33>/[0 J/ ;Tall (non-landscape) ESCTBC::.ASCIZ <33>/[3g/ ;CLEAR TABS ESCTXT: .ASCIZ <33>/\/ ;ENTER TEXT MODE ESCUND::.ASCIZ <33>/[4m/ ;UNDERLINE ESCUP: .ASCIZ <33>/L/ ;PARTIAL LINE UP ESCVER::.ASCIZ <33>/[0z/ ;VERTICAL PITCH ESCVT1::.ASCIZ <33>//[?2l/ ;VT52 ESCWID: .ASCIZ <33>/[1 J/ ;Wide (landscape) ESCWRP: .ASCIZ <33>/[?7h/ ;WRAP ;Escape sequences for country character sets ESLCDN: .ASCIZ <33>/(Q/ ;French Canada ESLD: .ASCIZ <33>/(K/ ;German ESLDK: .ASCIZ <33>/(E/ ;Denmark ESLF: .ASCIZ <33>/(R/ ;France ESLI: .ASCIZ <33>/(Y/ ;Italy ESLJK: .ASCIZ <33>/(I/ ;Japan-KataKana ESLJR: .ASCIZ <33>/(J/ ;Japan-Roman ESLS: .ASCIZ <33>/(H/ ;Sweden ESLSF: .ASCIZ <33>/(C/ ;Finland ESLSP: .ASCIZ <33>/(Z/ ;Spain ESLGB: .ASCIZ <33>/(A/ ;Great Britain ESLUSA: .ASCIZ <33>/(B/ ;USA NO: .ASCII /NO/ PROMPT: .ASCII /Characteristics? /<200> .EVEN PRLEN == 13. ;Length of print buffer PRBUF:: .BLKB PRLEN ;Buffer for printing command .ASCII / is /<200> .EVEN PIVERS: .WORD .PISET ;PISET version number .EVEN .SBTTL HELP text HPHLP:: .ASCII /For a list of SETUP commands type one of the following:/ .ASCII /SETUP TERMINAL HELP/ .ASCII /SETUP PRINTER HELP/ .ASCIZ /SETUP CLOCK HELP/ HPDAT: .ASCIZ /DATE:dd:mmm:yy Sets the system date as specified./ HPTIM: .ASCIZ /TIME:hh:mm:ss Sets the system time as specified./ HPBCD: .ASCII /BCD Converts the system clock to BCD mode./ .ASCIZ /NOBCD Converts the system clock to binary mode./ HPDST: .ASCII /DST Puts the system clock into Daylight Savings Time mode./ .ASCIZ /NODST Puts the system clock into non-Daylight Savings Time mode./ HP12H: .ASCIZ /12HOUR Puts the system clock in 12 HOUR mode./ HP24H: .ASCIZ /24HOUR Puts the system clock in 24 HOUR mode./ HP240: .ASCIZ /[NO]240INTERLACE Enter [exit] INTERLACE mode./ HP480: .ASCIZ /480INTERLACE Puts the terminal in 480 interlace mode./ HPDEN: .ASCIZ /DENSE Use enhanced density printing./ HPCOLO: .ASCIZ /COLOR Put video into COLOR mode./ HPMONO: .ASCIZ /MONOCHROME Put video into MONOCHROME mode./ HPDOW: .ASCIZ \DOWN Move paper UP 1/12 inch for alignment.\ HPUP: .ASCIZ \UP Move paper DOWN 1/12 inch for alignment.\ HPDRA: .ASCIZ /DRAFT Use normal density printing./ HPFAC: .ASCIZ /FACTORY Use with SETCOLOR to return to original color./ HPGRA: .ASCIZ /GRAPHIC Enter GRAPHIC mode./ HPHEL: .ASCIZ /HELP Print this HELP text./ HPTEX: .ASCIZ /TEXT Exit GRAPHIC mode./ HPHOR: .ASCIZ /HORIZONTAL:n Print n characters per inch./ HPVER: .ASCIZ /VERTICAL:n Print n lines per inch./ HPLET: .ASCIZ /LETTER Use enhanced density and 10 characters per inch./ HPLIS: .ASCIZ /LISTING Use normal density and 16.5 characters per inch./ HPMEM: .ASCIZ /MEMO Use memo quality printing./ HPPAG: .ASCIZ /PAGELENGTH:n Print n lines per page./ HPSEL: .ASCIZ /SELECT:n Select port n of mini-exchange./ HPSET: .ASCIZ /SETCOLOR Define the intensities for a color./ HPTAL: .ASCIZ /PORTRAIT Set page orientation to tall./ HPWID: .ASCIZ /LANDSCAPE Set page orientation to wide./ HPVT5: .ASCIZ /VT52 Enter VT52 mode./ HPDAR: .ASCIZ /DARK Print light characters on a dark background./ HPINT: .ASCIZ /[NO]INTERLACE Enter [exit] INTERLACE mode./ HPLIG: .ASCIZ /LIGHT Print dark characters on a light background./ HPJUM: .ASCIZ /JUMP Scroll lines across screen as fast as they are received./ HPSMO: .ASCIZ /SMOOTH Scroll 6 lines per second across screen./ HPNEW: .ASCIZ /[NO]NEWLINE Do [not] generate when is typed./ HPREP: .ASCIZ /[NO]REPEAT Do [not] repeat characters when key is held down./ HPVT1: .ASCIZ /VT100 Set terminal into VT100 specific mode./ HP80C: .ASCIZ /80COLUMNS Display 80 characters across screen./ HP132: .ASCIZ /132COLUMNS Display 132 characters across screen./ HPANS: .ASCIZ \ANSWERBACK:/text/ Place text into the ANSWERBACK buffer.\ HPBLO: .ASCIZ /BLOCK Display the cursor as a block./ HPUND: .ASCIZ /UNDERSCORE Display the cursor as an underscore./ HPCAP: .ASCIZ /CAPS Cause CAPS LOCK key to function as a VT100 key./ HPSHI: .ASCIZ /SHIFT Cause CAPS LOCK key to function as a typewriter key./ HPCLI: .ASCIZ /[NO]CLICK Do [not] cause keys to click when pressed./ HPCUR: .ASCIZ /[NO]CURSOR Cause cursor to be [in]visible./ HPDEF: .ASCIZ /DEFAULTS Return terminal to it's factory settings./ HPGEN: .ASCIZ /GENERIC100 Reply to device ID query as a generic VT100./ HPMAR: .ASCIZ /[NO]MARGINBELL Do [not] sound bell 8 columns from right margin./ HPSAV: .ASCIZ /SAVE Save terminal characteristics./ HPBOL: .ASCIZ /[NO]BOLD Do [not] use bold printing./ HPCLE: .ASCIZ /CLEAR Perform a soft reset./ HPNOR: .ASCIZ /NORMAL Turn all attributes off./ HPRES: .ASCIZ /RESET Reset terminal to previously saved characteristics./ HPREV: .ASCIZ /[NO]REVERSE Do [not] use character reverse video./ HPTAB: .ASCII /TABS:n:n:n... Set tabs at specified columns./ .ASCIZ /NOTABS Clear all tabs./ HPUNL: .ASCIZ /[NO]UNDERLINE Do [not] use underlined printing./ HPWRA: .ASCIZ /[NO]WRAP Do [not] wrap around to the following line./ HPSHO: .ASCIZ /SHOW Show current settings./ HPLAN: .ASCIZ /LANG:xxx Use the font for the specified country code./ HPCOL: .ASCII /color1 ON color2 Sets the text to color1 and background to color2./ .ASCII /The available colors are:/ .ASCIZ /GREEN, BLUE, RED, CYAN, MAGENTA, YELLOW, BLACK, WHITE/ .SBTTL Impure area .PSECT IMPURE SIZE: .LIMIT LSBLK:: .RAD50 /LS / ;LSx DBLK .RAD50 / / LPBLK:: .RAD50 /LP / ;LPx DBLK .RAD50 / / PIBLK:: .RAD50 /PI / ;PIx DBLK .RAD50 / / PISYS:: .RAD50 /SY / ;SY:PIx.SYS DBLK PINAM:: .RAD50 /PI / .RAD50 / / .RAD50 /SYS/ SETSAV: .RAD50 /SY / ;SY:SETUP.SAV .RAD50 /SET/ .RAD50 /UP / .RAD50 /SAV/ XMSUFF: .RAD50 / X/ ;XM suffix PHYSLP: .BYTE 0,1 ;Physical lookup data block .WORD WORK+1 ;Device block +1 .WORD 0 .BLKW 1 .WORD RTSPC+1 RTSPC: RETURN WORK: .BLKW 2 .EVEN ;** keep next 2 lines in order DEFLAN: .BLKW 7 ;Buffer for stuffing in LANG:USA for ;DEFAULT command LINE:: .BLKB ;Getline line buffer ;** end of order dependent area .EVEN PRFX:: .BYTE 0 ;Non-zero -> "NO" prefix used .EVEN ANSLEN::.BYTE 0 ;Answerback length ANSMSG::.BLKB ANSMAX ;Answerback buffer .EVEN IOAREA::.BLKW 4. ;I/O area for .GVAL DSBLK: .BLKW 4 ;Dstatus return block HDRADD: .WORD 0 ;Handler address for FETCH TERMWD::.WORD 0 ;Type of processor (PR.11,PR.PC) PBUF:: .BLKW 8. ;Command buffer ESCBUF::.BLKW 256. ;Buffer for escape sequences ;The following 2 lines must stay together BLKBUF::.BLKW 256. ;General use I/O buffer BLKBF1::.BLKW 256. ;Second half of buffer ;End of area to keep together SAVBLK::.BLKW 4 ;Data block for SAVDAT routine SETTBL::.WORD 0 ;Absolute location of SETTAB SETOF:: .WORD 0 ;Parameter for GETTAB REQBKL::.WORD 0 ;Absolute location GETTAB request data REQBLK::.WORD 0 ;Block number of GETTAB requested data REQDAT::.WORD 0 ;Address of requested data .EVEN FLAGWD::.WORD 0 ;Miscellaneous flags FL.AMB == 1 ;Ambiguous command FL.WCD == 2 ;* detected in template while matching FL.PRM == 40 ;Parameters follow the command FL.12H == 100 ;Do 12 hour check during BCDBIN FL.XM == 400 ;XM monitor FL.SET == 1000 ;Execute command using PISET routine FL.DES == 2000 ;Destination was specified explicitly FL.380 == 10000 ;Running on PC380 DESTIN::.WORD 0 ;Destination flag word PRTYPE: .WORD 0 ;Type of printer specified PRI.PR = 1 ;PRINTER PRI.LS = 2 ;LS PRI.LP = 4 ;LP SETCL:: .WORD -1 ;Dummy color for SETCOLOR FACCL:: .WORD -2 ;Dummy color for FACTORY COLSAV::.WORD 0 ;Color being set by SETCOLOR COLREG::.WORD 0 ;Buffer register for setting up color mask VIDCSR::.WORD 0 ;Video controller CSR CSR480 == 4 ;480 interlace bit CMAP:: .WORD 0 ;Address of color map FLAGSC::.WORD 0 ;Miscellaneous flags for SETCOLOR SC.SEC == 1 ;SETCOLOR in progress SC.VAL == 2 ;colecting values SC.BLU == 4 ;value received for BLUE SC.GRE == 10 ;value received for GREEN SC.RED == 20 ;value received for RED BIN1: .BLKW 2 ;Area for binary conversion IS9X:: .BLKW 1 ;0, non-11/9x processor, -1 11/9x processor .SBTTL Error messages ;+ ; Error messages ;- ERRSTP: .ASCII /?SETUP-/ ;Prefix string LEVERR: .ASCII /X-/<200> ;Level string .EVEN ERRARE::.BYTE 0 ;Error code .BYTE 0 ;ASCII character level .WORD ERRSTP ;-> prefix string .WORD LEVERR ;-> level byte .WORD MSGTAB ;-> message table .WORD 0 ;-> filename .WORD FINISH ;-> abort exit .GLOBL DNS,IVV,IVC,EXT,ATL,ABC,AMV,IVT,TRU ;+ ;ERROR MSGLST MSGTAB ERRMSG ABC ERRMSG AMV ERRMSG ATL ERRMSG DNS ERRMSG EDT ERRMSG EXT ERRMSG ICD ERRMSG ITR ERRMSG IVC ERRMSG IVT ERRMSG IVV ERRMSG NAV ERRMSG TRU ; ; The following messages are in module ULB033 ; ;ERRMSG CIU ;ERRMSG CNO ;ERRMSG DVF ;ERRMSG DFL ;ERRMSG FER ;ERRMSG FCP ;ERRMSG FNF ;ERRMSG ILD ;ERRMSG INE ;ERRMSG NOM ;ERRMSG OPE ;ERRMSG OFF ;ERRMSG OFP ;ERRMSG SYS ;ERRMSG EOF .EVEN MSGEND ;- .SBTTL Main Program .PSECT CODE SETUP:: BIS #,DESTIN ;Default commands to terminal BIS #PR.11,TERMWD ;Assume PDP-11 .GVAL #IOAREA,#$CNFG2 ;Get configuration word 2 BIC #^CBUS$M,R0 ;Relevant mask ;IHZ CMP #BUS$C,R0 ;Look for CTI bus ;IHZ ;If equal, then CTI bus ;IHZ BNE 10$ ;Branch if not on a Professional series ;IHZ BIC #PR.11,TERMWD ;Not a PDP-11 BIS #PR.PC,TERMWD ;It is a PRO MOV @#$SYPTR,R1 ;R1 -> RMON MOV $GETVE(R1),R1 ;R1 -> $GTVEC TST (R1)+ ;R1 -> $GTCSR MOV #VID380,-(SP) ;Guess it's a PC380 BIS #FL.380,FLAGWD ;Guess it's a 380 CALL @R1 ;Get the VIDEO CSR BCC 5$ ;Branch if 380 MOV #VID38E,@SP ;Guess it's a PC380 with EBO CALL @R1 ;Get the VIDEO CSR BCC 5$ ;Branch if 380 with EBO MOV #VID350,@SP ;Must be a 350 BIC #FL.380,FLAGWD ;It's not a 380 CALL @R1 ;Get the VIDEO CSR 5$: MOV (SP)+,R1 ;R1 = VIDEO BASE ADD #4,R1 ;R1 = VIDEO CSR ADDR MOV R1,VIDCSR ;Save video csr ADDR ADD #6,R1 ;R1 = color map location MOV R1,CMAP ;Save it 10$: .TRPSET #IOAREA,#CLRR0 ;Clear R0 if trap occurs MFPT ;Get processor type (or trap) CMP #MFPT.J,R0 ;Is it a J-11? BNE 15$ ;No, done MOV @#CMR,R0 ;Get the module type number BIC #^cCMR.ID,R0 ;Clear junk out CMP #J11E,R0 ;Is it an 11/9x processor? BNE 15$ ;No MOV #-1,IS9X ;yes, mark as a 11/9X processor 15$: .GVAL #IOAREA,#$HSUFF ;R0 = Handler suffix CMP XMSUFF,R0 ;Is it XM? BNE 20$ ;Branch if not BIS #FL.XM,FLAGWD ;Indicate XM 20$: ADD R0,PINAM ;Add in the suffix to the filename BIT #PR.PC,TERMWD ;Is this a PC? BEQ 21$ ;Branch if not CALL OPENPI ;Open PI and PIx.SYS 21$: BIS #TTLC$,@#JSW ;Enable lowercase input MOV #CHAIN+2,R4 ;Assume data is in chain area CMP #1,@#CHAIN ;Anything in chain area? BGE 22$ ;Branch if not .GTLIN #LINE ;Clear out the command but don't use it BR 30$ ;Continue 22$: .RCTRLO ;Force lowercase .GTLIN #LINE,#PROMPT ;Read the parameters MOV #LINE,R4 ;R4 -> Input data TSTB (R4) ;Is first byte 0? BNE 30$ ;Branch if not .PRINT #VERSON ;Print version number BR 22$ ;Get another line 30$: CLRB PRFX ;Assume no prefix BIC #FL.SET,FLAGWD ;Assume no PISET offset CALL GETCOM ;Get a command. R0 will point to command 40$: TSTB (R0) ;Do we have a command? BNE 50$ ;Branch is so BIT #SC.VAL,FLAGSC ;Are we in the middle of SETCOLOR? BEQ 22$ ;Branch if not CALL WRTCOL ;Write out the SETCOLOR value BR 22$ ;Get another command. 50$: CALL NOCHEK ;Is there a "NO" prefix? BCC 60$ ;Branch if not MOVB #4,PRFX ;Indicate prefix was used TSTB (R0) ;Is there a command? BNE 60$ ;Check the strings ;+ ;ERROR 55$: .ERR #ERRARE,#IVC,LEVEL=F,RETURN=NO,ASCII=#PBUF ; <-F-Invalid command> ;- 60$: MOV #COMTXT,R2 ;R2 -> list of valid strings BIC #FL.AMB,FLAGWD ;Clear ambiguous command indicator CALL TBSRC ;Search the table for the string BCS 55$ ;Branch if not found 80$: BIT #FL.AMB,FLAGWD ;Ambiguous command? BEQ 100$ ;Branch if not ;+ ;ERROR .ERR #ERRARE,#ABC,LEVEL=F,RETURN=NO,ASCII=#PBUF ; <-F-Ambiguous command> ;- 90$: BR 30$ ;Get next command (link) 100$: MOV COMFLG(R1),R2 ;R2 = FLGWORD for the command MOV COMSET(R1),R3 ;R3 = misc. value MOV COMADD(R1),R1 ;R1 = address of routine to branch to ; or Escape sequence address BIT #FLPARM,R2 ;Can the command end with a colon or equal? BEQ 101$ ;Branch if not ;IHZ BIT #FL.PRM,FLAGWD ;Did the command end with a colon or equal? BEQ 101$ ;Branch if not TSTB (R4) ;Does it have a value? ;IHZ BNE 101$ ;Yes ;IHZ ;+ ;ERROR .ERR #ERRARE,#ITR,LEVEL=F,RETURN=NO,ASCII=#PBUF ; <-F-Invalid terminator for command: > ;- 101$: BIT #SC.VAL,FLAGSC ;Are we in the middle of SETCOLOR? BEQ 105$ ;Branch if not CMP #COLOR,R1 ;Is it a color? BNE 104$ ;Branch if not BIT #FL.PRM,FLAGWD ;Is this another param for setcolor? BNE 105$ ;Branch if so CMP #FACCL,R3 ;Is it FACTORY? BEQ 105$ ;Branch if so - it's a param for setcolor. 104$: CALL WRTCOL ;Write out value from SETCOLOR ; then execute current command 105$: BIT #,R2 ;Is there a PI offset? BEQ 120$ ;Branch if not TST R1 ;Is there also an escape sequence or subr? BNE 120$ ;If so, use escape seq or subr. rather than ;updating PI state table BIS #FL.SET,FLAGWD ;Use the PISET routine 120$: TSTB PRFX ;Was a prefix used? BEQ 150$ ;Branch if not BIT #FLNO4,R2 ;Is it a "mask byte 4" prefix? BEQ 130$ ;Branch if not BISB PRFX,4(R1) ;Adjust for RESET BR 150$ ;and continue on 130$: BIT #FLNO5,R2 ;Is it a "mask byte 5" prefix? BEQ 140$ ;Branch if not BISB PRFX,5(R1) ;Adjust for RESET BR 150$ ;and continue on 140$: BIT #FLNO,R2 ;Is it non-mask prefix? BEQ 55$ ;Branch if not 150$: BIT DESTIN,R2 ;Is the current destination allowed? BNE 160$ ;Branch if so ;+ ;ERROR .ERR #ERRARE,#ICD,LEVEL=F,RETURN=NO,ASCII=#PBUF ; <-F-Invalid command for destination> ;- 160$: BIT #DE.PRI,DESTIN ;Is this going to PRINTER? BNE 170$ ;If so, don't verify processor. BIT TERMWD,R2 ;Is the correct processor being used? BNE 170$ ;Branch if so ;+ ;ERROR .ERR #ERRARE,#IVT,LEVEL=F,RETURN=NO,ASCII=#PBUF ; <-F-Invalid processor for command> ;- 170$: BIT #FLSUB,R2 ;Is this one handled by a subroutine? BEQ 180$ ;Branch if not BIT #FLSCCA,R2 ;Should control/c be disabled? BEQ 175$ ;Branch if not .SCCA #IOAREA,#BLKBUF ;Disable control/c 175$: JSR PC,(R1) ;Handle the command ;R2 = FLAGS for the command ;R3 = PISET random variable from SETCOM .SCCA #IOAREA,#0 ;Enable control/c BR 210$ ;Get next command 180$: BIT #FL.SET,FLAGWD ;Is this one handled by PISET routine? BEQ 190$ ;Branch if not CLR R0 ;Use the current setup table (CURR$S) CALL PISET ;Go set the byte in PI BR 210$ ;Get next command 190$: BIT #FLDES,R2 ;Is this one a destination? BEQ 200$ ;Branch if not BIS #FL.DES,FLAGWD ;Say that one was specified explicitly CLR DESTIN ;Clear all others BIS R1,DESTIN ;Set the bit BIS R3,PRTYPE ;Remember the type of print command BR 210$ ;Get next command 200$: CALL OUTSTR ;Send the sequence 210$: JMP 90$ ;Get next command FINISH::.CLOSE #FPICHN ;Close PIx.SYS .CLOSE #PICHN ;Close PI .EXIT CLRR0: ;Routine to handle non-existant MFPT CLR R0 ;Return non J-11 code RTI .SBTTL CHKLEV - Check the edit level of PISET ;+ ; CHKLEV - Compare PISET edit levels ; ; Compare the edit level of PISET.MAC used to build SETUP.SAV with the edit ; level of PISET.MAC used to build PI.SYS. ; CHKLEV:: MOV R1,-(SP) ;Save R1 READW #IOAREA,#FPICHN,#BLKBUF,#256.,#0,#PISYS ;Read block 0 into BLKBUF MOV #H.DATA,R1 ;R1 = H.DATA offset MOV BLKBUF(R1),R1 ;R1 -> SETTAB MOV R1,SETTBL ;Save absolute location of SETTAB BIC #777,R1 ;Clear out words MOV R1,REQBLK ;Save cleared out address SWAB R1 ;Make it a block number ASR R1 ;Shift out low byte READW #IOAREA,#FPICHN,#BLKBUF,#512.,R1,#PISYS ;Read them into BLKBUF MOV SETTBL,-(SP) ;SP = absolute location of SETTAB SUB REQBLK,(SP) ;SP -> SETTAB offset within BLKBUF ADD #PISET.,(SP) ;SP -> absolute address of edit level MOV (SP)+,R1 ;R1 -> absolute address of edit level MOV BLKBUF(R1),R1 ;R1 = edit level CMP PIVERS,R1 ;Are they the same? BEQ 90$ ;Branch if so ;+ ;ERROR .ERR #ERRARE,#EDT,LEVEL=F,RETURN=NO ; <-F-Wrong version of PI> ;- 90$: MOV (SP)+,R1 ;Restore R1 RETURN ;Edit levels match .SBTTL GETBIN - Get a binary number ;+ ; GETBIN - Get the next parameter and convert to binary ; ; Input: ; R4 -> next character to be processed in the command line ; Output: ; R0 = parameter (in binary) ; Carry clear - no invalid (non-numeric) characters found ; Carry set - invalid characters found ; ;- GETBIN:: CALL GETCOM ;Get a parameter JSR R5,$SAVRG ;Save R3,R4,R5 MOV R0,R5 ;R5 -> ASCII string MOV #BIN1,R3 ;R3 -> buffer for binary value CLR R4 ;Init counter DEC R4 ; to -1 10$: INC R4 ;Bump counter TSTB (R0)+ ;Is it end of string? BNE 10$ ;Branch if not CALL .DD2CT ;Convert to binary MOV BIN1+2,R0 ;R0 = binary number RETURN .SBTTL GETDIG - Get a digit ;+ ; GETDIG ; ; Get a digit from the command line and update pointer. ; ; Input: ; R4 -> Next character to be parsed ; Output: ; R4 -> Updated beyond digit; not updated if digit not found ; R3 = ASCII value of digit ; Carry bit clear - Character was a digit ; Carry bit set - Character was not a digit ;- GETDIG:: MOVB (R4),R3 ;Get the character CMPB #'0,R3 ;Is it less than ASCII 0? BGT 10$ ;Invalid value CMPB #'9,R3 ;Is it greater than ASCII 9? BLT 10$ ;Invalid value TSTB (R4)+ ;Skip digit BR 20$ ;Valid digit 10$: SEC ;Non-digit 20$: RETURN ;Return the character .SBTTL GETCOM - Get next command ;+ ; GETCOM - Get the next command ; ; Input: ; R4 -> next character to be processed in command line ; Output: ; PBUF -> The extracted command followed by null ; R0 -> PBUF ; R4 -> Update beyond command terminator character. ; If the command was terminated by a colon or equal sign, #FL.PRM will ; be set in FLAGWD. ; Command terminators are equal, colon, comma, space, and end of line ;- GETCOM:: BIC #FL.PRM,FLAGWD ;Clear colon terminator bit MOV #PBUF,R0 ;R0 -> parameter buffer 10$: TSTB (R4) ;Is this a null? BEQ 40$ ;Branch if so CMPB #' ,(R4) ;Is it a blank? BEQ 19$ ;Branch if so CMPB #',,(R4) ;Is it a comma? BNE 20$ ;Branch if not 19$: TSTB (R4)+ ;Skip leading blanks and comma's BR 10$ ;Check next character 20$: CMPB (R4),#<'A+40> ;Check high end BLT 30$ ;No need to convert CMPB (R4),#<'Z+40> ;Check low end BGT 30$ ;No need to convert BICB #40,(R4) ;Convert to uppercase 30$: MOVB (R4)+,(R0) ;Move in a character BNE 32$ ;Branch if more characters TSTB -(R4) ;Point R4 to the null BR 50$ ;and exit 32$: CMPB #':,(R0) ;End of string? BEQ 34$ ;Branch if so CMPB #'=,(R0) ;End of string? BNE 35$ ;Branch if not 34$: BIS #FL.PRM,FLAGWD ;Indicate a colon terminator BR 40$ ;Branch if so 35$: CMPB #',,(R0) ;End of string? BEQ 40$ ;Branch if so CMPB #' ,(R0) ;End of string? BEQ 40$ ;Branch if so TSTB (R0)+ ;Point to next location in pbuf BR 20$ ;Get next character 40$: CLRB (R0) ;Clear the comma or colon 50$: MOV #PBUF,R0 ;R0 -> parameter buffer RETURN .SBTTL GETTAB - Read in an area in PI ;+ ; GETTAB - Read in a PI SETUP area ; ; Input: ; SETOF = offset into SETTAB, which contains the address of the ; data to be read in. ; NOTE: If the value contained at offset SETOF is less than 1000, ; that value is not considered to be a location, and the data ; is not read in. That value is returned in REQBKL. This is ; for use by the SPLIT procedure. ; Output: ; Two blocks are read into BLKBUF which contain the data requested. ; REQBLK = block number of PIx.SYS where blocks came from. ; REQBKL = absolute address of the data (the value contained in SETTAB ; at offset SETOF)....might not be needed.... ; REQDAT = address of requested data (will be somewhere within BLKBUF). ; PIx.SYS is left open on channel FPICHN. GETTAB:: CALL $SAVAL ;Save all REGS READW #IOAREA,#FPICHN,#BLKBUF,#256.,#0,#PISYS ;Read block 0 into BLKBUF MOV #H.DATA,R1 ;R1 = H.DATA offset MOV BLKBUF(R1),R1 ;R1 -> SETTAB MOV R1,SETTBL ;Save absolute location of SETTAB BIC #777,R1 ;Clear out words MOV R1,REQBLK ;Save cleared out address SWAB R1 ;Make it a block number ASR R1 ;Shift out low byte READW #IOAREA,#FPICHN,#BLKBUF,#512.,R1,#PISYS ;Read them into BLKBUF MOV SETTBL,-(SP) ;SP = absolute location of SETTAB SUB REQBLK,(SP) ;SP -> SETTAB offset within BLKBUF ADD SETOF,(SP) ;SP -> absolute address of requested area MOV (SP)+,R1 ;R1 -> absolute address of requested area 10$: MOV BLKBUF(R1),R1 ;R1 = address of requested area MOV R1,REQBKL ;Save it CMP #1000,R1 ;Is it less than 1000? BGT 90$ ;Branch if so (for SPLITP procedure) BIC #777,R1 ;Clear out words MOV R1,-(SP) ;Save cleared out address SWAB R1 ;Make it a block number ASR R1 ;Shift out low byte MOV R1,REQBLK ;Save block number of requested area. READW #IOAREA,#FPICHN,#BLKBUF,#512.,R1,#PISYS ;Read them into BLKBUF MOV REQBKL,R1 ;R1 = disk address SUB (SP)+,R1 ;R1 = offset into BLKBUF ADD #BLKBUF,R1 ;R1 = absolute location of requested data MOV R1,REQDAT ;Save it for caller 90$: RETURN .SBTTL NOCHEK - Check for "NO" prefix ;+ ; NOCHEK ; ; Determines whether command begins with "NO" ; Tests for the exception NORM (NORMAL) command ; Input: ; R0 -> command buffer ; Output: ; RO -> unprefixed command ; Carry set - Prefix found ; Carry clear - No prefix found ;- NOCHEK: MOV R0,-(SP) ;Save command ptr CMPB #'N,(R0)+ ;First character N? BNE 10$ ;Branch if not CMPB #'O,(R0)+ ;Second character O? BNE 10$ ;Branch if not CMPB #'R,(R0) ;Third character R? BNE 5$ ;Not R CMPB #'M,1(R0) ;Fourth character M? BEQ 10$ ;"NORM" - Restore command ptr ;Not "NORM" 5$: TST (SP)+ ;Pop stack - (command ptr after "NO") SEC ;Set carry BR 20$ ;And return 10$: CLC ;Assume no prefix MOV (SP)+,R0 ;Restore R0 20$: RETURN .SBTTL OPENPI - Do physical lookup on PI ;+ ; OPENPI ; .LOOKUP PI non-filestructured ; .LOOKUP PIx.SYS ; ;Input: ; none ;Output: ; PIBLK is opened non-filestructured on channel PICHN. ; PIx.SYS is opened on FPICHN. ; Registers changed: R0 ;- OPENPI:: LOOKUP #IOAREA,#FPICHN,#PISYS ;Open PIx.SYS on FPICHN CALL CHKLEV ;Verify PISET versions MOV PIBLK,WORK ;Move in the RAD50 name MOVB #PICHN,PHYSLP ;Move in the channel number .LOOKUP #PHYSLP,CODE=NOSET ;Do a physical lookup BCC 60$ ;Branch if no error ;+ ;ERROR .ERR #ERRARE,#FE.ILD,RETURN=NO,LEVEL=F,FILE=R2 ; <-F-Invalid device> ;- 60$: RETURN .SBTTL OUTSTR - Send an escape sequence ;+ ; OUTSTR - Send an escape sequence to TT or LS or LP ; ; Input: ; R1 -> Escape sequence ; Output: ; Registers changed: none ;- OUTSTR:: JSR PC,$SAVAL ;Save all regs TSTB (R1) ;Is there anything to send? BEQ 11$ ;Branch if not BIT #DE.PRI,DESTIN ;Is this going to a printer? BNE 20$ ;Branch if so .RCTRLO ;Make sure JSWs agree 10$: .TTYOUT (R1)+ ;start sending escape sequence TSTB (R1) ;end of escape sequence? BNE 10$ ;0 byte signifies end of sequence 11$: JMP 80$ ;Return 20$: BIT #PRI.LS,PRTYPE ;Was it LS? BNE 22$ ;Branch if so MOV #LPBLK,R2 ;Try LP .DSTAT #DSBLK,R2 ;Look for the device BCC 30$ ;Branch if no error BIT #PRI.PR,PRTYPE ;Was it PRINTER? BEQ 15$ ;Branch if not, it was LP 22$: MOV #LSBLK,R2 ;Try LS .DSTAT #DSBLK,R2 ;Look for LS BCC 30$ ;Branch if no error ;+ ;ERROR 15$: .ERR #ERRARE,#NAV,LEVEL=F,RETURN=NO ; <-F-Device is not available> ;- 30$: MOV #DSBLK,R3 ;R3 -> DSTATUS return block TST DS.HLA(R3) ;Is the handler in memory? BNE 50$ ;Branch if so MOV @#HIGHAD,HDRADD ;Get address of high limit ADD #2,HDRADD ;Point to first free location 40$: MOV @#$SYPTR,R0 ;R1 -> RMON MOV $USRLC(R0),R0 ;R0 = location for USR SUB #2,R0 ;Leave a word out .SETTOP R0 SUB SIZE+2,R0 ;R0 = words available for handler CMP DSBLK+2,R0 ;Is there enough room for handler? BLOS 45$ ;Branch if so ;+ ;ERROR .ERR #ERRARE,#FE.NOM,LEVEL=F,RETURN=NO ; <-F-Insufficient memory> ;- 45$: .FETCH HDRADD,R2 ;Fetch the handler BCC 50$ ;Branch if no error ;+ ;ERROR .ERR #ERRARE,#FE.FER,LEVEL=F,RETURN=NO ; <-F-Fetch error> ;- 50$: .GVAL #IOAREA,#$SPSTA ;Get SPOOL status word BIT #SP$ACT,R0 ;SPOOL active? BEQ 55$ ; branch if not BIS #SP$NOF,R0 ; Set NO_FLAG_PAGE bits MOV R0,R5 .PVAL #IOAREA,#$SPSTA,R5 ; in $SPSTA 55$: .LOOKUP #IOAREA,#OUTCHN,R2 ; Open printer (or SP) handler BCC 60$ ;Branch if no error ;+ ;ERROR .ERR #ERRARE,#FE.ILD,RETURN=NO,LEVEL=F,FILE=R2 ; <-F-Invalid device> ;- 60$: CLR R5 ;Init counter MOV #BLKBUF,R4 ;R4 -> buffer used for .WRITW 65$: INC R5 ;Increment counter MOVB (R1)+,(R4)+ ;Move in a byte BNE 65$ ;Branch if not null CLRB (R4) ;Clear the next byte too. BIT #1,R5 ;Is it odd? BEQ 66$ ;Branch if not INC R5 ;Make it even 66$: ASR R5 ;Make it a word count WRITW #IOAREA,#OUTCHN,#BLKBUF,R5,#1,R2 ;Write out the sequences .PURGE #OUTCHN ;Close the LS channel 80$: RETURN ;and return .SBTTL PISET - Handle PI SETUP table commands ;+ ; PISET - Handle all commands which set a byte in the PI SETUP table ; ; Input: ; R0 If R0 = 0, the byte is set or reset in CURR$S. ; If R0 <> 0, the byte is set or reset in SETS$S. ; R3 = Offset (in bytes) of byte to set or reset in a setup table. ; The byte should be set or cleared depending on whether FLSET or FLRST ; is set. If one of the FLNO bits are set the "NO" command is executed ; by doing the opposite. ; R2 = Flags for the command from SETCOM ; ; Output: ; Byte is set or reset (according to PRFX) ; Registers modified: R0,R1 ; ;- PISET:: MOV #CURR$S,-(SP) ;Assume its the current setup table TST R0 ;Is it the current setup table? BEQ 10$ ;Branch if so MOV #SETS$S,(SP) ;Use the SETSET setup table 10$: MOV R3,R1 SPFUN #IOAREA,#PICHN,#FN$UPD,#BLKBUF,#HANUSE,@SP,#PIBLK BISB #1,BLKBUF(R1) ;Assume set the byte TSTB PRFX ;Is it a prefixed cmd? BEQ 12$ ;Branch if not BIT #FLRST,R2 ;Should the byte be set for prefixed cmd? BR 11$ ;Goto common code 12$: BIT #FLSET,R2 ;Should the byte be set for nonprefixed cmd? 11$: BNE 20$ ;Branch if so - byte is set CLRB BLKBUF(R1) ;Clear the byte 20$: SPFUN #IOAREA,#PICHN,#FN$UPD,#BLKBUF,#USEHAN,(SP)+,#PIBLK RETURN .SBTTL SAVDAT - Save a data item ;+ ; SAVDAT ; Save a PI table, such as answerback message, reply, or tabs ; ; Input: R1 -> A block of 4 words which are: ; (R1) = offset into SETTAB of disk current data address ; 2(R1) = offset into SETTAB of disk permanent data address ; 4(R1) = function code for SPFUN to read/write the CURRENT memory data ; 6(R1) = function code for SPFUN to read/write the PERMANENT memory data ; ; The data is saved as follows: ; MEMORY CURRENT -> MEMORY PERMANENT ; MEMORY CURRENT -> DISK CURRENT ; MEMORY CURRENT -> DISK PERMANENT ; ; Registers modified: R0,R2,R3 ;- SAVDAT:: SPFUN #IOAREA,#PICHN,#FN$UPD,#BLKBUF,#HANUSE,4(R1),#PIBLK ;Read current table from memory SPFUN #IOAREA,#PICHN,#FN$UPD,#BLKBUF,#USEHAN,6(R1),#PIBLK ;Write current (memory) to perm (memory) MOV (R1),SETOF ;Request current buffer from disk CALL GETTAB ;Read in the data area SPFUN #IOAREA,#PICHN,#FN$UPD,REQDAT,#HANUSE,4(R1),#PIBLK ;Write from current (memory) to current (disk) WRITW #IOAREA,#FPICHN,#BLKBUF,#512.,REQBLK,#PISYS ;Write out the buffer MOV 2(R1),SETOF ;Request permanent buffer from disk CALL GETTAB ;Read in the data area SPFUN #IOAREA,#PICHN,#FN$UPD,REQDAT,#HANUSE,4(R1),#PIBLK ;Write from current (memory) to perm (disk) WRITW #IOAREA,#FPICHN,#BLKBUF,#512.,REQBLK,#PISYS ;Write out the buffer RETURN .SBTTL TBSRC - Search string table ;+ ;TBSRC ;Search string table for match with input buffer. ; ; Input: R0 - buffer address ; R2 - Start of table, table entries end with zero byte and table ; ends with zero byte ; ; Output: R1 - Index into TABLE*2 ; Carry clear match found ; Carry set no match found ;- TBSRC:: MOV R3,-(SP) ;Save R3 CLR R1 ;Zero table index 10$: MOV R0,R3 ;Copy buffer pointer BIC #FL.WCD,FLAGWD ;No asterisk yet CALL CMPAR ;Is this a match? BCC 30$ ;Branch if so 20$: TSTB (R2)+ ;No, skip to next command BNE 20$ ;Loop til next TST (R1)+ ;Update index by two TSTB (R2) ;End of table? BNE 10$ ;No, try next entry SEC ;Yes, error 30$: MOV (SP)+,R3 ;Restore R3 RETURN ;+ ;CMPAR ;Compares two strings. ; ; Input: R2 -> Template to compare with. Ends with zero byte. ; R3 -> String to be compared. ; ; Output: If a match: ; C-bit clear ; If no match: ; C-bit set ; If ambiguous command: ; C-big clear ; #FL.AMB set in FLAGWD ;- CMPAR:: JSR PC,$SAVAL ;Save all regs ...CMZ FUDGE=.SETUP 10$: MOVB (R3)+,R1 ;R1 = String character to compare 20$: MOVB (R2)+,R0 ;R0 = Template character to compare CMPB #'*,R0 ;Is it an asterisk? BNE 30$ ;Branch if not BIS #FL.WCD,FLAGWD ;Indicate wildcard BR 20$ ;Get next character 30$: TST R0 ;End of template? BNE 40$ ;Branch if not end of template TST R1 ;End of string? BEQ 70$ ;If so, match BR 60$ ;End of template, not end of string - no match 40$: TST R1 ;End of string (and not end of template?) BNE 50$ ;No -- BIT #FL.WCD,FLAGWD ;Wildcard found? BNE 70$ ;If so, match BIS #FL.AMB,FLAGWD ;Set ambiguous command flag BR 70$ ;Indicate a match 50$: CMP R1,R0 ;Compare the characters BEQ 10$ ;Branch if same 60$: SEC 70$: RETURN ...CMY .SBTTL WRTCOL - Write out the new color value ;+ ; WRTCOL ; ; Input: ; COLSAV = Address of address of color mask to be changed. ; COLREG = Mask to be used for the color ; Output: ; Mask is updated. ; Registers modified: none ;- WRTCOL:: JSR PC,$SAVAL ;Save all regs MOV COLSAV,R1 ;R1 -> address of color mask to change MOV COLREG,-(R1) ;Move it into memory copy MOV R1,R3 ;R3 = address of color mask BIC #777,R3 ;Clear out words SUB R3,R1 ;R1 = offset into block SWAB R3 ;R3 = SETUP.SAV block number to read ASR R3 ;Shift out low bit READW #IOAREA,#SETCHN,#BLKBUF,#256.,R3,#SETSAV ;Read block containing mask MOV #BLKBUF,R2 ;R2 -> buffer ADD R1,R2 ;R2 -> location where to put mask MOV COLREG,@R2 ;Move in new mask WRITW #IOAREA,#SETCHN,#BLKBUF,#256.,R3,#SETSAV ;Write it back out CLR FLAGSC ;Finished with SETCOLOR RETURN .END SETUP