Trailing-Edge
-
PDP-10 Archives
-
decuslib10-05
-
43,50337/23/match6.mac
There is 1 other file named match6.mac in the archive. Click here to see a list.
00100 COMMENT * match6, SIMULA specification;
00200 OPTIONS(/E:QUICK,match6);
00300 INTEGER PROCEDURE match6(id1,id2,mask); INTEGER id1,id2,mask;
00400 COMMENT ID1 (without wild characters) is tested against ID2
00500 with MASK showing wild card positions in ID2 if any.
00600 The result is 1 for an exact match, -1 for a wildcard match,
00700 0 for no match. ID1 and ID2 are in SIXBIT code.
00800 ;
00900
01000 !*;! MACRO-10 code !*;!
01100
01200 TITLE match6
01300 ENTRY match6
01400 SUBTTL SIMULA utility, Lars Enderin Jun 1978
01500
01600 ;!*** Copyright 1978 by the Swedish Defence Research Institute. ***
01700 ;!*** Copying is allowed. ***
01800
01900
02000 sall
02100 search simmac,simmcr,simrpa
02200 macinit
02300
02400 ;! Local definitions ;!
02500
02600 mask==<1+<id2==<1+<id1==0>>>>
02700
02800 match6: PROC
02900 LD X0,id1(XTAC)
03000 SETZM (XTAC) ;! No match assumed
03100 CAMN X0,X1
03200 GOTO match
03300
03400 SKIPN mask(XTAC)
03500 GOTO nomatch
03600
03700 ANDCM X0,mask(XTAC)
03800 ANDCM X1,mask(XTAC)
03900 SOS (XTAC)
04000 CAME X0,X1
04100 match: AOS (XTAC)
04200 nomatch:RET
04300 EPROC
04400 LIT
04500 END;