head     56.3;
access   paws bayes jws quist brad dew jwh;
symbols  ;
locks    ; strict;
comment  @# @;


56.3
date     93.01.27.13.21.28;  author jwh;  state Exp;
branches ;
next     56.2;

56.2
date     93.01.27.12.01.52;  author jwh;  state Exp;
branches ;
next     56.1;

56.1
date     91.11.05.09.41.22;  author jwh;  state Exp;
branches ;
next     55.1;

55.1
date     91.08.25.10.19.40;  author jwh;  state Exp;
branches ;
next     54.3;

54.3
date     91.08.21.12.37.32;  author jwh;  state Exp;
branches ;
next     54.2;

54.2
date     91.08.21.09.49.29;  author jwh;  state Exp;
branches ;
next     54.1;

54.1
date     91.03.18.15.24.41;  author jwh;  state Exp;
branches ;
next     53.1;

53.1
date     91.03.11.19.25.52;  author jwh;  state Exp;
branches ;
next     52.1;

52.1
date     91.02.19.09.09.50;  author jwh;  state Exp;
branches ;
next     51.1;

51.1
date     91.01.30.16.09.16;  author jwh;  state Exp;
branches ;
next     50.1;

50.1
date     90.10.29.16.24.16;  author jwh;  state Exp;
branches ;
next     49.1;

49.1
date     90.08.14.14.08.33;  author jwh;  state Exp;
branches ;
next     48.1;

48.1
date     90.07.26.11.14.34;  author jwh;  state Exp;
branches ;
next     47.1;

47.1
date     90.05.14.10.55.45;  author dew;  state Exp;
branches ;
next     46.1;

46.1
date     90.05.07.08.42.54;  author jwh;  state Exp;
branches ;
next     45.1;

45.1
date     90.04.19.15.50.21;  author jwh;  state Exp;
branches ;
next     44.1;

44.1
date     90.04.01.22.07.56;  author jwh;  state Exp;
branches ;
next     43.1;

43.1
date     90.03.20.13.59.08;  author jwh;  state Exp;
branches ;
next     42.1;

42.1
date     90.01.23.17.43.28;  author jwh;  state Exp;
branches ;
next     41.1;

41.1
date     89.12.22.11.26.39;  author jwh;  state Exp;
branches ;
next     40.1;

40.1
date     89.09.29.11.48.50;  author jwh;  state Exp;
branches ;
next     39.1;

39.1
date     89.09.26.16.33.23;  author dew;  state Exp;
branches ;
next     38.1;

38.1
date     89.08.29.11.24.37;  author jwh;  state Exp;
branches ;
next     37.1;

37.1
date     89.05.12.11.37.24;  author dew;  state Exp;
branches ;
next     36.1;

36.1
date     89.02.06.10.16.02;  author dew;  state Exp;
branches ;
next     35.1;

35.1
date     89.02.02.13.29.36;  author dew;  state Exp;
branches ;
next     34.1;

34.1
date     89.01.23.16.04.44;  author jwh;  state Exp;
branches ;
next     33.1;

33.1
date     89.01.16.11.37.58;  author dew;  state Exp;
branches ;
next     32.1;

32.1
date     89.01.10.11.45.23;  author bayes;  state Exp;
branches ;
next     31.1;

31.1
date     88.12.14.18.06.37;  author bayes;  state Exp;
branches ;
next     30.1;

30.1
date     88.12.09.13.44.06;  author dew;  state Exp;
branches ;
next     29.1;

29.1
date     88.10.31.15.28.36;  author bayes;  state Exp;
branches ;
next     28.1;

28.1
date     88.10.06.10.56.38;  author dew;  state Exp;
branches ;
next     27.1;

27.1
date     88.09.29.11.26.20;  author bayes;  state Exp;
branches ;
next     26.1;

26.1
date     88.09.28.13.06.01;  author bayes;  state Exp;
branches ;
next     25.1;

25.1
date     88.03.02.09.23.46;  author bayes;  state Exp;
branches ;
next     24.1;

24.1
date     87.08.31.09.42.32;  author jws;  state Exp;
branches ;
next     23.1;

23.1
date     87.08.26.10.19.24;  author bayes;  state Exp;
branches ;
next     22.1;

22.1
date     87.08.17.11.03.55;  author bayes;  state Exp;
branches ;
next     21.1;

21.1
date     87.08.12.13.47.54;  author bayes;  state Exp;
branches ;
next     20.1;

20.1
date     87.07.30.11.00.54;  author bayes;  state Exp;
branches ;
next     19.1;

19.1
date     87.06.01.08.16.49;  author jws;  state Exp;
branches ;
next     18.1;

18.1
date     87.05.20.15.12.40;  author bayes;  state Exp;
branches ;
next     17.1;

17.1
date     87.04.30.10.28.05;  author jws;  state Exp;
branches ;
next     16.1;

16.1
date     87.04.26.15.40.47;  author jws;  state Exp;
branches ;
next     15.1;

15.1
date     87.04.13.09.14.05;  author jws;  state Exp;
branches ;
next     14.1;

14.1
date     87.04.01.15.16.33;  author jws;  state Exp;
branches ;
next     13.1;

13.1
date     87.02.28.18.26.44;  author jws;  state Exp;
branches ;
next     12.1;

12.1
date     87.02.02.13.16.41;  author jws;  state Exp;
branches ;
next     11.1;

11.1
date     87.01.19.09.42.48;  author jws;  state Exp;
branches ;
next     10.1;

10.1
date     86.12.24.10.50.13;  author jws;  state Exp;
branches ;
next     9.1;

9.1
date     86.12.12.14.28.03;  author bayes;  state Exp;
branches ;
next     8.1;

8.1
date     86.11.27.11.47.40;  author jws;  state Exp;
branches ;
next     7.2;

7.2
date     86.11.24.12.56.33;  author jws;  state Exp;
branches ;
next     7.1;

7.1
date     86.11.20.13.37.05;  author hal;  state Exp;
branches ;
next     6.1;

6.1
date     86.11.04.17.47.13;  author paws;  state Exp;
branches ;
next     5.1;

5.1
date     86.10.28.16.34.49;  author hal;  state Exp;
branches ;
next     4.1;

4.1
date     86.09.30.19.39.25;  author hal;  state Exp;
branches ;
next     3.1;

3.1
date     86.09.01.11.49.03;  author hal;  state Exp;
branches ;
next     2.1;

2.1
date     86.07.30.14.35.42;  author hal;  state Exp;
branches ;
next     1.1;

1.1
date     86.06.30.14.36.55;  author danm;  state tmp;
branches ;
next     ;


desc
@Base file for PWS 3.2 release.

@


56.3
log
@
pws2rcs automatic delta on Wed Jan 27 13:14:25 MST 1993
@
text
@RET     EQU     A0      return address
SADDR   EQU     A1      source address
DADDR   EQU     A2      destination address
SRCEND  EQU     A3      source end
ATEMP   EQU     A4      temporary A register
*
SLEN    EQU     D0      source length
SINDEX  EQU     D1      source index
CURSLEN EQU     D2      current source length
DINDEX  EQU     D3      destination index
DMAX    EQU     D4      destination max
COUNT   EQU     D5
INDEX   EQU     D5      string index
TEMP1   EQU     D6      temporary D register
TEMP2   EQU     D7      temporary D register
*
	refa    SYSGLOBALS
ESCAPECODE EQU  SYSGLOBALS-2
*
*
*
*  procedure psubtopsub(dsublen: integer;
*                       var dsub: paoctype;
*                       dindex: integer;
*                       ssublen: integer;
*                       var ssub: paoctype;
*                       sindex,slen: integer);
*
ASM_PSUBTOPSUB  EQU *
	def     ASM_PSUBTOPSUB
*
	movea.l (sp)+,RET
	move.l  (sp)+,SLEN
	bgt.s   LLLL1
	     adda.l     #24,sp
	     jmp        (RET)
LLLL1   move.l  (sp)+,SINDEX
	ble     error

	movea.l (sp)+,SADDR
	move.l  (sp)+,CURSLEN
	move.l  SINDEX,TEMP1
	add.l   SLEN,TEMP1
	subq.l  #1,TEMP1
	cmp.l   TEMP1,CURSLEN
	blt.s   error

	move.l  (sp)+,DINDEX
	ble.s   error

	move.l  DINDEX,TEMP1
	add.l   SLEN,TEMP1
	movea.l (sp)+,DADDR
	move.l  (sp)+,DMAX
	add.l   #1,DMAX
	cmp.l   TEMP1,DMAX
	blt.s   error

	lea     -1(SADDR,SINDEX.L),SADDR
	lea     -1(DADDR,DINDEX.L),DADDR
	bra     TRANSFER
*
*
*
*  procedure ssubtopsub(dsublen: integer;
*                       var dsub: paoctype;
*                       dindex: integer;
*                       var ssub: string;
*                       sindex,slen: integer);
*
ASM_SSUBTOPSUB  EQU *
	def     ASM_SSUBTOPSUB
*
	movea.l (sp)+,RET
	move.l  (sp)+,SLEN
	bgt.s   LLL1
	     adda.l     #22,sp
	     jmp        (RET)
LLL1    move.l  (sp)+,SINDEX
	ble.s   error

	movea.l (sp)+,SADDR
	moveq   #0,CURSLEN
	move.b  (SADDR),CURSLEN
	addq.w  #1,CURSLEN
	move.l  SINDEX,TEMP1
	add.l   SLEN,TEMP1
	cmp.l   TEMP1,CURSLEN
	blt.s   error

	move.w  (sp)+,TEMP1
	move.l  (sp)+,DINDEX
	ble.s   error

	move.l  DINDEX,TEMP1
	add.l   SLEN,TEMP1
	movea.l (sp)+,DADDR
	move.l  (sp)+,DMAX
	addq.l  #1,DMAX
	cmp.l   TEMP1,DMAX
	blt.s   error

	lea     0(SADDR,SINDEX.L),SADDR
	lea     -1(DADDR,DINDEX.L),DADDR
	bra.s   TRANSFER
*
*
*
*  procedure ssubtossub(var dsub: string;
*                       dindex: integer;
*                       var ssub: string;
*                       sindex,slen: integer);
*
ASM_SSUBTOSSUB  EQU *
	def     ASM_SSUBTOSSUB
*
	movea.l (sp)+,RET
	move.l  (sp)+,SLEN
	bgt.s   L1
	     adda.l     #20,sp
	     jmp        (RET)
L1      move.l  (sp)+,SINDEX
	bgt.s   L2
error        move.w     #-8,ESCAPECODE(a5)
	     trap       #10
L2      movea.l (sp)+,SADDR
	moveq   #0,CURSLEN
	move.b  (SADDR),CURSLEN
	addq.w  #1,CURSLEN
	move.l  SINDEX,TEMP1
	add.l   SLEN,TEMP1
	cmp.l   TEMP1,CURSLEN
	blt.s   error

	move.w  (sp)+,TEMP1
	move.l  (sp)+,DINDEX
	ble.s   error

	move.l  DINDEX,TEMP1
	add.l   SLEN,TEMP1
	movea.l (sp)+,DADDR
	moveq   #0,DMAX
	move.b  (sp)+,DMAX
	moveq   #0,TEMP2
	move.w  DMAX,TEMP2
	addq.l  #1,TEMP2
	cmp.l   TEMP1,TEMP2
	blt.s   error

	moveq   #0,TEMP2
	move.b  (DADDR),TEMP2
	addq.l  #1,TEMP2
	cmp.l   DINDEX,TEMP2
	blt.s   error

	cmp.w   TEMP1,TEMP2
	bge.s   L3
	subq.w  #1,TEMP1
	move.b  TEMP1,(DADDR)
*
*  End of error checking.
*
L3      lea     0(SADDR,SINDEX.L),SADDR
	lea     0(DADDR,DINDEX.L),DADDR

TRANSFER equ *
	cmpa.l  SADDR,DADDR
	bgt.s   topdown
*
*  Transfer from bottom to top
*
L4      move.b  (SADDR)+,(DADDR)+
	subq.l  #1,SLEN
	bgt.s   L4
	jmp     (RET)
*
*  Transfer from top to bottom
*
topdown equ *
	lea     0(SADDR,SLEN),SADDR
	lea     0(DADDR,SLEN),DADDR
L5      move.b  -(SADDR),-(DADDR)
	subq.l  #1,SLEN
	bgt.s   L5
	jmp     (RET)
*
*
*
*  procedure psubtossub(var dsub: string;
*                       dindex: integer;
*                       ssublen: integer;
*                       var ssub: paoctype;
*                       sindex,slen: integer);
*
ASM_PSUBTOSSUB  EQU *
	def     ASM_PSUBTOSSUB
*
	movea.l (sp)+,RET
	move.l  (sp)+,SLEN
	bgt.s   LL1
	     adda.l     #22,sp
	     jmp        (RET)
LL1     move.l  (sp)+,SINDEX
	ble.s   error

	movea.l (sp)+,SADDR
	move.l  (sp)+,CURSLEN
	move.l  SINDEX,TEMP1
	add.l   SLEN,TEMP1
	subq.l  #1,TEMP1
	cmp.l   TEMP1,CURSLEN
	blt     error

	move.l  (sp)+,DINDEX
	ble     error

	move.l  DINDEX,TEMP1
	add.l   SLEN,TEMP1
	movea.l (sp)+,DADDR
	moveq   #0,DMAX
	move.b  (sp)+,DMAX
	moveq   #0,TEMP2
	move.w  DMAX,TEMP2
	addq.l  #1,TEMP2
	cmp.l   TEMP1,TEMP2
	blt     error

	moveq   #0,TEMP2
	move.b  (DADDR),TEMP2
	addq.l  #1,TEMP2
	cmp.l   DINDEX,TEMP2
	blt     error

	cmp.w   TEMP1,TEMP2
	bge.s   LL2
	subq.w  #1,TEMP1
	move.b  TEMP1,(DADDR)

LL2     lea     -1(SADDR,SINDEX.L),SADDR
	lea     0(DADDR,DINDEX.L),DADDR
	bra.s   TRANSFER
*
*
*
*  function strrtrim(s: stringmax): stringmax;
*
*
ASM_STRRTRIM  EQU *
	DEF   ASM_STRRTRIM
*
	movea.l (sp)+,RET
	movea.l (sp)+,SADDR
	movea.l (sp)+,DADDR
	moveq   #0,SLEN
	move.b  (SADDR)+,SLEN
	lea     0(SADDR,SLEN.W),SRCEND
	addq.w  #1,SLEN
rtrim1  subq.w  #1,SLEN
	ble.s   null
	cmpi.b  #32,-(SRCEND)
	beq.s   rtrim1

null    move.b  SLEN,(DADDR)+
	beq.s   retrn

rtrim2  move.b  (SADDR)+,(DADDR)+
	subq.w  #1,SLEN
	bgt.s   rtrim2
retrn   jmp     (RET)
*
*
*
*  function strltrim(s: stringmax): stringmax;
*
*
ASM_STRLTRIM  EQU *
	DEF   ASM_STRLTRIM
*
	movea.l (sp)+,RET
	movea.l (sp)+,SADDR
	movea.l (sp)+,DADDR
	moveq   #0,SLEN
	move.b  (SADDR)+,SLEN
	beq.s   ltrim2
	bra.s   ltrim1

ltrim0  subq.w  #1,SLEN
	beq.s   ltrim2

ltrim1  cmpi.b  #32,(SADDR)+
	beq.s   ltrim0

ltrim2  move.b  SLEN,(DADDR)+
	beq.s   retrnn

	lea     -1(SADDR),SADDR
ltrim3  move.b  (SADDR)+,(DADDR)+
	subq.w  #1,SLEN
	bgt.s   ltrim3
retrnn  jmp     (RET)
*
*
*
*  function strrpt(s: stringmax; count: integer)
*                                    : stringmax;
*
*
ASM_STRRPT    EQU *
	DEF   ASM_STRRPT
*
	movea.l (sp)+,RET
	move.l  (sp)+,COUNT
	movea.l (sp)+,SADDR
	movea.l (sp)+,DADDR
	moveq   #0,SLEN
	move.b  (SADDR)+,SLEN
	move.l  COUNT,TEMP1
	cmpi.l  #255,TEMP1
	bhi     error

	muls    SLEN,TEMP1
	cmpi.l  #255,TEMP1
	bgt     error

	move.b  TEMP1,(DADDR)+
	beq.s   retrrn

rpt0    movea.l SADDR,ATEMP
	move.l  SLEN,TEMP1
rpt1    move.b  (ATEMP)+,(DADDR)+
	subq.w  #1,TEMP1
	bgt.s   rpt1
	subq.w  #1,count
	bgt.s   rpt0
retrrn  jmp     (RET)
	end
@


56.2
log
@
pws2rcs automatic delta on Wed Jan 27 11:57:27 MST 1993
@
text
@d1 336
@


56.1
log
@Automatic bump of revision number for PWS version 3.25
@
text
@a0 336
RET     EQU     A0      return address
SADDR   EQU     A1      source address
DADDR   EQU     A2      destination address
SRCEND  EQU     A3      source end
ATEMP   EQU     A4      temporary A register
*
SLEN    EQU     D0      source length
SINDEX  EQU     D1      source index
CURSLEN EQU     D2      current source length
DINDEX  EQU     D3      destination index
DMAX    EQU     D4      destination max
COUNT   EQU     D5
INDEX   EQU     D5      string index
TEMP1   EQU     D6      temporary D register
TEMP2   EQU     D7      temporary D register
*
	refa    SYSGLOBALS
ESCAPECODE EQU  SYSGLOBALS-2
*
*
*
*  procedure psubtopsub(dsublen: integer;
*                       var dsub: paoctype;
*                       dindex: integer;
*                       ssublen: integer;
*                       var ssub: paoctype;
*                       sindex,slen: integer);
*
ASM_PSUBTOPSUB  EQU *
	def     ASM_PSUBTOPSUB
*
	movea.l (sp)+,RET
	move.l  (sp)+,SLEN
	bgt.s   LLLL1
	     adda.l     #24,sp
	     jmp        (RET)
LLLL1   move.l  (sp)+,SINDEX
	ble     error

	movea.l (sp)+,SADDR
	move.l  (sp)+,CURSLEN
	move.l  SINDEX,TEMP1
	add.l   SLEN,TEMP1
	subq.l  #1,TEMP1
	cmp.l   TEMP1,CURSLEN
	blt.s   error

	move.l  (sp)+,DINDEX
	ble.s   error

	move.l  DINDEX,TEMP1
	add.l   SLEN,TEMP1
	movea.l (sp)+,DADDR
	move.l  (sp)+,DMAX
	add.l   #1,DMAX
	cmp.l   TEMP1,DMAX
	blt.s   error

	lea     -1(SADDR,SINDEX.L),SADDR
	lea     -1(DADDR,DINDEX.L),DADDR
	bra     TRANSFER
*
*
*
*  procedure ssubtopsub(dsublen: integer;
*                       var dsub: paoctype;
*                       dindex: integer;
*                       var ssub: string;
*                       sindex,slen: integer);
*
ASM_SSUBTOPSUB  EQU *
	def     ASM_SSUBTOPSUB
*
	movea.l (sp)+,RET
	move.l  (sp)+,SLEN
	bgt.s   LLL1
	     adda.l     #22,sp
	     jmp        (RET)
LLL1    move.l  (sp)+,SINDEX
	ble.s   error

	movea.l (sp)+,SADDR
	moveq   #0,CURSLEN
	move.b  (SADDR),CURSLEN
	addq.w  #1,CURSLEN
	move.l  SINDEX,TEMP1
	add.l   SLEN,TEMP1
	cmp.l   TEMP1,CURSLEN
	blt.s   error

	move.w  (sp)+,TEMP1
	move.l  (sp)+,DINDEX
	ble.s   error

	move.l  DINDEX,TEMP1
	add.l   SLEN,TEMP1
	movea.l (sp)+,DADDR
	move.l  (sp)+,DMAX
	addq.l  #1,DMAX
	cmp.l   TEMP1,DMAX
	blt.s   error

	lea     0(SADDR,SINDEX.L),SADDR
	lea     -1(DADDR,DINDEX.L),DADDR
	bra.s   TRANSFER
*
*
*
*  procedure ssubtossub(var dsub: string;
*                       dindex: integer;
*                       var ssub: string;
*                       sindex,slen: integer);
*
ASM_SSUBTOSSUB  EQU *
	def     ASM_SSUBTOSSUB
*
	movea.l (sp)+,RET
	move.l  (sp)+,SLEN
	bgt.s   L1
	     adda.l     #20,sp
	     jmp        (RET)
L1      move.l  (sp)+,SINDEX
	bgt.s   L2
error        move.w     #-8,ESCAPECODE(a5)
	     trap       #10
L2      movea.l (sp)+,SADDR
	moveq   #0,CURSLEN
	move.b  (SADDR),CURSLEN
	addq.w  #1,CURSLEN
	move.l  SINDEX,TEMP1
	add.l   SLEN,TEMP1
	cmp.l   TEMP1,CURSLEN
	blt.s   error

	move.w  (sp)+,TEMP1
	move.l  (sp)+,DINDEX
	ble.s   error

	move.l  DINDEX,TEMP1
	add.l   SLEN,TEMP1
	movea.l (sp)+,DADDR
	moveq   #0,DMAX
	move.b  (sp)+,DMAX
	moveq   #0,TEMP2
	move.w  DMAX,TEMP2
	addq.l  #1,TEMP2
	cmp.l   TEMP1,TEMP2
	blt.s   error

	moveq   #0,TEMP2
	move.b  (DADDR),TEMP2
	addq.l  #1,TEMP2
	cmp.l   DINDEX,TEMP2
	blt.s   error

	cmp.w   TEMP1,TEMP2
	bge.s   L3
	subq.w  #1,TEMP1
	move.b  TEMP1,(DADDR)
*
*  End of error checking.
*
L3      lea     0(SADDR,SINDEX.L),SADDR
	lea     0(DADDR,DINDEX.L),DADDR

TRANSFER equ *
	cmpa.l  SADDR,DADDR
	bgt.s   topdown
*
*  Transfer from bottom to top
*
L4      move.b  (SADDR)+,(DADDR)+
	subq.l  #1,SLEN
	bgt.s   L4
	jmp     (RET)
*
*  Transfer from top to bottom
*
topdown equ *
	lea     0(SADDR,SLEN),SADDR
	lea     0(DADDR,SLEN),DADDR
L5      move.b  -(SADDR),-(DADDR)
	subq.l  #1,SLEN
	bgt.s   L5
	jmp     (RET)
*
*
*
*  procedure psubtossub(var dsub: string;
*                       dindex: integer;
*                       ssublen: integer;
*                       var ssub: paoctype;
*                       sindex,slen: integer);
*
ASM_PSUBTOSSUB  EQU *
	def     ASM_PSUBTOSSUB
*
	movea.l (sp)+,RET
	move.l  (sp)+,SLEN
	bgt.s   LL1
	     adda.l     #22,sp
	     jmp        (RET)
LL1     move.l  (sp)+,SINDEX
	ble.s   error

	movea.l (sp)+,SADDR
	move.l  (sp)+,CURSLEN
	move.l  SINDEX,TEMP1
	add.l   SLEN,TEMP1
	subq.l  #1,TEMP1
	cmp.l   TEMP1,CURSLEN
	blt     error

	move.l  (sp)+,DINDEX
	ble     error

	move.l  DINDEX,TEMP1
	add.l   SLEN,TEMP1
	movea.l (sp)+,DADDR
	moveq   #0,DMAX
	move.b  (sp)+,DMAX
	moveq   #0,TEMP2
	move.w  DMAX,TEMP2
	addq.l  #1,TEMP2
	cmp.l   TEMP1,TEMP2
	blt     error

	moveq   #0,TEMP2
	move.b  (DADDR),TEMP2
	addq.l  #1,TEMP2
	cmp.l   DINDEX,TEMP2
	blt     error

	cmp.w   TEMP1,TEMP2
	bge.s   LL2
	subq.w  #1,TEMP1
	move.b  TEMP1,(DADDR)

LL2     lea     -1(SADDR,SINDEX.L),SADDR
	lea     0(DADDR,DINDEX.L),DADDR
	bra.s   TRANSFER
*
*
*
*  function strrtrim(s: stringmax): stringmax;
*
*
ASM_STRRTRIM  EQU *
	DEF   ASM_STRRTRIM
*
	movea.l (sp)+,RET
	movea.l (sp)+,SADDR
	movea.l (sp)+,DADDR
	moveq   #0,SLEN
	move.b  (SADDR)+,SLEN
	lea     0(SADDR,SLEN.W),SRCEND
	addq.w  #1,SLEN
rtrim1  subq.w  #1,SLEN
	ble.s   null
	cmpi.b  #32,-(SRCEND)
	beq.s   rtrim1

null    move.b  SLEN,(DADDR)+
	beq.s   retrn

rtrim2  move.b  (SADDR)+,(DADDR)+
	subq.w  #1,SLEN
	bgt.s   rtrim2
retrn   jmp     (RET)
*
*
*
*  function strltrim(s: stringmax): stringmax;
*
*
ASM_STRLTRIM  EQU *
	DEF   ASM_STRLTRIM
*
	movea.l (sp)+,RET
	movea.l (sp)+,SADDR
	movea.l (sp)+,DADDR
	moveq   #0,SLEN
	move.b  (SADDR)+,SLEN
	beq.s   ltrim2
	bra.s   ltrim1

ltrim0  subq.w  #1,SLEN
	beq.s   ltrim2

ltrim1  cmpi.b  #32,(SADDR)+
	beq.s   ltrim0

ltrim2  move.b  SLEN,(DADDR)+
	beq.s   retrnn

	lea     -1(SADDR),SADDR
ltrim3  move.b  (SADDR)+,(DADDR)+
	subq.w  #1,SLEN
	bgt.s   ltrim3
retrnn  jmp     (RET)
*
*
*
*  function strrpt(s: stringmax; count: integer)
*                                    : stringmax;
*
*
ASM_STRRPT    EQU *
	DEF   ASM_STRRPT
*
	movea.l (sp)+,RET
	move.l  (sp)+,COUNT
	movea.l (sp)+,SADDR
	movea.l (sp)+,DADDR
	moveq   #0,SLEN
	move.b  (SADDR)+,SLEN
	move.l  COUNT,TEMP1
	cmpi.l  #255,TEMP1
	bhi     error

	muls    SLEN,TEMP1
	cmpi.l  #255,TEMP1
	bgt     error

	move.b  TEMP1,(DADDR)+
	beq.s   retrrn

rpt0    movea.l SADDR,ATEMP
	move.l  SLEN,TEMP1
rpt1    move.b  (ATEMP)+,(DADDR)+
	subq.w  #1,TEMP1
	bgt.s   rpt1
	subq.w  #1,count
	bgt.s   rpt0
retrrn  jmp     (RET)
	end
@


55.1
log
@Automatic bump of revision number for PWS version 3.25A
@
text
@@


54.3
log
@
pws2rcs automatic delta on Wed Aug 21 12:27:56 MDT 1991
@
text
@@


54.2
log
@
pws2rcs automatic delta on Wed Aug 21 09:35:48 MDT 1991
@
text
@d1 336
@


54.1
log
@Automatic bump of revision number for PWS version 3.24
@
text
@a0 336
RET     EQU     A0      return address
SADDR   EQU     A1      source address
DADDR   EQU     A2      destination address
SRCEND  EQU     A3      source end
ATEMP   EQU     A4      temporary A register
*
SLEN    EQU     D0      source length
SINDEX  EQU     D1      source index
CURSLEN EQU     D2      current source length
DINDEX  EQU     D3      destination index
DMAX    EQU     D4      destination max
COUNT   EQU     D5
INDEX   EQU     D5      string index
TEMP1   EQU     D6      temporary D register
TEMP2   EQU     D7      temporary D register
*
	refa    SYSGLOBALS
ESCAPECODE EQU  SYSGLOBALS-2
*
*
*
*  procedure psubtopsub(dsublen: integer;
*                       var dsub: paoctype;
*                       dindex: integer;
*                       ssublen: integer;
*                       var ssub: paoctype;
*                       sindex,slen: integer);
*
ASM_PSUBTOPSUB  EQU *
	def     ASM_PSUBTOPSUB
*
	movea.l (sp)+,RET
	move.l  (sp)+,SLEN
	bgt.s   LLLL1
	     adda.l     #24,sp
	     jmp        (RET)
LLLL1   move.l  (sp)+,SINDEX
	ble     error

	movea.l (sp)+,SADDR
	move.l  (sp)+,CURSLEN
	move.l  SINDEX,TEMP1
	add.l   SLEN,TEMP1
	subq.l  #1,TEMP1
	cmp.l   TEMP1,CURSLEN
	blt.s   error

	move.l  (sp)+,DINDEX
	ble.s   error

	move.l  DINDEX,TEMP1
	add.l   SLEN,TEMP1
	movea.l (sp)+,DADDR
	move.l  (sp)+,DMAX
	add.l   #1,DMAX
	cmp.l   TEMP1,DMAX
	blt.s   error

	lea     -1(SADDR,SINDEX.L),SADDR
	lea     -1(DADDR,DINDEX.L),DADDR
	bra     TRANSFER
*
*
*
*  procedure ssubtopsub(dsublen: integer;
*                       var dsub: paoctype;
*                       dindex: integer;
*                       var ssub: string;
*                       sindex,slen: integer);
*
ASM_SSUBTOPSUB  EQU *
	def     ASM_SSUBTOPSUB
*
	movea.l (sp)+,RET
	move.l  (sp)+,SLEN
	bgt.s   LLL1
	     adda.l     #22,sp
	     jmp        (RET)
LLL1    move.l  (sp)+,SINDEX
	ble.s   error

	movea.l (sp)+,SADDR
	moveq   #0,CURSLEN
	move.b  (SADDR),CURSLEN
	addq.w  #1,CURSLEN
	move.l  SINDEX,TEMP1
	add.l   SLEN,TEMP1
	cmp.l   TEMP1,CURSLEN
	blt.s   error

	move.w  (sp)+,TEMP1
	move.l  (sp)+,DINDEX
	ble.s   error

	move.l  DINDEX,TEMP1
	add.l   SLEN,TEMP1
	movea.l (sp)+,DADDR
	move.l  (sp)+,DMAX
	addq.l  #1,DMAX
	cmp.l   TEMP1,DMAX
	blt.s   error

	lea     0(SADDR,SINDEX.L),SADDR
	lea     -1(DADDR,DINDEX.L),DADDR
	bra.s   TRANSFER
*
*
*
*  procedure ssubtossub(var dsub: string;
*                       dindex: integer;
*                       var ssub: string;
*                       sindex,slen: integer);
*
ASM_SSUBTOSSUB  EQU *
	def     ASM_SSUBTOSSUB
*
	movea.l (sp)+,RET
	move.l  (sp)+,SLEN
	bgt.s   L1
	     adda.l     #20,sp
	     jmp        (RET)
L1      move.l  (sp)+,SINDEX
	bgt.s   L2
error        move.w     #-8,ESCAPECODE(a5)
	     trap       #10
L2      movea.l (sp)+,SADDR
	moveq   #0,CURSLEN
	move.b  (SADDR),CURSLEN
	addq.w  #1,CURSLEN
	move.l  SINDEX,TEMP1
	add.l   SLEN,TEMP1
	cmp.l   TEMP1,CURSLEN
	blt.s   error

	move.w  (sp)+,TEMP1
	move.l  (sp)+,DINDEX
	ble.s   error

	move.l  DINDEX,TEMP1
	add.l   SLEN,TEMP1
	movea.l (sp)+,DADDR
	moveq   #0,DMAX
	move.b  (sp)+,DMAX
	moveq   #0,TEMP2
	move.w  DMAX,TEMP2
	addq.l  #1,TEMP2
	cmp.l   TEMP1,TEMP2
	blt.s   error

	moveq   #0,TEMP2
	move.b  (DADDR),TEMP2
	addq.l  #1,TEMP2
	cmp.l   DINDEX,TEMP2
	blt.s   error

	cmp.w   TEMP1,TEMP2
	bge.s   L3
	subq.w  #1,TEMP1
	move.b  TEMP1,(DADDR)
*
*  End of error checking.
*
L3      lea     0(SADDR,SINDEX.L),SADDR
	lea     0(DADDR,DINDEX.L),DADDR

TRANSFER equ *
	cmpa.l  SADDR,DADDR
	bgt.s   topdown
*
*  Transfer from bottom to top
*
L4      move.b  (SADDR)+,(DADDR)+
	subq.l  #1,SLEN
	bgt.s   L4
	jmp     (RET)
*
*  Transfer from top to bottom
*
topdown equ *
	lea     0(SADDR,SLEN),SADDR
	lea     0(DADDR,SLEN),DADDR
L5      move.b  -(SADDR),-(DADDR)
	subq.l  #1,SLEN
	bgt.s   L5
	jmp     (RET)
*
*
*
*  procedure psubtossub(var dsub: string;
*                       dindex: integer;
*                       ssublen: integer;
*                       var ssub: paoctype;
*                       sindex,slen: integer);
*
ASM_PSUBTOSSUB  EQU *
	def     ASM_PSUBTOSSUB
*
	movea.l (sp)+,RET
	move.l  (sp)+,SLEN
	bgt.s   LL1
	     adda.l     #22,sp
	     jmp        (RET)
LL1     move.l  (sp)+,SINDEX
	ble.s   error

	movea.l (sp)+,SADDR
	move.l  (sp)+,CURSLEN
	move.l  SINDEX,TEMP1
	add.l   SLEN,TEMP1
	subq.l  #1,TEMP1
	cmp.l   TEMP1,CURSLEN
	blt     error

	move.l  (sp)+,DINDEX
	ble     error

	move.l  DINDEX,TEMP1
	add.l   SLEN,TEMP1
	movea.l (sp)+,DADDR
	moveq   #0,DMAX
	move.b  (sp)+,DMAX
	moveq   #0,TEMP2
	move.w  DMAX,TEMP2
	addq.l  #1,TEMP2
	cmp.l   TEMP1,TEMP2
	blt     error

	moveq   #0,TEMP2
	move.b  (DADDR),TEMP2
	addq.l  #1,TEMP2
	cmp.l   DINDEX,TEMP2
	blt     error

	cmp.w   TEMP1,TEMP2
	bge.s   LL2
	subq.w  #1,TEMP1
	move.b  TEMP1,(DADDR)

LL2     lea     -1(SADDR,SINDEX.L),SADDR
	lea     0(DADDR,DINDEX.L),DADDR
	bra.s   TRANSFER
*
*
*
*  function strrtrim(s: stringmax): stringmax;
*
*
ASM_STRRTRIM  EQU *
	DEF   ASM_STRRTRIM
*
	movea.l (sp)+,RET
	movea.l (sp)+,SADDR
	movea.l (sp)+,DADDR
	moveq   #0,SLEN
	move.b  (SADDR)+,SLEN
	lea     0(SADDR,SLEN.W),SRCEND
	addq.w  #1,SLEN
rtrim1  subq.w  #1,SLEN
	ble.s   null
	cmpi.b  #32,-(SRCEND)
	beq.s   rtrim1

null    move.b  SLEN,(DADDR)+
	beq.s   retrn

rtrim2  move.b  (SADDR)+,(DADDR)+
	subq.w  #1,SLEN
	bgt.s   rtrim2
retrn   jmp     (RET)
*
*
*
*  function strltrim(s: stringmax): stringmax;
*
*
ASM_STRLTRIM  EQU *
	DEF   ASM_STRLTRIM
*
	movea.l (sp)+,RET
	movea.l (sp)+,SADDR
	movea.l (sp)+,DADDR
	moveq   #0,SLEN
	move.b  (SADDR)+,SLEN
	beq.s   ltrim2
	bra.s   ltrim1

ltrim0  subq.w  #1,SLEN
	beq.s   ltrim2

ltrim1  cmpi.b  #32,(SADDR)+
	beq.s   ltrim0

ltrim2  move.b  SLEN,(DADDR)+
	beq.s   retrnn

	lea     -1(SADDR),SADDR
ltrim3  move.b  (SADDR)+,(DADDR)+
	subq.w  #1,SLEN
	bgt.s   ltrim3
retrnn  jmp     (RET)
*
*
*
*  function strrpt(s: stringmax; count: integer)
*                                    : stringmax;
*
*
ASM_STRRPT    EQU *
	DEF   ASM_STRRPT
*
	movea.l (sp)+,RET
	move.l  (sp)+,COUNT
	movea.l (sp)+,SADDR
	movea.l (sp)+,DADDR
	moveq   #0,SLEN
	move.b  (SADDR)+,SLEN
	move.l  COUNT,TEMP1
	cmpi.l  #255,TEMP1
	bhi     error

	muls    SLEN,TEMP1
	cmpi.l  #255,TEMP1
	bgt     error

	move.b  TEMP1,(DADDR)+
	beq.s   retrrn

rpt0    movea.l SADDR,ATEMP
	move.l  SLEN,TEMP1
rpt1    move.b  (ATEMP)+,(DADDR)+
	subq.w  #1,TEMP1
	bgt.s   rpt1
	subq.w  #1,count
	bgt.s   rpt0
retrrn  jmp     (RET)
	end
@


53.1
log
@Automatic bump of revision number for PWS version 3.24B
@
text
@@


52.1
log
@Automatic bump of revision number for PWS version 3.24A
@
text
@@


51.1
log
@Automatic bump of revision number for PWS version 3.24d
@
text
@@


50.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


49.1
log
@Automatic bump of revision number for PWS version 3.24b
@
text
@@


48.1
log
@Automatic bump of revision number for PWS version 3.24a
@
text
@@


47.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


46.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


45.1
log
@Automatic bump of revision number for PWS version 3.23C
@
text
@@


44.1
log
@Automatic bump of revision number for PWS version 3.23B
@
text
@@


43.1
log
@Automatic bump of revision number for PWS version 3.23aA
@
text
@@


42.1
log
@Automatic bump of revision number for PWS version 3.23e
@
text
@@


41.1
log
@Automatic bump of revision number for PWS version 3.23d
@
text
@@


40.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


39.1
log
@Automatic bump of revision number for PWS version 3.23b
@
text
@@


38.1
log
@Automatic bump of revision number for PWS version 3.23a
@
text
@@


37.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


36.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


35.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


34.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


33.1
log
@Automatic bump of revision number for PWS version 3.22D
@
text
@@


32.1
log
@Automatic bump of revision number for PWS version 3.22C
@
text
@@


31.1
log
@Automatic bump of revision number for PWS version 3.22B
@
text
@@


30.1
log
@Automatic bump of revision number for PWS version 3.22A
@
text
@@


29.1
log
@Automatic bump of revision number for PWS version 3.22b
@
text
@@


28.1
log
@Automatic bump of revision number for PWS version 3.3b
@
text
@@


27.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


26.1
log
@Automatic bump of revision number for PWS version 3.3 Synch
@
text
@@


25.1
log
@Automatic bump of revision number for PWS version 3.2Y
@
text
@@


24.1
log
@Automatic bump of revision number for PWS version 3.2
@
text
@@


23.1
log
@Automatic bump of revision number for PWS version 3.2P
@
text
@@


22.1
log
@Automatic bump of revision number for PWS version 3.2N
@
text
@@


21.1
log
@Automatic bump of revision number for PWS version 3.2M
@
text
@@


20.1
log
@Automatic bump of revision number for PWS version 3.2L
@
text
@@


19.1
log
@Automatic bump of revision number for PWS version 3.2K
@
text
@@


18.1
log
@Automatic bump of revision number for PWS version 3.2J
@
text
@@


17.1
log
@Automatic bump of revision number for PWS version 3.2I+
@
text
@@


16.1
log
@Automatic bump of revision number for PWS version 3.2I
@
text
@@


15.1
log
@Automatic bump of revision number for PWS version 3.2H
@
text
@@


14.1
log
@Automatic bump of revision number for PWS version 3.2G
@
text
@@


13.1
log
@Automatic bump of revision number for PWS version 3.2F
@
text
@@


12.1
log
@Automatic bump of revision number for PWS version 3.2E
@
text
@@


11.1
log
@Automatic bump of revision number for PWS version 3.2D
@
text
@@


10.1
log
@Automatic bump of revision number for PWS version 3.2C
@
text
@@


9.1
log
@Automatic bump of revision number for PWS version 3.2B
@
text
@@


8.1
log
@Automatic bump of revision number for PWS version 3.2A
@
text
@@


7.2
log
@Includes compiler fixes by Brad Ritter.
@
text
@@


7.1
log
@Automatic bump of revision number for PWS version 3.2l
@
text
@a41 1
	add.l   #1,CURSLEN
d44 1
d59 2
a60 2
	lea     -1(SADDR,SINDEX.W),SADDR
	lea     -1(DADDR,DINDEX.W),DADDR
d103 2
a104 2
	lea     0(SADDR,SINDEX.W),SADDR
	lea     -1(DADDR,DINDEX.W),DADDR
d163 2
a164 2
L3      lea     0(SADDR,SINDEX.W),SADDR
	lea     0(DADDR,DINDEX.W),DADDR
a207 1
	addq.l  #1,CURSLEN
d210 1
d239 2
a240 2
LL2     lea     -1(SADDR,SINDEX.W),SADDR
	lea     0(DADDR,DINDEX.W),DADDR
@


6.1
log
@Automatic bump of revision number for PWS version 3.2k
@
text
@@


5.1
log
@Automatic bump of revision number for PWS version 3.2j
@
text
@@


4.1
log
@Automatic bump of revision number for PWS version 3.2i
@
text
@@


3.1
log
@Automatic bump of revision number for PWS version 3.2h
@
text
@@


2.1
log
@Auto bump rev number to 2.1 for sys 3.2e.
@
text
@@


1.1
log
@Initial revision
@
text
@@
