annotate level2/modules/kernel/fdelram.asm @ 3198:734862561313

3rdparty/packages: Rename particularly cryptic folder names
author Tormod Volden <debian.tormod@gmail.com>
date Sat, 03 Jun 2017 10:34:39 +0200
parents 039ddb7c8ad7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1344
diff changeset
1 **************************************************
1387
1451bc7ef0b9 Updates source comments
boisy
parents: 1345
diff changeset
2 * System Call: F$DelRAM
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1344
diff changeset
3 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1344
diff changeset
4 * Function: Deallocate RAM blocks
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1344
diff changeset
5 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1344
diff changeset
6 * Input: B = Number of blocks
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1344
diff changeset
7 * X = Beginning block number
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1344
diff changeset
8 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1344
diff changeset
9 * Output: None
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1344
diff changeset
10 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1344
diff changeset
11 * Error: CC = C bit set; B = error code
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1344
diff changeset
12 *
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
13 FDelRAM ldb R$B,u # of blocks to de-allocate
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
14 beq DelRAM.2 if none, exit
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
15 ldd <D.BlkMap+2 get end of the block map
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
16 subd <D.BlkMap subtract out start of the block map
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
17 subd R$X,u take out starting block number
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
18 bls DelRAM.2 exit if the starting block is ># of blocks available
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
19 tsta check high byte of RAM #
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
20 bne DelRAM.0 if not zero, skip it
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
21 cmpb R$B,u check against size of the block
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
22 bhs DelRAM.0 if size is >RAM available
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
23 stb R$B,u save actual # of blocks deleted
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
24 DelRAM.0 ldx <D.BlkMap get start address of the block map
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
25 ldd R$X,u starting address of the RAM to de-allocate
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
26 leax d,x slower, but smaller than ADDR
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
27 ldb R$B,u get actual # of blocks to de-allocate
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
28 DelRAM.1 equ *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
29 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
30 aim #^RAMinUse,,x+ set to RAM not in use
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
31 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
32 lda ,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
33 anda #^RAMinUse
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
34 sta ,x+
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
35 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
36 decb count down a block
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
37 bne DelRAM.1 continue
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
38 DelRAM.2 clrb and exit
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1387
diff changeset
39 rts