annotate level2/modules/kernel/fdelimg.asm @ 3123:039ddb7c8ad7

l2 kernel: Remove tabs and trailing whitespace, align comments No functional change (no change to generated binaries).
author Neal Crook <foofoobedoo@gmail.com>
date Mon, 28 Nov 2016 08:31:26 +0000
parents 1da8ab9ba433
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: 1145
diff changeset
1 **************************************************
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
2 * System Call: F$DelImg
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: Deallocate image 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: A = Beginning block number
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
7 * B = Block count
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
8 * X = Process descriptor pointer
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 * Output: None
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
11 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
12 * Error: CC = C bit set; B = error code
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
13 *
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
14 FDelImg ldx R$X,u get process pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
15 ldd R$D,u get start block & block count
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
16 leau <P$DATImg,x point to DAT image
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
17 lsla 2 bytes per block entry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
18 leau a,u Point U to block entry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
19 * Block count in B
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
20 L0B55
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
21 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
22 ldw ,u Get block #
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
23 addw <D.BlkMap Add it to map ptr
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
24 aim #^RAMinUse,0,w
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
25 ldw #DAT.Free get empty block marker
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
26 stw ,u++ save it to process descriptor
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
27 decb done?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
28 bne L0B55 No, keep going
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
29 oim #ImgChg,P$State,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
30 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
31 clra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
32 tfr d,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
33 pshs x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
34 L0BLoop ldd ,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
35 addd <D.BlkMap
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
36 tfr d,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
37 lda ,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
38 anda #^RAMinUse
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
39 sta ,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
40 ldd #DAT.Free
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
41 std ,u++
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
42 leay -1,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
43 bne L0BLoop
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
44
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
45 puls x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
46 lda P$State,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
47 ora #ImgChg
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
48 sta P$State,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
49 ENDC
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
50 clrb
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
51 rts