cr = 15 lf = 12 ff = 14 soh = 1 nb$nod = 400 ; Node in file or default string (FNB in NAM) .enabl gbl .save .globl $vexta .psect $$vex1 ,rw,d,gbl,rel,ovr .vex1: .word termtype .word systyp .word ttinit .restore .psect rmscod ,ro,i,lcl,rel,con .psect rmsdat ,rw,d,lcl,rel,con systyp::.word 0 ttinit: .word 0 .mcall fabof$ .mcall rabof$ .mcall xabof$ fabof$ RMS$L rabof$ RMS$L xabof$ RMS$L .mcall fab$b ,fab$e ,rab$b ,rab$e .mcall xab$b ,xab$e .mcall nam$b ,nam$e .mcall $initif ,org$ .mcall pool$b ,pool$e ,p$bdb ,p$fab .mcall p$rabx ,p$idx ,p$buf .mcall $compar ,$fetch ,$store ,$rewin .mcall $close ,$creat ,$erase ,$open .mcall $connec ,$delet ,$discon,$find .mcall $get ,$put ,$updat ,$flush .mcall $read ,$write ,$off ,$set .mcall $testbit,$parse .psect rmsdat ,rw,d,lcl,rel,con org$ SEQ, .psect rmsdat ,rw,d,lcl,rel,con ; task extension or to use rmsbuf::pool$b ; static pools p$rab 8. ; plenty of record streams p$bdb 7 ; same goes for block buffers p$fab 7 ; up to 2 fabs (needed for search) p$buf 1024. ; for 1 files and directory i/o pool$e ; end of static pool .psect rmsdat ,rw,d,lcl,rel,con .sbttl rms file access blocks facc = fb$get ! fb$put nowin: .asciz /Dynamic region creation failed %d/<12> .even tmpnam: .ascii /SY:EDIT.TMP/ tmplen = 13 .even fab$work:: fab$b f$alq 40. ; initial allocation of 40 blocks f$deq 5 ; Extend size f$fac fb$rea!fb$wri ; allowed i/o operations f$fna tmpnam ; name of the file f$fns tmplen ; length of the filename f$fop fb$tmp!fb$sup!fb$mkd ; supercede old versions f$lch 1 ; channel number to use f$mrs 1024. ; maximum recordsize f$org fb$seq ; seq f$rat 0 ; implied carriage control f$rfm fb$fix ; variable length records f$shr FB$NIL ; No sharing fab$e fab$scwork:: fab$b f$alq 8. ; initial allocation of 8 blocks f$deq 5 ; Extend size f$fac fb$rea!fb$wri ; allowed i/o operations f$fna tmpnam ; name of the file f$fns tmplen ; length of the filename f$fop fb$tmp!fb$sup!fb$mkd ; supercede old versions f$lch 2 ; channel number to use f$mrs 512. ; maximum recordsize f$org fb$seq ; seq f$rat 0 ; implied carriage control f$rfm fb$fix ; variable length records f$shr FB$NIL ; No sharing fab$e fab$c1:: fab$b f$alq 8. ; initial allocation of 8 blocks f$deq 5 ; Extend size f$fac fb$rea!fb$wri ; allowed i/o operations f$fna tmpnam ; name of the file f$fns tmplen ; length of the filename f$fop fb$tmp!fb$sup!fb$mkd ; supercede old versions f$lch 3 ; channel number to use f$mrs 512. ; maximum recordsize f$org fb$seq ; seq f$rat 0 ; implied carriage control f$rfm fb$fix ; variable length records f$shr FB$NIL ; No sharing fab$e fab$c2:: fab$b f$alq 8. ; initial allocation of 8 blocks f$deq 5 ; Extend size f$fac fb$rea!fb$wri ; allowed i/o operations f$fna tmpnam ; name of the file f$fns tmplen ; length of the filename f$fop fb$tmp!fb$sup!fb$mkd ; supercede old versions f$lch 4 ; channel number to use f$mrs 512. ; maximum recordsize f$org fb$seq ; seq f$rat 0 ; implied carriage control f$rfm fb$fix ; variable length records f$shr FB$NIL ; No sharing fab$e fab$file:: fab$b f$alq 0 ; initial allocation of 10 blocks f$fac facc ; allowed i/o operations f$fns 0 ; length of the filename f$fop fb$sup ; supercede old versions f$lch 6 ; channel number to use f$org fb$seq ; seq f$rat fb$cr ; implied carriage control f$rfm fb$var ; variable length records fab$e fab$ind:: fab$b f$alq 0 ; initial allocation of 10 blocks f$fac fb$get ; allowed i/o operations f$fns 0 ; length of the filename f$fop fb$sup ; supercede old versions f$lch 7 ; channel number to use f$org fb$seq ; seq f$rat fb$cr ; implied carriage control f$rfm fb$var ; variable length records fab$e fab$hl:: fPDPIO MAC[.050036]PDPIO .MAC[.050036]    X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>?\\\\\\\\\`:#@'="\abcdefghi\\\\\\\jklmnopqr\\\\\\\~stuvwxyz\\\\\\\\\\\\\\\\\\\\\\{ABCDEFGHI\\\\\\}JKLMNOPQR\\\\\\\\STUVWXYZ\\\\\\0123456789\\\\\  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~@ggh<i|o<m<4p<p<k|Zn<l fr rwx<x<x<x޺<w@]@@fjnr]Ze@@|> | |v<H|  |  |xz|  |zt f r   < &^ @&@'*/V,"?Lh:hmBmz|z{x`y~|fN|@@|@͂|@ ݃ƃ<ns<|Ŏ |️|ep|u|-@率|<ᄇ2ֻr||ZRM | ntB|xyvZw|J=|R>|J? nnaa|bddf read from file/terminal ; getline(tedlun,&buffer,&sizeofread) ; ; 2(sp) internal lun ; 4(sp) buffer address ; 6(sp) address of returned record size ; r0 1 for success getlin::save ; save registers that we mauy use mov sp ,r3 ; get pointer to arg list add #4*2 ,r3 ; backup over regs and ret address mov #cfile ,r2 ; assume disk input today cmpb @r3 ,inlun ; check to make sure beq 10$ ; no mov #cind ,r2 ; assume indirect now cmpb @r3 ,indlun ; indirect file ? beq 10$ ; yes calls td$ttr ,<2(r3),maxlen> ; get a line from terminal mov r0 ,@4(r3) ; return size beq 90$ ; oops br 80$ 10$: calls td$grec ,<2(r3),maxlen,r2> tst r0 ; did it work ok ? bmi 90$ ; no mov r1 ,@4(r3) ; return size of the read 80$: mov #1 ,r0 ; success br 100$ 90$: mov eoferr ,r0 ; return eof error 100$: unsave ; pop registers and exit return getprm::save ; read with prompt from tt call clrdlm ; clear delimiter mask for RSTS/E mov sp ,r2 ; an arglist pointer cmp (r2)+ ,(r2)+ ; back up clr -(sp) mov 4(r2) ,-(sp) call putbin cmp (sp)+ ,(sp)+ calls td$ttr ,<2(r2),6(r2)> ; read the line tst ttinit beq 100$ call setdlm 100$: unsave return ; getyesno(&prompt,&default) getyesno:: save ; as always, save them mov sp ,r2 ; an arglist pointer cmp (r2)+ ,(r2)+ ; backup sub #20 ,sp ; allocate a small buffer mov sp ,r1 ; and a pointer to it mov #20 ,-(sp) mov 2(r2) ,-(sp) mov r1 ,-(sp) call getprm add #3*2 ,sp tst r0 ; did we get anything ? beq 90$ ; no cmpb @r1 ,#CR ; just a crlf response ? bne 10$ ; no movb @4(r2) ,@r1 ; yes, insert default 10$: cmpb @r1 ,#'Y&137 ; check for Y and y beq 20$ ; success, return(1) cmpb @r1 ,#'y!40 ; lower case check bne 30$ ; no good 20$: mov #1 ,r0 ; success br 100$ ; exit 30$: clr r0 ; return(failure) br 100$ 90$: mov #-1 ,r0 ; return(-1) on read error 100$: add #20 ,sp unsave return .sbttl putline ; putlin(lun,&buffer,len) putlin::save ; save registers we zap mov sp ,r3 ; point to arglist add #4*2 ,r3 ; backup over regs and ret addr mov #cfile*2,r2 ; get index for file i/o cmpb @r3 ,outlun ; write to disk today? beq 10$ ; yes mov 4(r3) ,-(sp) ; no, just dump to terminal mov 2(r3) ,-(sp) ; push length and buffer address call putbin ; dump cmp (sp)+ ,(sp)+ ; pop arg list and exit br 80$ 10$: mov 4(r3) ,r1 ; get record size cmp r1 ,#2 ; if the linelength > 1 blo 20$ ; then check for a CRLF pair mov r1 ,r0 ; at the end of the line. If add 2(r3) ,r0 ; so, get rid of them as RMS cmpb -(r0) ,#LF ; will be creating implied bne 20$ ; carriage return files. cmpb -(r0) ,#CR ; a line feed after the CR? bne 20$ ; no dec r1 ; yes, fix the recordsize up dec r1 ; ... 20$: mov rablst(r2),r2 ; writing to a disk file $store 2(r3),RBF,r2 ; store the buffer address $store r1,RSZ,r2 ; stuff the size of the write $put r2 ; and do it $fetch r0,STS,r2 ; get the i/o status bmi 90$ ; and exit on error 80$: mov #1 ,r0 br 100$ 90$: mov r0 ,tedsyserror clr r0 100$: unsave return .sbttl read/write records td$grec:save mov 4(r5) ,r2 ; get internal lun asl r2 ; times two for indexing mov rablst(r2),r2 ; the rab address for get $store #0,RSZ,r2 ; must be zero for rms11 v2 $store @r5,UBF,r2 ; user buffer address mov 2(r5) ,r0 ; get user buffer maxsize sub #3 ,r0 ; insure room for cr/lf/null bmi 90$ ; no room $store r0,USZ,r2 ; maximum record size to read $get r2 ; simple to read $fetch r0,STS,r2 ; get the status of the op bmi 90$ ; failed $fetch r1,RSZ,r2 ; get the size of the read mov r1 ,r3 ; save it please add @r5 ,r3 ; point to the end of buffer cmpb -1(r3) ,#FF ; if form feed exit beq 10$ ; ok movb #CR ,(r3)+ ; stuff a cr/lf movb #LF ,(r3)+ ; and a line feed add #2 ,r1 ; save size of the read 10$: clrb @rPDPIO MAC[.050036]PDPIO .MAC[.050036]    X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>?\\\\\\\\\`:#@'="\abcdefghi\\\\\\\jklmnopqr\\\\\\\~stuvwxyz\\\\\\\\\\\\\\\\\\\\\\{ABCDEFGHI\\\\\\}JKLMNOPQR\\\\\\\\STUVWXYZ\\\\\\0123456789\\\\\  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~@ggh<i|o<m<4p<p<k|Zn<l fr rwx<x<x<x޺<w@]@@fjnr]Ze@@|> | |v<H|  |  |xz|  |zt f r   < &^ @&@'*/V,"?Lh:hmBmz|z{x`y~|fN|@@|@͂|@ ݃ƃ<ns<|Ŏ |️|ep|u|-@率|<ᄇ2ֻr||ZRM | ntB|xyvZw|J=|R>|J? nnaa|bddft$s #timeref,2(r0),#2,#mast ; setup an ast for 2(sp) seconds mov #1 ,r0 return cantim::cmkt$s #timeref mov #1 ,r0 return mast: mov r0 ,-(sp) mov r1 ,-(sp) mov r2 ,-(sp) mov r5 ,-(sp) call @markast mov (sp)+ ,r5 mov (sp)+ ,r2 mov (sp)+ ,r1 mov (sp)+ ,r0 tst (sp)+ astx$s .sbttl misc string routines strcpy::save mov 2+4(sp) ,r2 mov 4+4(sp) ,r1 10$: movb (r1)+ ,(r2)+ bne 10$ unsave mov 2(sp) ,r0 return blkmov::save mov 2+4(sp) ,r2 mov 4+4(sp) ,r1 mov #1000/10,r0 bit #1 ,r1 bne 10$ bit #1 ,r2 beq 20$ 10$: movb (r1)+ ,(r2)+ movb (r1)+ ,(r2)+ movb (r1)+ ,(r2)+ movb (r1)+ ,(r2)+ movb (r1)+ ,(r2)+ movb (r1)+ ,(r2)+ movb (r1)+ ,(r2)+ movb (r1)+ ,(r2)+ sob r0 ,10$ br 100$ 20$: asr r0 30$: mov (r1)+ ,(r2)+ mov (r1)+ ,(r2)+ mov (r1)+ ,(r2)+ mov (r1)+ ,(r2)+ mov (r1)+ ,(r2)+ mov (r1)+ ,(r2)+ mov (r1)+ ,(r2)+ mov (r1)+ ,(r2)+ sob r0 ,30$ 100$: unsave return scopy:: save mov 2+4(sp) ,r2 mov 4+4(sp) ,r1 mov 6+4(sp) ,r0 beq 20$ 10$: movb (r1)+ ,(r2)+ sob r0 ,10$ 20$: unsave return strlen::save mov 2+2(sp) ,r1 clr r0 10$: tstb (r1)+ beq 20$ inc r0 br 10$ 20$: unsave return strcmp::mov 2(sp),r0 ;Pick up 'a' mov 4(sp),r1 ;And 'b' 10$: cmpb (r0)+,(r1) ;Are they the same bne 20$ ;No tstb (r1)+ ;At the end of the string bne 10$ ;No clr r0 ;Equal return return 20$: blo 30$ ;Br if ab return return 30$: mov #-1,r0 ;A mov #tempf ,r0 mov 4(sp) ,r1 10$: movb (r0)+ ,(r1)+ bne 10$ unsave return .save .psect rwdata tempf: .asciz /TEMP.DAT/ .even .restore .sbttl Vanilla read from command terminal ; TD$TTREAD(&buffer,buffer_size) ; ; Read a line from the command terminal ; ; Passed: ; 2(sp) buffer address ; 4(sp) buffer size ; ; Returns: ; r0 # characters read (success) else zero (failure) ; ; Echoes a on completion to counter Dave Cutler's old ; FORTRAN record processing view of the world. td$ttr: save mov 4(sp) ,r1 ; buffer address clrb @r1 ; .asciz mov 6(sp) ,r0 ; buffer size sub #3 ,r0 ; allow for terminators and a null ble 90$ ; no room qiow$s #io.rvb,#5,#ef.tt,,#kbiost,, mov kbiost+2,r0 ; get set to return length add r0 ,r1 ; get pointer to eol cmpb kbiost ,#is.cr ; cr/lf at end desired ? bne 10$ ; no movb #CR ,(r1)+ ; *buffer++ = CR movb #LF ,(r1)+ ; *buffer++ = LF clrb @r1 ; .asciz add #2 ,r0 ; length += 2 10$: cmpb kbiost ,#is.suc ; successful read ? beq 100$ ; yes 90$: clr r0 ; no, return(0) 100$: qiow$s #io.wvb,#5,#ef.tt,,#kbiost,,<#linef,#1> unsave return .sbttl terminal read/write binary mode ; putbin(buffer,len) ; ; Passed: ; 2(sp) buffer address ; 4(sp) buffer length putbin::save ; save temp registers mov 6(sp) ,r0 ; get the passed length please bne 20$ ; something real to print mov 4(sp) ,r1 ; null length, asssume .asciz 10$: tstb (r1)+ ; find the end of the string beq 20$ ; found it inc r0 ; not ye, len++ br 10$ ; go back for next one 20$: mov 4(sp) ,r1 ; get the pointer to the string cmpb systyp ,#4 ; RSTS/E ? bne 30$ ; no mov #XRB ,r1 ; yes, do straight .writes mov r0 ,(r1)+ ; size of the write mov r0 ,(r1)+ ; size of the write, again mov 4(sp) ,(r1)+ ; buffer address clr (r1)+ ; channel zero clr (r1)+ ; unused clr (r1)+ ; unused also mov #4096. ,(r1)+ ; io.wal .WRITE br 40$ ; exit 30$: qiow$s #io.wal,#5,#ef.tt,,#kbiost,, ; and dump it 40$: clr r0 ; assume no errors and exit unsave ; pop register return ; ; Since the RSX ttdrv is not emualated on RSTS/E very well, we ; have to drop back to direct RSTS exec calls to do tt reads. getbin::clr -(sp) ; allocate single character buffer mov sp ,r0PDPIO MAC[.050036]PDPIO .MAC[.050036]    X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>?\\\\\\\\\`:#@'="\abcdefghi\\\\\\\jklmnopqr\\\\\\\~stuvwxyz\\\\\\\\\\\\\\\\\\\\\\{ABCDEFGHI\\\\\\}JKLMNOPQR\\\\\\\\STUVWXYZ\\\\\\0123456789\\\\\  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~@ggh<i|o<m<4p<p<k|Zn<l fr rwx<x<x<x޺<w@]@@fjnr]Ze@@|> | |v<H|  |  |xz|  |zt f r   < &^ @&@'*/V,"?Lh:hmBmz|z{x`y~|fN|@@|@͂|@ ݃ƃ<ns<|Ŏ |️|ep|u|-@率|<ᄇ2ֻr||ZRM | ntB|xyvZw|J=|R>|J? nnaa|bddfe and restore ;+ ; ; ; Index C register save and restore ; Index C program execution environment ; ; Usage ; ; jsr r5,csv$ ; ... ; jmp cret$ ; ; Description ; ; C program Run-time Environment ; ; Each C subroutine starts with a call to CSV$ and exits by ; jumping to CRET$. Upon exit, the stack need not be equal ; to its value on entrance. ; ; During the execution of all C subroutines, register R5 ; points to the current "environment." Within a subroutine, ; it appears as follows: ; ; _______________ ; | | ; SP -> | 1st loc. var. | -10(R5) C$AUTO-2(R5) ; |_______________| ; | | ; | Saved R2 | -6(R5) ; |_______________| ; | | ; | Saved R3 | -4(R5) ; |_______________| ; | | ; | Saved R4 | -2(R5) ; |_______________| ; | | ; R5 -> | Saved R5 | ; |_______________| ; | | ; | Return add. | +2(R5) ; |_______________| ; | | ; | First arg. | +4(R5) C$PMTR+0(R5) ; |_______________| ; | | ; | Second arg. | +6(R5) C$PMTR+2(R5) ; |_______________| ; ; Within a subroutine, Registers R0-R4 and the top of the ; stack, (sp) are available for use. Registers R0 and R1 ; are not preserved by subroutines and may be used to pass ; a return value. ; ; R5 must not be modified by a subroutine. All variable ; addressing must be done by offsets to R5. Subroutine ; arguments must be accessed by reference to C$PMTR. ; Subroutine local variables must be accessed by reference ; to C$AUTO. This permits modification of calling sequences ; without rewriting all subroutines. ; ; CSV$ refers to global symbol $$main to call the run-time startup ; program from the (RSX) library. ; ; Internal ; ; The global symbols needed for the Whitesmith's C compiler ; are also included. ; ; Bugs ; ;- ; ; Edit history ; 01 JMT Original ; 02 MM Documentation ; 03 MM Fix bug in CRET$ and define C$PMTR, C$AUTO ; 04 MM Bum one word and name $$main ; 05 MM C$PMTR/C$AUTO are now defined in RSX.MAC and RT11.MAC ; 06 MM Added C$SAV, C$RET and C$RETS entries for Whitesmith's ; ; ; If C$PMTR/C$AUTO are undefined, just define them ;05+ ; .iif ndf C$PMTR C$PMTR = 4 ;formal[n] @ c$pmtr+(r5) .iif ndf C$AUTO C$AUTO = -6 ;local[n] @ c$auto-(r5) .globl C$PMTR, C$AUTO .iif ne C$PMTR-4 .error Bad definition of C$PMTR .iif ne C$AUTO+6 .error Bad definition of C$AUTO ; ; By defining C$PMTR and C$AUTO as local symbols, the task ; builder need not do so much work ;05- .GLOBL $$MAIN ;Call start from the library ;04 .psect c$code ; ; save R4-R2 and make a one-word temp slot on the stack. ; C$SAV:: ;06 CSV$:: MOV R5, R0 MOV SP, R5 MOV R4, -(SP) MOV R3, -(SP) MOV R2, -(SP) JSR PC,(R0) ;TST -(SP) JMP (R0) ;04 ; ; pop R2-R4 and restore stack linkage registers. ; C$RET:: ;06 CRET$:: MOV R5, R2 ;03 + MOV -(R2), R4 MOV -(R2), R3 MOV -(R2), R2 ;03 - C$RETS:: ;Funny Whitesmith's entry ;06 MOV R5, SP MOV (SP)+, R5 RTS PC .psect rmscod ,ro,i .macro save list .if b , .ift save .iff .irp x, mov x,-(sp) .endr .endc .endm save .macro unsave list .if b , .ift unsave .iff .irp x, mov (sp)+,x .endr .endc .endm unsave .sbttl pattern matching ; FINSTR ; INSTR ; ; input: ; ; (r5) = address of the first string ; 2(r5) = length of the first string . ; 4(r5) = address of the second string, the one to find. ; 6(r5) = length of the second string. ; ; output: ; ; r0 = if > 0 then r0=position of second in first ; else the second is not a substring. ; ; edits: ; ; ; 01-mar-82 do not convert ctl's to letters bug ; 22-Aug-85 mod for use in C TED into the reslib $finst::mov sp ,r0 ; ignore case of letter br x ; and off to common code $instr::clr r0 ; flag normal case match x: save ; we use these here, so save. mov 4(r5) ,r1 ; the address of second one. mov 6(r5) ,r2 ; the length of second one. blePDPIO MAC[.050036]PDPIO .MAC[.050036]    X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>?\\\\\\\\\`:#@'="\abcdefghi\\\\\\\jklmnopqr\\\\\\\~stuvwxyz\\\\\\\\\\\\\\\\\\\\\\{ABCDEFGHI\\\\\\}JKLMNOPQR\\\\\\\\STUVWXYZ\\\\\\0123456789\\\\\  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~@ggh<i|o<m<4p<p<k|Zn<l fr rwx<x<x<x޺<w@]@@fjnr]Ze@@|> | |v<H|  |  |xz|  |zt f r   < &^ @&@'*/V,"?Lh:hmBmz|z{x`y~|fN|@@|@͂|@ ݃ƃ<ns<|Ŏ |️|ep|u|-@率|<ᄇ2ֻr||ZRM | ntB|xyvZw|J=|R>|J? nnaa|bddf ; letters, force both to upcase cmpb r2 ,(sp)+ ; and compare beq 20$ ; a match! (case insensitive) 10$: mov (sp)+ ,r2 ; failure exit, pop r2 and exit br 40$ ; bye 20$: mov (sp)+ ,r2 ; a match, pop r2 and exit br 50$ ; bye 40$: sec ; exit with failure return 50$: clc ; exit with success return ; bye ; come here for checking meta characters out ; ie, ^E? (compiled to codes > 191 (10) ) 70$: mov r4 ,-(sp) mov #mlist ,r4 ; look for a match in special 80$: tstb @r4 ; end of the table yet ? beq 100$ ; yes cmpb @r1 ,(r4)+ ; no, so look for a match! bne 80$ ; the end dec r4 ; fix the pointer up please sub #mlist ,r4 ; convert to 0..end asl r4 ; times two for jsr jsr pc ,@mdsp(r4) ; and call the correct matcher 90$: mov (sp)+ ,r4 ; pop temp register please return 100$: sec ; could not find the match char br 90$ ; exit with failure 'c' bit set .dsabl lsb .sbttl dispatch on match character code .enabl lsb 100$: br x.succ ; ^X any character will do 120$: call 180$ ; ^S not a letter or digit bcs x.succ ; simply swap the 'success' br x.fail ; exit 140$: br x.fail ; not implemented 160$: call islet ; (^E)A match any letter return 180$: call islet ; (^E)C match letter,digit,$ bcc x.succ ; did it call isdig ; try for a digit next bcc x.succ ; made it cmpb @r5 ,#'$ ; try dollar symbol beq x.succ ; a dollar cahr cmpb @r5 ,#'. ; last thing is a dot beq x.succ ; found a '.' br x.fail ; no 200$: call isdig ; (^E)D match any digit return ; exit 220$: ; (^E)Gq 240$: br x.fail ; (^E)L 260$: call isuc ; (^E)R match digit or upper bcc 270$ ; case letter call isdig ; 270$: return ; bye 280$: cmpb @r5 ,#40 ; (^E)s match a space or tab beq x.succ ; space matches cmpb @r5 ,#11 ; try a tab next please beq x.succ ; match br x.fail ; no match 300$: call islc ; (^E)v lower case letters return ; bye 320$: call isuc ; (^E)w upper case letters return ; bye x.succ: clc ; yes, clear carry and exit return ; bye x.fail: sec ; no match, set carry bit return .sbttl special match control characters ; ; case ord(match_char) of ; ; 1..128: match := ch = match_char ; ; 192: match := true ; ; 193: match := not ( ch in digits ) or ( ch in letters ) ; 194: error(not_implemented) ; ; 195: match := ( ch in letters ) ; ; 196: match := ( ch in letters ) or ( ch in digits ) ; or ( ch in ['$','.'] ) ; ; 197: match := ( ch in digits ) ; ; 198: error(not_implemented) ; ; 199: error(not_implemented) ; ; 200: match := ( ch in digits ) or ( ch in big_letters ); ; 201: match := ( ch = tab ) or ( ch = space ) ; ; 202: match := ( ch in small_letters ) ; ; 203: match := ( ch in big_letters ) ; ; ; end ; .blkb 46 ;****?????**** .save .psect insdsp ,ro,d,lcl,rel,con mlist: .byte 192.,193.,194.,195.,196.,197.,198.,199. .byte 200.,201.,202.,203.,0 .even mdsp: .word 100$,120$,140$,160$,180$,200$,220$,240$ .word 260$,280$,300$,320$ .restore .dsabl lsb .enabl lsb .dsabl lc isdig: cmpb @r5 ,#'0 ; digit match? blo 10$ ; no cmpb @r5 ,#'9 ; next part please bhi 10$ ; no 5$: clc ; yes return 10$: sec ; not a digit return ; bye islet: call isuc ; try for upper case bcc 20$ ; yep call islc ; try for lower case 20$: return ; bye isuc: cmpb @r5 ,#'A ; try for a letter blo 10$ ; no a letter for sure cmpb @r5 ,#'Z ; might be a letter blos 5$ ; yep br 10$ ; exit islc: cmpb @r5 ,#'A!40 ; try lower case blo 10$ ; no cmpb @r5 ,#'Z!40 ; maybe blos 5$ ; no br 10$ ; yes .dsabl lsb .sbttl dummy main ept .mcall exit$s $$main::cmp resver ,#..resv beq 10$ clr -(sp) mov #badver ,-(sp) call putbin exit$s 10$: call main exit$s .save .psect rwdata ,d badver: .asciz /Wrong version of EDRESL/<15><12> .even .restore .globl resver,..resv .end $$main PDPIO MAC[.050036]PDPIO .MAC[.050036]   X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>?\\\\\\\\\`:#@'="\abcdefghi\\\\\\\jklmnopqr\\\\\\\~stuvwxyz\\\\\\\\\\\\\\\\\\\\\\{ABCDEFGHI\\\\\\}JKLMNOPQR\\\\\\\\STUVWXYZ\\\\\\0123456789\\\\\