.title DECUS C .POINT .enabl lc ;+ ; SEEK.MAC By Jan Brittenson 30-Oct-86 ; ; Call: ; ; seek(iov, byteseq); ; FILE *iov; /* File to be positioned */ ; long byteseq; /* Byte number inside file */ ; ; Description: ; ; The 'byteseq' and the 'iov' arguments are used to set up ; parameters for a FCS-11 .POSIT call. ; ; Bugs: ; ; No checks are performed. (Isn't that nice?) ; All ungetch()'s as well as EOF conditions are flushed. ; ;- seek:: jsr r5, csv$ ; C entry mov c$pmtr(r5), r0 ; R0 = IOV add #v$fdb, r0 ; R0 = FDB mov c$pmtr+2(r5), r2 ; R2 = Byte #, high mov c$pmtr+4(r5), r3 ; R3 = Byte #, low mov r3, r4 bic #^C777, r4 ; Keep byte # (9 bits) ashc #-9., r2 ; R2:R3 /= 9. mov r2, r1 ; VBN, high mov r3, r2 ; VBN, low mov r4, r3 ; Byte #, 0-511 call .point ; Position file pointer mov c$pmtr(r5), r4 ; R4 = IOV bic #vf$eor, (r4) ; No end of file condition mov #-1, v$uget(r4) ; Remove ungetch()'s mov #1, r0 ; Always return 1 jmp cret$ ; Return .end