; no, return current position+1 brb 100$ ; exit 30$: incl r8 ; more to do, move along in the source incl r7 ; and also in the pattern string. cmpb (r7) ,(r8) ; place this check inline beql 35$ ; if not, then call matchc jsb matchc ; see if the next character matches tstl r0 ; did they match? beql 50$ ; no 35$: sobgtr r6 ,30$ ; yes, check the next one please 40$: incl r9 ; success, exit brb 100$ ; bye 50$: movl r4 ,r8 ; restore the pattern string pointer movl r3 ,r7 ; restore the source string pointer movzwl 16(ap) ,r6 ; restore the pattern string length 80$: incl r7 ; next source string character please incl r9 ; increment current position sobgeq r10 ,10$ ; check next character in source 90$: clrl r9 ; failure, return zero and exit 100$: movl r9 ,r0 ; success, return the position ret .sbttl matchc check for character match, special case ;+ MATCHC(c1,c2) ; ; Matchc will first check for equality without concern for ; case. If this fails it will then check for META characters ; in the pattern character, and if so will try to match the ; various classes. ; This is rewritten from the C version for speed, since pat- ; tern matching is just about the most frequent thing a text ; editor has to do. ; ; Passed: R7 address of source character ; R8 address of pattern character ; ;- Return: R0 zero for failure, else success matchc: movzbl #1 ,r0 ; success flag (assume true) movzbl (r7) ,r1 ; the source string movzbl (r8) ,r2 ; the pattern string cmpb r2 ,#METAMIN ; is this a wildcarded character blssu 10$ ; no jsb meta_match ; yes, try for class matches brb 100$ ; and exit 10$: cmpb L^mtab_map(r1),L^mtab_map(r2) ; do the characters map to the same? beqlu 100$ ; yes, return success then 90$: clrl r0 ; failure exit 100$: rsb ; exit .sbttl meta character matching ;+ Passed: R1 the character to match ; R2 the meta character ; ;- Return: R0 zero for failure, else success ; #define metamin 192 ; #define any 192 ; #define notalfa 193 ; #define let 195 ; #define alfa 196 ; #define digit 197 ; #define letdig 200 ; #define white 201 ; #define smalllet 202 ; #define biglet 203 METAMIN = ^D192 METAMAX = ^D203 LARGEA = ^O101 LARGEZ = ^O132 SMALLA = LARGEA!^O40 SMALLZ = LARGEZ!^O40 SPACE = ^O40 TAB = ^O11 meta_match: casew r2,#METAMIN,#METAMAX-METAMIN 10$: .word case_any - 10$ ; 192 match anything .word case_notalfa - 10$ ; 193 match not in (a..z,A..Z,0..9,.,$) .word case_notimp - 10$ ; 194 obvious by the name .word case_let - 10$ ; 195 match (a..z,A..Z) .word case_alfa - 10$ ; 196 match (a..z,A..Z,0..9,.,$) .word case_digit - 10$ ; 197 match (0..9) .word case_notimp - 10$ ; 198 obvious by the name .word case_notimp - 10$ ; 199 obvious by the name .word case_letdig - 10$ ; 200 match (a..z,A..Z,0..9) .word case_white - 10$ ; 201 match (SPACE,TAB) .word case_smalllet - 10$ ; 202 match (a..z) .word case_biglet - 10$ ; 203 match (A..Z) clrl r0 ; xxx anything else rsb case_notimp: clrl r0 ; return(0) for not implemented rsb ; and exit case_any: movzbl #1 ,r0 ; return(1) rsb ; with result true in r0 case_notalfa: jsb case_alfa ; simply call alfa and return with decl r0 ; convert true to false (1 to zero) rsb ; and zero to -1 case_let: cmpb r1 ,#LARGEA ; check for small or large letter blssu 20$ ; can't be a letter cmpb r1 ,#LARGEZ ; try 'Z' blequ 10$ ; could be lowercase cmpb r1 ,#SMALLA ; try lowercase now blssu 20$ ; no cmpb r1 ,#SMALLZ ; try lowercase z bgtru 20$ ; no 10$: movzbl #1 ,r0 ; success rsb 20$: clrl r0 ; failure rsb case_alfa: cmpb r1 ,#^A/$/ ; allow $ and . please beql 10$ ; got it cmpb r1 ,#^A/./ ; what about this one? beql 10$ ; success jsb case_let ; check for a letter ? tstl r0 ; well? bneq 10$ ; success jsb case_digit ; try for a number brb 100$ ; exit with digit status then EDFINDMAR[.050036]EDFIND.MAR[.050036]    X1혀4¿|HÞï þÿÿ[ú«4ÿ;ßïöëÿÿÝûÿIßkûÿ(Ÿ«ûÿ&ûÿ'( «á«ôÑk ß«Hûÿ&ú«PïŠú«`ï‚ßï®ëÿÿŸ« ûÿüÐ\žËàïR™rP �P2PPzPP{�PPP÷PP2P~ûÿ®ñ�ÿÿÿÿ\ÐÿŸ«ûÿªŸ«$ûÿ ûÿ�Ð\Ã\T‘D«á �0D«áó \ìÎ~ûÿŠŸ« ûÿhûÿi) «ô«á+Ô\ ^( «án ^( ïëÿÿn°«pÀ\Ð^«tú«xÿYÀ\^úË€ÿÐ\ßïÎêÿÿÝûÿ!ßkûÿŸ«ûÿþûÿÿÐVÕk<Ý\ÝûÿñžFË×ï˰<�Ë´ßˬûÿÇûÿÌÖ\À�VÑVkÆ”úˤÿ—1`þ@ÐïlüÿÿP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<¼SЬTЬ UÔQÕS><„PÑP�ÿùÐ�å¹P×S'{�@PRP�B¯ …×S{(PRP�B¯’…×S�@¯‰…¾@@Œ˜ ("@$$Ø#0$è#$8$%˜$%(%è$! @"FORRTLLIBRTL7-./% <=2&?'@O{[lP}M]\Nk`Kaðñòóôõö÷øùz^L~no|ÁÂÃÄÅÆÇÈÉÑÒÓÔÕÖרÙâãäåæçèéJàZ_my�‚ƒ„…†‡ˆ‰‘’“”•–—˜™¢£¤¥¦§¨©ÀjС???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????ÿ\ \\\\ \\\\\\\\\\ \\\\\\\\\\\\\\\\ \\\\\\\\\[.<(+!&\\\\\\\\\]$*);^-/\\\\\\\\|,%_>?\\\\\\\\\`:#@'="\abcdefghi\\\\\\\jklmnopqr\\\\\\\~stuvwxyz\\\\\\\\\\\\\\\\\\\\\\{ABCDEFGHI\\\\\\}JKLMNOPQR\\\\\\\\STUVWXYZ\\\\\\0123456789\\\\\ÿ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏðÑÒÓÔÕÖרÙÚÛÜÝþÿ@ïgïgï†h<ïi|ï¿o<ïËm<ï4p<ï’p<ïêk|ïZn<ïÁl ïfr ï†rï“wïšx<ï¯x<ïµx<ï¦xïÞº<ïæºï…w@ï]¿@ï¿@ï–¿ïfÉïjÉïnÉïrÉïŠÉüïúÎüï�Ñüï]æïéï¦êïZêïæìüïîïòîïöîïïïeð@ïñ@ïÚð|ï>ñ ï†ñ|ï òüïÆò|ïÒýïÑv<ïHÿïï¢|ï€ ï‚ |ï® ï´ |ïxïz|ï ï |ïzï€ït ïf ïr ï’ ïÎ <ïò ï&ïüï^ ü@ïâ&ü@ïŽ'üï*/üïV,ï"?ïLhï:hïÒmïBmüïz|ï¼zï±{üïäxüï`yüï²~|ïf�ïN‚|@ï@ƒ|@ïÍ‚|@ï ƒüïôƒüï݃üïÆƒ<ïn�ïs�<ïê�ïó�|ïÅŽï �|ïˆ�ï¸�|ïeŽïpŽ|ïuŽ|ïŽï-Ž@率üïî›|üïæ±<ï¾²üï2³üïš»üïÖ»üïr¾ï�¾|ïªÂ|ïÃüïªÃïZÈïÉüïRÄïMÆüïšÉï ÉüïÊï Ê|ïžÓï³ÓüïÔïÔüïšÔüïÙï ÙüïnÛïtÛüïÞÛüïºÜüïBÞ|ï·xï±yüïÞvüïZw|ïJ=|ïR>|ïJ?ï† ïÎnïÎnï–aïäa|ï–bï²dïºdüïf 10$: movzbl #1 ,r0 ; return(success) 100$: rsb ; and exit case_digit: cmpb r1 ,#^A/0/ ; check for a digit today blssu 10$ ; no cmpb r1 ,#^A/9/ ; well? bgtru 10$ ; no movzbl #1 ,r0 ; yes, return success rsb 10$: clrl r0 ; failure, return(0) rsb ; and back to matchc case_letdig: jsb case_let ; a letter ? tstl r0 ; well? bneq 10$ ; yes jsb case_digit ; no, what about a digit 10$: rsb case_white: cmpb r1 ,#SPACE ; a space ? beql 10$ ; yes cmpb r1 ,#TAB ; a tab? bneq 20$ ; no 10$: movzbl #1 ,r0 ; return success rsb ; back to matchc 20$: clrl r0 ; return failure rsb ; back to matchc case_smalllet: cmpb r1 ,#SMALLA ; lower case letter? blssu 20$ ; no cmpb r1 ,#SMALLZ ; perhaps, is it in range bgtru 20$ ; no movzbl #1 ,r0 ; yes, return(1) rsb 20$: clrl r0 ; no, return failure rsb case_biglet: cmpb r1 ,#LARGEA ; lower case letter? blssu 20$ ; no cmpb r1 ,#LARGEZ ; perhaps, is it in range bgtru 20$ ; no movzbl #1 ,r0 ; yes, return(1) rsb 20$: clrl r0 ; no, return failure rsb .end