Mercurial > hg > Members > kono > nitros9-code
annotate level2/modules/kernel/fmapblk.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 |
rev | line source |
---|---|
1345 | 1 ************************************************** |
2 * System Call: F$MapBlk | |
3 * | |
4 * Function: Map specific block | |
5 * | |
6 * Input: B = Number of blocks | |
7 * X = Beginning block number | |
8 * | |
9 * Output: U = Address of first block | |
10 * | |
11 * Error: CC = C bit set; B = error code | |
12 * | |
1145 | 13 FMapBlk lda R$B,u get # blocks |
14 beq L0BAA can't map 0 blocks, return error | |
15 cmpa #DAT.BlCt within range of DAT image? | |
16 bhi L0BAA no, return error | |
17 leas -$10,s make a buffer to hold DAT image | |
18 ldx R$X,u get start block # | |
19 ldb #1 block increment value | |
1245 | 20 IFNE H6309 |
1145 | 21 * Change to W 05/19/93 - used W since one cycle faster per block |
22 tfr s,w point to buffer | |
23 FMapBlk2 stx ,w++ save block # to buffer | |
1245 | 24 ELSE |
25 tfr s,y point to buffer | |
26 FMapBlk2 stx ,y++ save block # to buffer | |
27 ENDC | |
1145 | 28 abx Next block |
29 deca done? | |
30 bne FMapBlk2 no, keep going | |
31 ldb R$B,u get block count again | |
32 ldx <D.Proc get process pointer | |
33 leay <P$DATImg,x point to DAT image | |
34 os9 F$FreeHB find the highest free block offset | |
35 bcs L0BA6 no room, return error | |
1245 | 36 IFNE H6309 |
1145 | 37 tfr d,w Preserve start block # & # of blocks |
1245 | 38 ELSE |
39 pshs d | |
40 ENDC | |
1145 | 41 lsla Multiply start block # by 32 |
3123
039ddb7c8ad7
l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents:
1345
diff
changeset
|
42 lsla |
039ddb7c8ad7
l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents:
1345
diff
changeset
|
43 lsla |
039ddb7c8ad7
l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents:
1345
diff
changeset
|
44 lsla |
039ddb7c8ad7
l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents:
1345
diff
changeset
|
45 lsla |
039ddb7c8ad7
l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents:
1345
diff
changeset
|
46 clrb |
1145 | 47 std R$U,u save address of first block |
1245 | 48 IFNE H6309 |
1145 | 49 tfr w,d Restore offset |
1245 | 50 ELSE |
51 puls d | |
52 ENDC | |
1145 | 53 leau ,s move DAT image into process descriptor |
54 os9 F$SetImg Change process dsc to reflect new blocks | |
55 L0BA6 leas <$10,s Eat DAT image copy & return | |
3123
039ddb7c8ad7
l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents:
1345
diff
changeset
|
56 rts |
1145 | 57 |
58 L0BAA comb Illegal Block address error | |
59 ldb #E$IBA | |
3123
039ddb7c8ad7
l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents:
1345
diff
changeset
|
60 rts |