;*************************************************************************** ; ; STRCTL.M68 ; ; ; Written By: James A. Jarboe IV ; 1401 19th Street ; Huntsville, TX 77340 ; 409-295-5767 ; ; 10/01/85 ; GR/AM ;**************************************************************************** ; Description: Replaces unprintable ASCII characters with a period ; Type: XCALL subroutine ; Can take up to 1 variable in String or unformatted type ; in any length and will return with period in place of ; unprintable ASCII character to the end of the String or ; unformatted variable length. ; Can be used to print files that have non printable ; ascii characters or to filter them out EX: RANDOM FILES ; Example: ; 10 MAP1 VARIAB,X,10 ; 20 VARIAB="aBc"+chr(2)+chr(7)+"D"+chr(1)+"E" ; 30 XCALL STRCTL,VARIAB ; 40 ? VARIAB ; 50 END ; Would look like; ; VARIAB="aBc..D.E.." ; ; SEARCH SYS SEARCH SYSSYM OBJNAM .SBR ASECT .=0 P.TOP: BLKW 1 A.TYP: BLKW 1 A.ADR: BLKL 1 A.SIZ: BLKL 1 B.TYP: BLKW 1 B.ADR: BLKL 1 B.SIZ: BLKL 1 ; .=0 PSECT PHDR -1,0,PH$REE!PH$REU ; ; Check for variable & set up registers ; CMMW P.TOP(A3),#1 ; 1 variable JNE BADPARM ; no ... then quit MOV A.ADR(A3),A0 ; A0 gets to be pointer of string CLR D2 ; clear counter LOOP: CTRLC OUTOF ; control c then quit ;to test for null byte as end of variable, uncomment ;next two lines ; TSTB @A0 ; TEST FOR NULL ; BEQ NOMORE ; QUIT IF THROUGH VARIABLE WITH null MOVB @A0,D1 ; move char to D1 CMPB @A0,#40 ; compare memory place to space BLT DOT ; branch if < space CMPB @A0,#177 ; compare memory place to DEL BGE DOT ; branch if greater than A.DIT: INC D2 ; add 1 to counter CMP D2,A.SIZ(A3) ; compare to size of variable BEQ NOMORE ; branch if counter = to string size INC A0 ; increment variable place JMP LOOP ; doit again DOT: MOVB #'.,@A0 ; make unprintable a period JMP A.DIT ; goto counter NOMORE: RTN ; return to basic BADPARM: TYPECR ~No Variables passed~ RTN OUTOF: EXIT END .