home *** CD-ROM | disk | FTP | other *** search
- ;
- ; Copyright © 1991, 1992 by Walter Rothe. You may freely use and modify this
- ; program, but not for commercial profit. A modest fee for distribution is
- ; allowed. Derivative works must be released with source along with the
- ; executable or provisions made to provide the user source, if requested.
- ; Uploading source to a major bulletin board system within 6 months of the
- ; time of the request satisfies this requirement. This copyright notice
- ; must not be deleted from the source.
- ;
- ;:ts=8
- far data
- ;void CountCR()
- ;/* Count number of line feeds in current buffer and add total count */
- ;{
- xdef _CountCR
- _CountCR:
- movem.l a2,-(sp)
- ; extern char *SOCB;
- ; extern char *EOCB;
- ; extern int NumOfCR;
- ; extern int NumOfCRInCurBuf;
- ;
- ; char *i;
- ;
- ; for( i=SOCB; i<EOCB; i++) { if( *i == '\n') { NumOfCR++; } }
- move.l _SOCB,a2
- bra .10004
- .10005
- add.l #1,_NumOfCR
- bra .10004
- .10003
- cmp.b #10,(a2)+
- beq .10005
- .10004
- cmp.l _EOCB,a2
- bcs .10003
- .10002
- ; NumOfCRInCurBuf = 0;
- clr.l _NumOfCRInCurBuf
- ; return;
- .2
- movem.l (sp)+,a2
- rts
- ;}
- ;
- xref .begin
- dseg
- xref _NumOfCRInCurBuf
- xref _NumOfCR
- xref _EOCB
- xref _SOCB
- end
-