.TITLE FCSTEL (FDBADR%,LWADR%) .MCALL .BLK.,.BLKW. ; In: FDBADR% is address of FDB first word ; LWADR% is word-aligned address of 32-bit number ; ; Out: 32-bit absolute byte number position stored in (LWADR%) ; the first byte of a file is 0, the next 1, ... ; ; the low order word of the 32 bits is stored at the high- ; order address, which complies with FP11 hardware ; although not with balanced design. (The low word comes ; high so the high word comes low so the sign bit is still ; att +15.) ; +-------------------------------+ ; |* High-order | LWADR% ; +-- --+ ; | Low-Order | LWADR%+2% ; +-------------------------------+ ; ; * = sign bit ; ; .BLK. ; argument block (FTN standard) .BLKW. 1,ARGNUM ; number of arguments .BLKW. 1,FDBADR ; address of FDB .BLKW. 1,LWADR ; address of 1st (high-order-data) word ; of long word FCSTEL:: ; ; assume arg block is correct: NO CHECKS (!) MOV @FDBADR(R5),R0 ; (R0) = [FDB] CALL .MARK ; make FCS think ; assme no errors (!) ; now remember that FCS addresses a FILE ; so decrement VBN to 0-origin SUB #1,R2 ; Gordon!! *?#$@% SBC R1 ; MOV #9.,R0 ; 20$: ASL R2 ; ROL R1 ; DEC R0 ; BGT 20$ ; ADD R3,R2 ; ADC R1 ; ; (r1:r2) = byte number MOV @LWADR(R5),R0 ; (R0) = [sign word] MOV R1,(R0)+ ; MOV R2,@R0 ; ; have stored 32 bits in output buffer RETURN ; .END