Home » Archimedes archive » Zipped Apps » BCPL » BCPL/armlib/t
BCPL/armlib/t
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Zipped Apps » BCPL |
Filename: | BCPL/armlib/t |
Read OK: | ✔ |
File size: | 024C bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
GET "LibHdr" GLOBAL { g0:0 }; LET DescribeHeap() BE { LET g = @G0 LET p = blockList; WriteF("Free chain %x6", VCAR(GetVec-16)); UNTIL !p=0 DO { LET len = !p; writef("*n%x6/%x6: ", p+1, (p+1)<<2) TEST len<0 THEN { // used block WriteF("Allocated Block of %n BCPL words", -len-1); TEST g = p+1 THEN WriteS(" (Global vector)") ELSE IF stackbase = p+1 THEN WriteS(" (Current stack)"); len := -len } ELSE // freeblock WriteF("Free Block of %n BCPL words: next %x6", len-1, p!1); p := p+len } // next block NewLine() }
00000000 47 45 54 20 22 4c 69 62 48 64 72 22 0a 0a 47 4c |GET "LibHdr"..GL| 00000010 4f 42 41 4c 20 7b 0a 20 20 67 30 3a 30 20 7d 3b |OBAL {. g0:0 };| 00000020 0a 0a 4c 45 54 20 44 65 73 63 72 69 62 65 48 65 |..LET DescribeHe| 00000030 61 70 28 29 20 42 45 20 7b 0a 20 20 20 4c 45 54 |ap() BE {. LET| 00000040 20 67 20 3d 20 40 47 30 0a 20 20 20 4c 45 54 20 | g = @G0. LET | 00000050 70 20 3d 20 62 6c 6f 63 6b 4c 69 73 74 3b 0a 20 |p = blockList;. | 00000060 20 20 57 72 69 74 65 46 28 22 46 72 65 65 20 63 | WriteF("Free c| 00000070 68 61 69 6e 20 25 78 36 22 2c 20 56 43 41 52 28 |hain %x6", VCAR(| 00000080 47 65 74 56 65 63 2d 31 36 29 29 3b 0a 20 20 20 |GetVec-16));. | 00000090 55 4e 54 49 4c 20 21 70 3d 30 20 44 4f 20 7b 0a |UNTIL !p=0 DO {.| 000000a0 20 20 20 20 20 20 4c 45 54 20 6c 65 6e 20 3d 20 | LET len = | 000000b0 21 70 3b 0a 20 20 20 20 20 20 77 72 69 74 65 66 |!p;. writef| 000000c0 28 22 2a 6e 25 78 36 2f 25 78 36 3a 20 22 2c 20 |("*n%x6/%x6: ", | 000000d0 70 2b 31 2c 20 28 70 2b 31 29 3c 3c 32 29 0a 20 |p+1, (p+1)<<2). | 000000e0 20 20 20 20 20 54 45 53 54 20 6c 65 6e 3c 30 20 | TEST len<0 | 000000f0 54 48 45 4e 20 7b 20 2f 2f 20 75 73 65 64 20 62 |THEN { // used b| 00000100 6c 6f 63 6b 0a 09 20 57 72 69 74 65 46 28 22 41 |lock.. WriteF("A| 00000110 6c 6c 6f 63 61 74 65 64 20 42 6c 6f 63 6b 20 6f |llocated Block o| 00000120 66 20 25 6e 20 42 43 50 4c 20 77 6f 72 64 73 22 |f %n BCPL words"| 00000130 2c 20 2d 6c 65 6e 2d 31 29 3b 0a 09 20 54 45 53 |, -len-1);.. TES| 00000140 54 20 67 20 3d 20 70 2b 31 0a 09 20 20 20 20 54 |T g = p+1.. T| 00000150 48 45 4e 20 57 72 69 74 65 53 28 22 20 28 47 6c |HEN WriteS(" (Gl| 00000160 6f 62 61 6c 20 76 65 63 74 6f 72 29 22 29 0a 09 |obal vector)")..| 00000170 20 45 4c 53 45 20 49 46 20 73 74 61 63 6b 62 61 | ELSE IF stackba| 00000180 73 65 20 3d 20 70 2b 31 0a 09 20 20 20 20 54 48 |se = p+1.. TH| 00000190 45 4e 20 57 72 69 74 65 53 28 22 20 28 43 75 72 |EN WriteS(" (Cur| 000001a0 72 65 6e 74 20 73 74 61 63 6b 29 22 29 3b 0a 09 |rent stack)");..| 000001b0 20 6c 65 6e 20 3a 3d 20 2d 6c 65 6e 20 7d 0a 0a | len := -len }..| 000001c0 20 20 20 20 20 20 45 4c 53 45 20 2f 2f 20 66 72 | ELSE // fr| 000001d0 65 65 62 6c 6f 63 6b 0a 09 20 57 72 69 74 65 46 |eeblock.. WriteF| 000001e0 28 22 46 72 65 65 20 42 6c 6f 63 6b 20 6f 66 20 |("Free Block of | 000001f0 25 6e 20 42 43 50 4c 20 77 6f 72 64 73 3a 20 6e |%n BCPL words: n| 00000200 65 78 74 20 25 78 36 22 2c 20 6c 65 6e 2d 31 2c |ext %x6", len-1,| 00000210 20 70 21 31 29 3b 0a 0a 0a 20 20 20 20 20 20 70 | p!1);... p| 00000220 20 3a 3d 20 70 2b 6c 65 6e 20 20 7d 20 2f 2f 20 | := p+len } // | 00000230 6e 65 78 74 20 62 6c 6f 63 6b 0a 0a 20 20 20 4e |next block.. N| 00000240 65 77 4c 69 6e 65 28 29 20 7d 0a 0a |ewLine() }..| 0000024c