1345
|
1 **************************************************
|
|
2 * System Call: F$GModDr
|
|
3 *
|
|
4 * Function: Get copy of module directory
|
|
5 *
|
|
6 * Input: X = 2048 byte buffer pointer
|
|
7 *
|
|
8 * Output: None
|
|
9 *
|
|
10 * Error: CC = C bit set; B = error code
|
|
11 *
|
1145
|
12 FGModDr ldd <D.ModDir+2 Get end ptr of module directory
|
|
13 subd <D.ModDir Calculate maximum size of module directory
|
|
14 tfr d,y Put max. size in Y
|
|
15 ldd <D.ModEnd Get real end ptr of module dir
|
|
16 subd <D.ModDir Calculate real size of module dir
|
|
17 ldx R$X,u Get requested buffer ptr to put it from caller
|
|
18 IFNE H6309
|
|
19 addr d,x Calculate end addr. of directory after its copied
|
|
20 ELSE
|
|
21 leax d,x
|
|
22 ENDC
|
|
23 stx R$Y,u Preserve in caller's Y register
|
|
24 ldx <D.ModDir Get start ptr of module directory
|
|
25 stx R$U,u Preserve in caller's U register
|
|
26
|
|
27 lda <D.SysTsk Get system task #
|
|
28 ldx <D.Proc Get current process task #
|
|
29 ldb P$Task,x
|
|
30 ldx <D.ModDir Get start ptr of module directory
|
|
31 bra L0978 --- saves 4 bytes, adds 3 cycles
|
|
32 *** ldu R$X,u Get caller's buffer ptr
|
|
33 *** os9 F$Move Copy module directory in caller's buffer
|
|
34 *** rts
|