Files
Digital-Research-Source-Code/ASSEMBLY & COMPILE TOOLS/PLM VAX COMPILER/plmudi/skips.mar
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

99 lines
2.9 KiB
Plaintext

.TITLE SKIPS. PLM RUNTIME LIBRARY: SKIPB, ET AL.
;-----------------------------------------------------------------------
;
; D I S C L A I M E R N O T I C E
; ------------------- -----------
;
; This document and/or portions of the material and data furnished
; herewith, was developed under sponsorship of the U. S. Government.
; Neither the U.S. nor the U.S.D.O.E., nor the Leland Stanford Junior
; University, nor their employees, nor their respective contractors,
; subcontractors, or their employees, makes any warranty, express or
; implied, or assumes any liability or responsibility for accuracy,
; completeness or usefulness of any information, apparatus, product
; or process disclosed, or represents that its use will not infringe
; privately-owned rights. Mention of any product, its manufacturer,
; or suppliers shall not, nor is it intended to, imply approval, dis-
; approval, or fitness for any particular use. The U. S. and the
; University at all times retain the right to use and disseminate same
; for any purpose whatsoever. Such distribution shall be made by the
; National Energy Software Center at the Argonne National Laboratory
; and only subject to the distributee furnishing satisfactory proof
; that he has a valid license from the Intel Corporation in effect.
;
;-----------------------------------------------------------------------
.PSECT PLMRUN_CODE,RD,NOWRT,EXE,GBL,CON,LONG
;
; W = SKIPB(SOURCE,TARGET,COUNT)
;
SOURCE=4 ; POINTER.
TARGET=8 ; BYTE OR WORD.
COUNT=12 ; WORD.
SKIPB.L::
SKIPB.S::
.ENTRY SKIPB.,^M<>
SKPC TARGET(AP),COUNT(AP),@SOURCE(AP)
BNEQ 1$
DECW R0 ; ENTIRE STRING SKIPPED: RETURN 0FFFFH.
RET
1$: SUBW3 R0,COUNT(AP),R0 ; NON-MATCH FOUND: RETURN STRING INDEX.
RET
;
; W = SKIPRB(SOURCE,TARGET,COUNT)
;
SKIPRB.L::
SKIPRB.S::
.ENTRY SKIPRB.,^M<R3>
MOVZWL COUNT(AP),R0
BEQL 3$ ; ENTIRE STRING SKIPPED IF LENGTH=0.
ADDL3 R0,SOURCE(AP),R1
MOVB TARGET(AP),R3
2$: CMPB R3,-(R1)
BNEQ 3$
SOBGTR R0,2$
3$: DECW R0 ; RETURN INDEX OF LAST NON-MATCH.
RET ; (0FFFFH IF ALL MATCHED.)
;
; W = SKIPW(SOURCE,TARGET,COUNT)
;
SKIPW.L::
SKIPW.S::
.ENTRY SKIPW.,^M<R3>
MOVZWL COUNT(AP),R0
BEQL 3$ ; ENTIRE STRING SKIPPED IF LENGTH=0.
MOVL SOURCE(AP),R1
MOVW TARGET(AP),R3
2$: CMPW R3,(R1)+
BNEQ 4$
SOBGTR R0,2$
3$: DECW R0 ; ENTIRE STRING SKIPPED: RETURN 0FFFFH.
RET
4$: SUBW3 R0,COUNT(AP),R0 ; NON-MATCH FOUND: RETURN STRING INDEX.
RET
;
; W = SKIPRW(SOURCE,TARGET,COUNT)
;
SKIPRW.L::
SKIPRW.S::
.ENTRY SKIPRW.,^M<R3>
MOVZWL COUNT(AP),R0
BEQL 3$ ; ENTIRE STRING SKIPPED IF LENGTH=0.
ADDL3 R0,SOURCE(AP),R1
ADDL2 R0,R1
MOVW TARGET(AP),R3
2$: CMPW R3,-(R1)
BNEQ 3$
SOBGTR R0,2$
3$: DECW R0 ; RETURN INDEX OF LAST NON-MATCH.
RET ; (0FFFFH IF ALL MATCHED.)
.END