.TITLE VTLRUL - Display The Ruler .IDENT /1.1/ .ENABL LC ;+ ; ; Free software BY ; Project Software & Development, Inc. ; ; This software is furnished for free and may be used and copied as ; desired. This software or any other copies thereof may be provided or ; otherwise made available to any other person. No title to and ; ownership of the software is hereby transferred or allowed. ; ; The information in this software is subject to change without notice ; and should not be construed as a commitment by PROJECT SOFTWARE ; AND DEVELOPMENT, INC. ; ; PROJECT SOFTWARE assumes no responsibility for the use or reliability ; of this software on any equipment whatsoever. ; ; Project Software & Development, Inc. ; 14 Story St. ; Cambridge, Ma. 02138 ; 617-661-1444 ; ; ; Title: VTLRUL.MAC ; Author: Robin Miller ; Date: August 3, 1983 ; ; Description: ; ; This module contains the routines to display the ruler. ; ; Modification History: ; ; May 23, 1984 by Robin Miller. Edit (01). ; Indent the ruler 8 spaces if the record numbers are being displayed. ; ;- .ENABL AMA .NLIST BEX ; Generate a ruler the same size as the maximum record size. RULER: .ASCII %1...5....10...15...20...25...30...35...40...45...5% .ASCII %0...55...60...65...70...75...80...85...90...95...1% .ASCII %00..105..110..115..120..125..130..135..140..145..1% .ASCII %50..155..160..165..170..175..180..185..190..195..2% .ASCII %00..205..210..215..220..225..230..235..240..245..2% .ASCII %50..255..260..265..270..275..280..285..290..295..3% .ASCII %00..305..310..315..320..325..330..335..340..345..3% .ASCII %50..355..360..365..370..375..380..385..390..395..4% .ASCII %00..405..410..415..420..425..430..435..440..445..4% .ASCII %50..455..460..465..470..475..480..485..490..495..5% .ASCIZ %00..505..510..% .EVEN ;+ ; ; RULCMD - Display or clear the ruler. ; ; Inputs: ; None. ; ; Outputs: ; All registers except R0 - R2 are preserved. ; ;- .ENABL LSB RULCMD::MOV #S.RULR,R0 ; Set the RULER bit number. CALL DOSWT ; Turn the bit on or off. CALL CHKOPE ; Is an input file open ? BCC 100$ ; If CC, no (presume /RULER). CALL 200$ ; Allowed to display a ruler ? BCS 100$ ; If CS, no. BIT #S.RULR,(R2) ; Are we enabling the ruler ? BNE 10$ ; If NE, yes. CALL CLRRUL ; No, clear the ruler line. BIT #B.2FIL,STATUS ; Are we displaying two files ? BEQ 100$ ; If EQ, no. CALL WRTNAM ; Yes, rewrite the file name. CALL WRTACT ; Show them this file is active. BR 100$ ; And continue ... ; Rewrite the ruler if there was one on the screen. CHKRUL::MOV IENTRY,R2 ; Copy the file entry address. BIT #S.RULR,(R2) ; Is a ruler on the screen ? BEQ 100$ ; If EQ, no. CALL 200$ ; Allowed to display a ruler ? BCS 100$ ; If CS, no. 10$: JSR R5,$SAVRG ; Save R3 - R5. MOV R2,R5 ; Copy the file entry address. MOV #FMTBUF,R0 ; Set the output buffer address. CALL SETRUL ; Position/clear the ruler line. MOV #RULER,R1 ; Set address of the ruler. MOV O.LWID(R5),R2 ; Copy line width for loop count. MOV O.MARG(R5),R3 ; Copy the margin indent. BEQ 15$ ; If EQ, there is none. ADD R3,R1 ; Adjust the starting position. 15$: CALL CHKREC ; Check record number display. (01) 20$: MOVB (R1)+,(R0)+ ; Start copying the ruler. BEQ 30$ ; If EQ, we've reached the end. SOB R2,20$ ; Else, loop until we're done. 30$: CALL ATTOFF ; Turn the video attributes off. JMP VTYPE ; Now display the ruler. 100$: RETURN ; Subroutine to see if we're allowed to display the ruler. 200$: CLC ; Presume a ruler is allowed. ;*** BIT #B.2FIL,STATUS ; Are we displaying two files ? ;*** BNE 290$ ; If NE, yes (ruler disallowed). BIT #S.NAME,(R2) ; Is file name display enabled ? BNE 300$ ; If NE, yes (allow the ruler). 290$: SEC ; Show the ruler is disallowed. 300$: RETURN .DSABL LSB ;+ ; ; CHKREC - Check for record numbers being displayed. ; ; If the record number is being displayed along the left margin, indent the ; ruler 8 spaces to put it above the data being displayed. ; ; Inputs: ; R0 = The output buffer address. ; R2 = The size of the ruler. ; R5 = The table entry address. ; ; Outputs: ; R0 = The updated buffer address. ; R2 = The adjusted ruler size. ; All other registers are preserved. ; ;- CHKREC: JSR R5,$SAVRG ; Save registers R3 - R5. (01) BIT #S.NUMB,(R5) ; Displaying record numbers ? (01) BEQ 100$ ; If EQ, no. (01) MOV #8.,R3 ; Set the iteration count. (01) SUB R3,R2 ; Adjust the ruler size. (01) 10$: MOVB #SPACE,(R0)+ ; Insert some spaces. (01) SOB R3,10$ ; Loop until we're done. (01) 100$: RETURN .END