.TITLE VERLIN .ENABL LC .IDENT /APR 83/ ; ; This subroutine gets a line of raster data from the buffer and ; returns it in the supplied line buffer. Also returned is the ; printable length of the buffer, excluding trailing 0's. ; ; Internally, the raster buffer contains 264 bytes (2112 bits) ; for each line of raster. This must be transfered to a user supplied ; buffer for output. ; ; CALL VERLIN(LINE,BUFFER,LENGTH) ; ; where LINE is the raster line number to retrieve ; (0 --> MAXNX-1) ; BUFFER is the returned line buffer of up to 264. bytes. ; LENGTH is the printable length of BUFFER. ; ; modification history: ; ; 23 april 83 hg initial edit ; ;--------------------------------------------------------------------------------- ; ; first, define the raster buffer ; .PSECT VERRAS,RW,D,OVR,GBL .XOFF: ; pointer table start ; ; Now for the routine at hand - first definitions ; .PSECT VERLIN LINE = 2 BUFFER = 4 LENGTH = 6 .PAGE ; ; get pointer to the line in question ; VERLIN::MOV @LINE(R5),R0 ; line number ASL R0 ; make it a word offset MOV .XOFF(R0),R0 ; and point to the line itself MOV BUFFER(R5),R1 ; get the buffer's address MOV #264.,R2 ; get the length of a line ; ; and move the data to the user's buffer ; 10$: MOVB (R0)+,(R1)+ ; move the data SOB R2,10$ ; and loop until all done ; ; now look backward for the last printing character (non 0) ; 30$: CMPB #0,-(R1) ; R1 = end of the string BEQ 30$ ; and loop until we don't match MOV BUFFER(R5),R0 ; get the buffer's address CMP R0,R1 ; did we go past the end? BLO 40$ ; nope - R1 --> last character MOV #1,@LENGTH(R5) ; nothing here, but fool us RETURN ; or we wouldn't space up a line 40$: INC R1 ; point to the first free spot SUB R0,R1 ; calculate the length of string MOV R1,@LENGTH(R5) ; and return it RETURN ; all done - go on home .END