annotate level2/modules/kernel/fallram.asm @ 1387:1451bc7ef0b9

Updates source comments
author boisy
date Tue, 30 Sep 2003 02:06:19 +0000
parents 1da8ab9ba433
children 5ecf6e023a64
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
1 **************************************************
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
2 * System Call: F$AllRAM
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
3 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
4 * Function: Allocate RAM blocks
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
5 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
6 * Input: B = Desired block count
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
7 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
8 * Output: D = Beginning RAM block number
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
9 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
10 * Error: CC = C bit set; B = error code
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
11 *
1387
1451bc7ef0b9 Updates source comments
boisy
parents: 1345
diff changeset
12 FAllRAM ldb R$B,u Get # blocks requested
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
13 pshs b,x,y Save regs
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
14 ldx <D.BlkMap Get ptr to start of block map
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
15 L0974 leay ,x Point Y to current block
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
16 ldb ,s Get # blocks requested
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
17 L0978 cmpx <D.BlkMap+2 Hit end of map yet?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
18 bhs L0995 Yes, exit with No RAM error
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
19 lda ,x+ Get block marker
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
20 bne L0974 Already used, start over with next block up
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
21 decb Dec # blocks still needed
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
22 bne L0978 Still more, keep checking
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
23 * Entry: Y=ptr to start of memory found
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
24 * Note: Due to fact that block map always starts @ $200 (up to $2FF), we
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
25 * don't need to calc A
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
26 L0983 tfr y,d Copy start of requested block mem ptr to D (B)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
27 lda ,s Get # blocks requested
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
28 stb ,s Save start block #
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
29 L098D inc ,y+ Flag blocks as used
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
30 deca (for all blocks allocated)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
31 bne L098D Do until done
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
32 puls b Get start block #
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
33 clra (allow for D as per original calls)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
34 std R$D,u Save for caller
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
35 puls x,y,pc Restore regs & return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
36
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
37 L0995 comb Exit with No RAM error
1387
1451bc7ef0b9 Updates source comments
boisy
parents: 1345
diff changeset
38 ldb #E$NoRAM
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
39 stb ,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
40 puls b,x,y,pc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
41
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
42
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
43 **************************************************
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
44 * System Call: F$AlHRAM
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
45 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
46 * Function: Allocate RAM blocks from top of RAM
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
47 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
48 * Input: B = Desired block count
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
49 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
50 * Output: D = Beginning RAM block number
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
51 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
52 * Error: CC = C bit set; B = error code
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
53 *
1387
1451bc7ef0b9 Updates source comments
boisy
parents: 1345
diff changeset
54 FAlHRAM ldb R$B,u Get # blocks to allocate
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
55 pshs b,x,y Preserve regs
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
56 ldx <D.BlkMap+2 Get ptr to end of block map
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
57 L09A9 ldb ,s Get # blocks requested
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
58 L09AB cmpx <D.BlkMap Are we at beginning of RAM yet?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
59 bls L0995 Yes, exit with No RAM error
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
60 lda ,-x Get RAM block marker
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
61 bne L09A9 If not free, start checking next one down
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
62 decb Free block, dec # blocks left to find count
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
63 bne L09AB Still more needed, keep checking
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
64 tfr x,y Found enough contigous blocks, move ptr to Y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
65 bra L0983 Go mark blocks as used, & return info to caller
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
66