1345
|
1 **************************************************
|
|
2 * System Call: F$DATLog
|
|
3 *
|
|
4 * Function: Convert DAT block/offset to logical address
|
|
5 *
|
|
6 * Input: B = DAT image offset
|
|
7 * X = Block offset
|
|
8 *
|
|
9 * Output: X = Logical address
|
|
10 *
|
|
11 * Error: CC = C bit set; B = error code
|
|
12 *
|
1145
|
13 FDATLog ldb R$B,u Get logical Block #
|
|
14 ldx R$X,u Get offset into block
|
|
15 bsr CmpLBlk Go modify X to be Logical address
|
|
16 stx R$X,u Save in callers X register
|
|
17 clrb No error & return
|
|
18 rts
|
|
19
|
|
20 * Compute logical address given B=Logical Block # & X=offset into block
|
|
21 * Exits with B being logical block & X=logical address
|
|
22 CmpLBlk pshs b Preserve logical block #
|
|
23 tfr b,a Move log. block # to A
|
|
24 lsla Multiply logical block by 32
|
|
25 lsla
|
|
26 lsla
|
|
27 lsla
|
|
28 lsla
|
|
29 clrb D=8k offset value
|
|
30 IFNE H6309
|
|
31 addr d,x X=logical address in 64k workspace
|
|
32 ELSE
|
|
33 leax d,x
|
|
34 ENDC
|
|
35 puls b,pc Restore A, block # & return
|