Mercurial > hg > Members > kono > nitros9-code
comparison level2/modules/kernel/ffreehb.asm @ 1345:1da8ab9ba433
Added consistent comments to each system call
author | boisy |
---|---|
date | Wed, 17 Sep 2003 17:26:37 +0000 |
parents | 436443bd9b8e |
children | 1451bc7ef0b9 |
comparison
equal
deleted
inserted
replaced
1344:dfd2e7080b4d | 1345:1da8ab9ba433 |
---|---|
1 * F$FreeHB entry point (Called from F$MapBlk - called from SS.MpGPB) | 1 ************************************************** |
2 * System Call: F$FreeHB | |
3 * | |
4 * Function: Get free high block | |
5 * | |
6 * Called from F$MapBlk and from SS.MpGPB) | |
7 * | |
8 * Input: B = Block count | |
9 * Y = DAT image pointer | |
10 * | |
11 * Output: A = High block number | |
12 * | |
13 * Error: CC = C bit set; B = error code | |
14 * | |
2 FFreeHB ldb R$B,u Get # blocks requested | 15 FFreeHB ldb R$B,u Get # blocks requested |
3 ldy R$Y,u Get DAT Img ptr | 16 ldy R$Y,u Get DAT Img ptr |
4 bsr L0A31 Go find free blocks in high part of DAT | 17 bsr L0A31 Go find free blocks in high part of DAT |
5 L0A2C bcs L0A30 Couldn't find any, exit with error | 18 L0A2C bcs L0A30 Couldn't find any, exit with error |
6 sta R$A,u Save starting block # | 19 sta R$A,u Save starting block # |
39 cmpa 3,s Have we got enough? | 52 cmpa 3,s Have we got enough? |
40 bne L0A71 No, keep looking | 53 bne L0A71 No, keep looking |
41 L0A82 leas 2,s Eat temporary stack | 54 L0A82 leas 2,s Eat temporary stack |
42 puls d,x,pc Restore reg, error code & return | 55 puls d,x,pc Restore reg, error code & return |
43 | 56 |
44 * F$FreeLB entry point (WHERE DOES THIS EVER GET CALLED FROM???) | 57 |
45 * Rodney says: "it's called via os9p1 syscall vector in line 393" | 58 * WHERE DOES THIS EVER GET CALLED FROM??? |
59 * Rodney says: "It's called via os9p1 syscall vector in line 393" | |
46 FSFreeLB ldb R$B,u Get block count | 60 FSFreeLB ldb R$B,u Get block count |
47 ldy R$Y,u Get ptr to DAT Image | 61 ldy R$Y,u Get ptr to DAT Image |
48 bsr L0A4B Go find block #'s | 62 bsr L0A4B Go find block #'s |
49 bra L0A2C Do error checking & exit (since never called, | 63 bra L0A2C Do error checking & exit (since never called, |
50 * not worried about speed) | 64 * not worried about speed) |
55 nega -(-1)=+1 | 69 nega -(-1)=+1 |
56 subb #9 Drop block count to -8 to -1 (invert within 8) | 70 subb #9 Drop block count to -8 to -1 (invert within 8) |
57 negb Negate so it is a positive # again | 71 negb Negate so it is a positive # again |
58 bra L0A56 Go into main find loop | 72 bra L0A56 Go into main find loop |
59 | 73 |
60 * F$FreeLB entry point | 74 |
75 ************************************************** | |
76 * System Call: F$FreeLB | |
77 * | |
78 * Function: Get free low block | |
79 * | |
80 * Input: B = Block count | |
81 * Y = DAT image pointer | |
82 * | |
83 * Output: A = Low block number | |
84 * | |
85 * Error: CC = C bit set; B = error code | |
86 * | |
61 FFreeLB ldd R$D,u | 87 FFreeLB ldd R$D,u |
62 ldx R$X,u | 88 ldx R$X,u |
63 ldu R$U,u | 89 ldu R$U,u |
64 L0A8C pshs d,x,y,u | 90 L0A8C pshs d,x,y,u |
65 leay <P$DATImg,x | 91 leay <P$DATImg,x |