1345
|
1 **************************************************
|
|
2 * System Call: F$GProcP
|
|
3 *
|
|
4 * Function: Get process pointer
|
|
5 *
|
|
6 * Input: A = Process ID
|
|
7 *
|
|
8 * Output: Y = Pointer to process descriptor
|
|
9 *
|
|
10 * Error: CC = C bit set; B = error code
|
|
11 *
|
1145
|
12 FGProcP lda R$A,u get process #
|
|
13 bsr L0B2E Get ptr to process descriptor
|
|
14 bcs L0B2D If error, exit with it
|
|
15 sty R$Y,u Save ptr in caller's Y
|
|
16 L0B2D rts Return
|
|
17
|
|
18 * Entry: A=Process #
|
|
19 * Exit: Y=Ptr to process descriptor
|
|
20 * All others preserved
|
|
21 L0B2E pshs d,x Preserve regs
|
|
22 ldb ,s Get process # into B
|
|
23 beq L0B40 0, skip ahead
|
|
24 ldx <D.PrcDBT Get ptr to process descriptor block table
|
|
25 abx Point to specific process' entry
|
|
26 lda ,x Get MSB of process dsc. ptr
|
|
27 beq L0B40 None there, exit with error
|
|
28 clrb Clear LSB of process dsc. ptr (always fall on $200
|
|
29 tfr d,y boundaries) & move ptr to Y
|
|
30 puls d,x,pc Restore regs & return
|
|
31
|
|
32 L0B40 puls d,x Get regs back
|
|
33 comb Exit with Bad process ID error
|
|
34 ldb #E$BPrcID
|
|
35 rts
|