.TITLE RASMAC - RASGEN subroutines .IDENT /APR 83/ .PSECT RASMAC .ENABL LC ; ;============================================================================= ; ; Function IPAT determines if a dot should be generated at the ; current position. Calling sequence: ; ; IDRAW = IPAT(LINPAT,INDEX,IBEG) ; ; where ; ; LINPAT is the line pattern (on a bit by bit basis) ; INDEX is the current position on the line ; IBEG is the beginning of the line ; ; The last4 bits of the INDEX, offset by IBEG, are a bit pointer ; into LINPAT. If the corresponding bit of LINPAT is on, IPAT ; returns a .TRUE. value (=1), else IPAT = .FALSE. (=0). ; ; modification history: ; ; 6 apr 83 hg initial edit ; ;============================================================================= ; IPAT:: MOV @6(R5),R2 ; get the IBEG SUB @4(R5),R2 ; offset it by INDEX BIC #177760,R2 ; bag all but the low 4 bits INC R2 ; make a counter of the bits (1-16) MOV @2(R5),R1 ; get the line pattern CLR R0 ; assume the bit is off 10$: ROR R1 ; rotate low bit into carry SOB R2,10$ ; and more, until bit we want is carry ADC R0 ; if carry set, add into the return RETURN ; and go on home ; ;============================================================================= ; ; Subroutine MINMAX swaps the values passes to it if needed to ; make the first argument less than the second. ; ; CALL MINMAX(I,J) ; ; always returns I <= J ; ;============================================================================= ; MINMAX::CMP @2(R5),@4(R5) ; compare the values BLT 10$ ; alreay less or equal - leave MOV @2(R5),R0 ; hold the first value MOV @4(R5),@2(R5) ; move J into I's spot MOV R0,@4(R5) ; and move I to J's spot 10$: RETURN ; all done - now leave .END