home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / basic / blib / Blib / Memory < prev    next >
Unknown  |  1992-02-29  |  9.1 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text


This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
100% file data default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 0d 00 01 12 2a 7c 73 74 | 61 72 74 20 4d 65 6d 6f |....*|st|art Memo|
|00000010| 72 79 0d 00 02 15 2a 7c | 21 4d 45 4d 4f 52 59 20 |ry....*||!MEMORY |
|00000020| 4c 69 62 72 61 72 79 0d | 00 03 07 2a 7c 21 0d 00 |Library.|...*|!..|
|00000030| 04 34 2a 7c 21 56 65 72 | 73 69 6f 6e 20 32 2e 30 |.4*|!Ver|sion 2.0|
|00000040| 31 20 2d 20 28 43 29 20 | 49 61 6e 20 50 61 6c 6d |1 - (C) |Ian Palm|
|00000050| 65 72 2c 20 31 73 74 20 | 4d 61 72 63 68 20 31 39 |er, 1st |March 19|
|00000060| 39 33 0d 00 05 07 2a 7c | 21 0d 00 06 4a 2a 7c 21 |93....*||!...J*|!|
|00000070| 54 68 69 73 20 6c 69 62 | 72 61 72 79 20 70 72 6f |This lib|rary pro|
|00000080| 76 69 64 65 73 20 64 79 | 6e 61 6d 69 63 20 6d 65 |vides dy|namic me|
|00000090| 6d 6f 72 79 20 61 6c 6c | 6f 63 61 74 69 6f 6e 20 |mory all|ocation |
|000000a0| 66 6f 72 20 42 61 73 69 | 63 20 70 72 6f 67 72 61 |for Basi|c progra|
|000000b0| 6d 73 2e 0d 00 07 4a 2a | 7c 21 54 68 65 72 65 20 |ms....J*||!There |
|000000c0| 61 72 65 20 74 77 6f 20 | 77 61 79 73 20 74 68 69 |are two |ways thi|
|000000d0| 73 20 6c 69 62 72 61 72 | 79 20 63 61 6e 20 67 61 |s librar|y can ga|
|000000e0| 69 6e 20 6d 6f 72 65 20 | 6d 65 6d 6f 72 79 20 66 |in more |memory f|
|000000f0| 6f 72 20 61 6c 6c 6f 63 | 61 74 69 6f 6e 0d 00 08 |or alloc|ation...|
|00000100| 4e 2a 7c 21 65 69 74 68 | 65 72 20 66 72 6f 6d 20 |N*|!eith|er from |
|00000110| 42 61 73 69 63 20 69 74 | 73 65 6c 66 20 28 75 73 |Basic it|self (us|
|00000120| 69 6e 67 20 44 49 4d 29 | 20 6f 72 20 66 72 6f 6d |ing DIM)| or from|
|00000130| 20 74 68 65 20 57 49 4d | 50 20 66 72 65 65 20 6d | the WIM|P free m|
|00000140| 65 6d 6f 72 79 20 70 6f | 6f 6c 2e 0d 00 09 48 2a |emory po|ol....H*|
|00000150| 7c 21 54 68 65 20 66 6f | 72 6d 65 72 20 6d 65 74 ||!The fo|rmer met|
|00000160| 68 6f 64 20 69 73 20 72 | 65 66 65 72 65 64 20 74 |hod is r|efered t|
|00000170| 6f 20 61 73 20 74 68 65 | 20 27 73 6d 61 6c 6c 27 |o as the| 'small'|
|00000180| 20 6d 65 6d 6f 72 79 20 | 61 6c 6c 6f 63 61 74 69 | memory |allocati|
|00000190| 6f 6e 2c 0d 00 0a 48 2a | 7c 21 74 68 65 20 6c 61 |on,...H*||!the la|
|000001a0| 74 74 65 72 20 6d 65 74 | 68 6f 64 20 69 73 20 72 |tter met|hod is r|
|000001b0| 65 66 65 72 65 64 20 74 | 6f 20 61 73 20 74 68 65 |efered t|o as the|
|000001c0| 20 27 6c 61 72 67 65 27 | 20 6d 65 6d 6f 72 79 20 | 'large'| memory |
|000001d0| 61 6c 6c 6f 63 61 74 69 | 6f 6e 2e 0d 00 0b 4f 2a |allocati|on....O*|
|000001e0| 7c 21 54 68 65 20 6d 65 | 74 68 6f 64 20 75 73 65 ||!The me|thod use|
|000001f0| 64 20 69 73 20 73 65 6c | 65 63 74 65 64 20 62 79 |d is sel|ected by|
|00000200| 20 74 68 65 20 75 73 65 | 72 20 75 70 6f 6e 20 69 | the use|r upon i|
|00000210| 6e 69 74 69 61 6c 69 73 | 61 74 69 6f 6e 20 28 50 |nitialis|ation (P|
|00000220| 52 4f 43 6d 65 6d 6f 72 | 79 29 0d 00 0c 2b 2a 7c |ROCmemor|y)...+*||
|00000230| 21 61 6e 64 20 63 61 6e | 20 61 6c 73 6f 20 62 65 |!and can| also be|
|00000240| 20 63 68 61 6e 67 65 64 | 20 61 74 20 61 6e 79 20 | changed| at any |
|00000250| 74 69 6d 65 2e 0d 00 0d | 07 2a 7c 21 0d 00 0e 4f |time....|.*|!...O|
|00000260| 2a 7c 21 54 68 65 20 4d | 65 6d 6f 72 79 20 6c 69 |*|!The M|emory li|
|00000270| 62 72 61 72 79 20 69 73 | 20 61 6e 20 69 6e 74 65 |brary is| an inte|
|00000280| 67 72 61 6c 20 70 61 72 | 74 20 6f 66 20 74 68 65 |gral par|t of the|
|00000290| 20 42 6c 69 62 49 49 20 | 6c 69 62 72 61 72 79 20 | BlibII |library |
|000002a0| 63 6f 6c 6c 65 63 74 69 | 6f 6e 2e 0d 00 0f 4e 2a |collecti|on....N*|
|000002b0| 7c 21 41 6c 74 68 6f 75 | 67 68 20 79 6f 75 20 6d ||!Althou|gh you m|
|000002c0| 61 79 20 6e 6f 74 20 64 | 69 72 65 63 74 6c 79 20 |ay not d|irectly |
|000002d0| 75 73 65 20 69 74 2c 20 | 75 73 69 6e 67 20 6d 6f |use it, |using mo|
|000002e0| 73 74 20 6f 66 20 74 68 | 65 20 6f 74 68 65 72 20 |st of th|e other |
|000002f0| 6c 69 62 72 61 72 69 65 | 73 0d 00 10 4b 2a 7c 21 |librarie|s...K*|!|
|00000300| 77 69 6c 6c 20 72 65 71 | 75 69 72 65 20 79 6f 75 |will req|uire you|
|00000310| 20 74 6f 20 69 6e 69 74 | 69 61 6c 69 73 65 20 74 | to init|ialise t|
|00000320| 68 65 20 6d 65 6d 6f 72 | 79 20 6c 69 62 72 61 72 |he memor|y librar|
|00000330| 79 2e 20 49 6e 20 67 65 | 6e 65 72 61 6c 20 61 73 |y. In ge|neral as|
|00000340| 73 75 6d 65 0d 00 11 4f | 2a 7c 21 74 68 61 74 20 |sume...O|*|!that |
|00000350| 79 6f 75 20 6e 65 65 64 | 20 74 68 69 73 2c 20 75 |you need| this, u|
|00000360| 6e 6c 65 73 73 20 79 6f | 75 20 61 72 65 20 75 73 |nless yo|u are us|
|00000370| 69 6e 67 20 6f 6e 6c 79 | 20 61 20 66 65 77 20 4f |ing only| a few O|
|00000380| 53 20 6c 69 62 72 61 72 | 79 20 72 6f 75 74 69 6e |S librar|y routin|
|00000390| 65 73 2e 0d 00 12 11 2a | 7c 73 74 6f 70 20 4d 65 |es.....*||stop Me|
|000003a0| 6d 6f 72 79 0d 00 13 16 | 2a 7c 73 74 61 72 74 20 |mory....|*|start |
|000003b0| 50 52 4f 43 6d 65 6d 6f | 72 79 0d 00 14 22 2a 7c |PROCmemo|ry..."*||
|000003c0| 21 50 52 4f 43 6d 65 6d | 6f 72 79 28 20 65 72 72 |!PROCmem|ory( err|
|000003d0| 6f 72 20 2c 20 73 6d 61 | 6c 6c 20 29 0d 00 15 07 |or , sma|ll )....|
|000003e0| 2a 7c 21 0d 00 16 4f 2a | 7c 21 54 68 69 73 20 70 |*|!...O*||!This p|
|000003f0| 72 6f 63 65 64 75 72 65 | 20 69 6e 69 74 69 61 6c |rocedure| initial|
|00000400| 69 73 65 73 20 74 68 65 | 20 6d 65 6d 6f 72 79 20 |ises the| memory |
|00000410| 61 6c 6c 6f 63 61 74 69 | 6f 6e 20 70 72 6f 63 65 |allocati|on proce|
|00000420| 64 75 72 65 73 2c 20 61 | 6e 64 20 4d 55 53 54 20 |dures, a|nd MUST |
|00000430| 62 65 0d 00 17 4f 2a 7c | 21 63 61 6c 6c 65 64 20 |be...O*||!called |
|00000440| 62 65 66 6f 72 65 20 61 | 6e 79 20 6f 66 20 74 68 |before a|ny of th|
|00000450| 65 20 6f 74 68 65 72 20 | 70 72 6f 63 65 64 75 72 |e other |procedur|
|00000460| 65 73 20 69 6e 20 74 68 | 69 73 20 6c 69 62 72 61 |es in th|is libra|
|00000470| 72 79 20 28 61 6e 64 20 | 6d 75 73 74 20 6f 6e 6c |ry (and |must onl|
|00000480| 79 0d 00 18 43 2a 7c 21 | 62 65 20 63 61 6c 6c 65 |y...C*|!|be calle|
|00000490| 64 20 6f 6e 63 65 29 2e | 20 54 68 65 20 74 77 6f |d once).| The two|
|000004a0| 20 62 6f 6f 6c 65 61 6e | 20 70 61 72 61 6d 65 74 | boolean| paramet|
|000004b0| 65 72 73 20 61 72 65 20 | 61 73 20 66 6f 6c 6c 6f |ers are |as follo|
|000004c0| 77 73 20 3a 0d 00 19 07 | 2a 7c 21 0d 00 1a 4b 2a |ws :....|*|!...K*|
|000004d0| 7c 21 20 65 72 72 6f 72 | 20 20 2d 20 20 49 66 20 ||! error| - If |
|000004e0| 54 52 55 45 20 74 68 65 | 20 6c 69 62 72 61 72 79 |TRUE the| library|
|000004f0| 20 77 69 6c 6c 20 72 61 | 69 73 65 20 61 6e 20 45 | will ra|ise an E|
|00000500| 52 52 4f 52 20 28 6e 75 | 6d 62 65 72 20 31 31 29 |RROR (nu|mber 11)|
|00000510| 20 69 73 20 69 74 0d 00 | 1b 48 2a 7c 21 20 20 20 | is it..|.H*|! |
|00000520| 20 20 20 20 20 20 20 20 | 69 73 20 75 6e 61 62 6c | |is unabl|
|00000530| 65 20 74 6f 20 61 6c 6c | 6f 63 61 74 65 20 74 68 |e to all|ocate th|
|00000540| 65 20 72 65 71 75 69 72 | 65 64 20 6d 65 6d 6f 72 |e requir|ed memor|
|00000550| 79 2c 20 69 66 20 46 41 | 4c 53 45 20 6e 6f 0d 00 |y, if FA|LSE no..|
|00000560| 1c 4d 2a 7c 21 20 20 20 | 20 20 20 20 20 20 20 20 |.M*|! | |
|00000570| 65 72 72 6f 72 20 69 73 | 20 72 61 69 73 65 64 2c |error is| raised,|
|00000580| 20 61 6e 64 20 74 68 65 | 20 63 61 6c 6c 65 72 20 | and the| caller |
|00000590| 6d 75 73 74 20 68 61 6e | 64 6c 65 20 74 68 69 73 |must han|dle this|
|000005a0| 20 73 69 74 75 61 74 69 | 6f 6e 2e 0d 00 1d 4a 2a | situati|on....J*|
|000005b0| 7c 21 20 73 6d 61 6c 6c | 20 20 2d 20 20 49 66 20 ||! small| - If |
|000005c0| 54 52 55 45 20 74 68 65 | 20 27 73 6d 61 6c 6c 27 |TRUE the| 'small'|
|000005d0| 20 6d 65 6d 6f 72 79 20 | 61 6c 6c 6f 63 61 74 69 | memory |allocati|
|000005e0| 6f 6e 20 6d 65 74 68 6f | 64 20 69 73 20 75 73 65 |on metho|d is use|
|000005f0| 64 2c 20 69 66 0d 00 1e | 48 2a 7c 21 20 20 20 20 |d, if...|H*|! |
|00000600| 20 20 20 20 20 20 20 46 | 41 4c 53 45 20 74 68 65 | F|ALSE the|
|00000610| 6e 20 74 68 65 20 6c 61 | 72 67 65 20 6d 65 6d 6f |n the la|rge memo|
|00000620| 72 79 20 61 6c 6c 6f 63 | 61 69 74 6f 6e 20 6d 65 |ry alloc|aiton me|
|00000630| 74 68 6f 64 20 69 73 20 | 75 73 65 64 2e 0d 00 1f |thod is |used....|
|00000640| 07 2a 7c 21 0d 00 20 37 | 2a 7c 21 20 54 68 65 20 |.*|!.. 7|*|! The |
|00000650| 72 65 63 6f 6d 65 6e 64 | 65 64 20 63 61 6c 6c 20 |recomend|ed call |
|00000660| 69 73 20 50 52 4f 43 6d | 65 6d 6f 72 79 28 46 41 |is PROCm|emory(FA|
|00000670| 4c 53 45 2c 46 41 4c 53 | 45 29 2e 0d 00 21 13 dd |LSE,FALS|E)...!..|
|00000680| f2 6d 65 6d 6f 72 79 28 | 59 25 2c 53 25 29 0d 00 |.memory(|Y%,S%)..|
|00000690| 22 4d ea 20 50 25 2c 44 | 25 2c 41 25 2c 42 25 2c |"M. P%,D|%,A%,B%,|
|000006a0| 43 25 2c 45 25 2c 46 25 | 2c 47 25 2c 48 25 2c 49 |C%,E%,F%|,G%,H%,I|
|000006b0| 25 2c 4a 25 2c 4b 25 2c | 4c 25 2c 4d 25 2c 4e 25 |%,J%,K%,|L%,M%,N%|
|000006c0| 2c 4f 25 2c 51 25 2c 52 | 25 2c 54 25 2c 55 25 2c |,O%,Q%,R|%,T%,U%,|
|000006d0| 56 25 2c 5a 25 2c 58 25 | 2c 57 25 0d 00 23 25 ea |V%,Z%,X%|,W%..#%.|
|000006e0| 20 63 6f 70 79 72 69 67 | 68 74 24 2c 67 25 2c 68 | copyrig|ht$,g%,h|
|000006f0| 25 2c 69 25 2c 6c 25 2c | 6d 25 2c 6e 25 2c 6f 25 |%,i%,l%,|m%,n%,o%|
|00000700| 0d 00 24 47 63 6f 70 79 | 72 69 67 68 74 24 3d 22 |..$Gcopy|right$="|
|00000710| 44 79 6e 61 6d 69 63 20 | 6d 65 6d 6f 72 79 20 61 |Dynamic |memory a|
|00000720| 6c 6c 6f 63 61 74 69 6f | 6e 20 72 6f 75 74 69 6e |llocatio|n routin|
|00000730| 65 73 2c 20 a9 20 49 61 | 6e 20 50 61 6c 6d 65 72 |es, . Ia|n Palmer|
|00000740| 2c 20 31 39 39 33 22 0d | 00 25 14 de 20 5f 6d 65 |, 1993".|.%.. _me|
|00000750| 6d 5f 63 6f 64 65 25 20 | 35 35 39 0d 00 26 30 5f |m_code% |559..&0_|
|00000760| 6d 65 6d 5f 65 72 72 6f | 72 25 3d 59 25 3a 5f 6d |mem_erro|r%=Y%:_m|
|00000770| 65 6d 64 69 6d 25 3d 53 | 25 3a c8 99 20 26 35 31 |emdim%=S|%:.. &51|
|00000780| 20 b8 20 5f 6d 70 73 69 | 7a 65 25 0d 00 27 2a c8 | . _mpsi|ze%..'*.|
|00000790| 99 20 26 34 30 30 45 43 | 2c 2d 31 2c 2d 31 20 b8 |. &400EC|,-1,-1 .|
|000007a0| 20 5f 6d 74 6f 70 25 3a | 5f 6d 74 6f 70 25 2b 3d | _mtop%:|_mtop%+=|
|000007b0| 26 38 30 30 30 0d 00 28 | 28 e3 20 5a 25 3d 30 20 |&8000..(|(. Z%=0 |
|000007c0| b8 20 32 20 88 20 32 3a | 50 25 3d 5f 6d 65 6d 5f |. 2 . 2:|P%=_mem_|
|000007d0| 63 6f 64 65 25 3a 5b 4f | 50 54 20 5a 25 0d 00 29 |code%:[O|PT Z%..)|
|000007e0| 21 42 20 41 25 3a 42 20 | 42 25 3a 42 20 43 25 3a |!B A%:B |B%:B C%:|
|000007f0| 42 20 44 25 3a 42 20 52 | 25 3a 42 20 57 25 0d 00 |B D%:B R|%:B W%..|
|00000800| 2a 48 2e 41 25 3a 41 44 | 52 20 52 34 2c 5f 6d 65 |*H.A%:AD|R R4,_me|
|00000810| 6d 6f 72 79 25 3a 4c 44 | 52 20 52 31 2c 5b 52 34 |mory%:LD|R R1,[R4|
|00000820| 5d 3a 2e 45 25 3a 43 4d | 50 20 52 31 2c 23 30 3a |]:.E%:CM|P R1,#0:|
|00000830| 42 45 51 20 46 25 3a 4c | 44 52 20 52 32 2c 5b 52 |BEQ F%:L|DR R2,[R|
|00000840| 31 2c 23 2d 34 5d 0d 00 | 2b 4c 43 4d 50 20 52 32 |1,#-4]..|+LCMP R2|
|00000850| 2c 52 30 3a 42 47 45 20 | 47 25 3a 4d 4f 56 20 52 |,R0:BGE |G%:MOV R|
|00000860| 34 2c 52 31 3a 4c 44 52 | 20 52 31 2c 5b 52 31 5d |4,R1:LDR| R1,[R1]|
|00000870| 3a 42 20 45 25 3a 2e 46 | 25 3a 4d 4f 56 20 52 30 |:B E%:.F|%:MOV R0|
|00000880| 2c 23 30 3a 41 44 52 20 | 52 31 2c 5f 6d 65 6d 72 |,#0:ADR |R1,_memr|
|00000890| 76 25 0d 00 2c 45 53 54 | 52 20 52 30 2c 5b 52 31 |v%..,EST|R R0,[R1|
|000008a0| 5d 3a 4d 4f 56 20 50 43 | 2c 52 31 34 3a 2e 47 25 |]:MOV PC|,R14:.G%|
|000008b0| 3a 4c 44 52 20 52 32 2c | 5b 52 31 5d 3a 53 54 52 |:LDR R2,|[R1]:STR|
|000008c0| 20 52 32 2c 5b 52 34 5d | 3a 41 44 52 20 52 30 2c | R2,[R4]|:ADR R0,|
|000008d0| 5f 6d 65 6d 72 76 25 0d | 00 2d 1a 53 54 52 20 52 |_memrv%.|.-.STR R|
|000008e0| 31 2c 5b 52 30 5d 3a 4d | 4f 56 20 50 43 2c 52 31 |1,[R0]:M|OV PC,R1|
|000008f0| 34 0d 00 2e 4d 2e 42 25 | 3a 4c 44 52 20 52 35 2c |4...M.B%|:LDR R5,|
|00000900| 5b 52 30 2c 23 2d 34 5d | 3a 41 44 44 20 52 36 2c |[R0,#-4]|:ADD R6,|
|00000910| 52 35 2c 52 30 3a 41 44 | 44 20 52 36 2c 52 36 2c |R5,R0:AD|D R6,R6,|
|00000920| 23 34 3a 41 44 52 20 52 | 34 2c 5f 6d 65 6d 6f 72 |#4:ADR R|4,_memor|
|00000930| 79 25 3a 4c 44 52 20 52 | 31 2c 5b 52 34 5d 0d 00 |y%:LDR R|1,[R4]..|
|00000940| 2f 42 2e 48 25 3a 43 4d | 50 20 52 31 2c 23 30 3a |/B.H%:CM|P R1,#0:|
|00000950| 42 45 51 20 49 25 3a 4c | 44 52 20 52 32 2c 5b 52 |BEQ I%:L|DR R2,[R|
|00000960| 31 2c 23 2d 34 5d 3a 41 | 44 44 20 52 33 2c 52 32 |1,#-4]:A|DD R3,R2|
|00000970| 2c 52 31 3a 41 44 44 20 | 52 33 2c 52 33 2c 23 34 |,R1:ADD |R3,R3,#4|
|00000980| 0d 00 30 51 43 4d 50 20 | 52 33 2c 52 30 3a 42 45 |..0QCMP |R3,R0:BE|
|00000990| 51 20 4a 25 3a 43 4d 50 | 20 52 36 2c 52 31 3a 42 |Q J%:CMP| R6,R1:B|
|000009a0| 45 51 20 4b 25 3a 43 4d | 50 20 52 31 2c 52 30 3a |EQ K%:CM|P R1,R0:|
|000009b0| 42 47 54 20 49 25 3a 4d | 4f 56 20 52 34 2c 52 31 |BGT I%:M|OV R4,R1|
|000009c0| 3a 4c 44 52 20 52 31 2c | 5b 52 31 5d 3a 42 20 48 |:LDR R1,|[R1]:B H|
|000009d0| 25 0d 00 31 42 2e 49 25 | 3a 53 54 52 20 52 30 2c |%..1B.I%|:STR R0,|
|000009e0| 5b 52 34 5d 3a 53 54 52 | 20 52 31 2c 5b 52 30 5d |[R4]:STR| R1,[R0]|
|000009f0| 3a 42 20 4c 25 3a 2e 4a | 25 3a 41 44 44 20 52 35 |:B L%:.J|%:ADD R5|
|00000a00| 2c 52 35 2c 52 32 3a 41 | 44 44 20 52 35 2c 52 35 |,R5,R2:A|DD R5,R5|
|00000a10| 2c 23 34 0d 00 32 4a 53 | 54 52 20 52 35 2c 5b 52 |,#4..2JS|TR R5,[R|
|00000a20| 31 2c 23 2d 34 5d 3a 4d | 4f 56 20 52 30 2c 52 31 |1,#-4]:M|OV R0,R1|
|00000a30| 3a 4c 44 52 20 52 31 2c | 5b 52 31 5d 3a 43 4d 50 |:LDR R1,|[R1]:CMP|
|00000a40| 20 52 36 2c 52 31 3a 42 | 4e 45 20 4c 25 3a 4c 44 | R6,R1:B|NE L%:LD|
|00000a50| 52 20 52 32 2c 5b 52 31 | 2c 23 2d 34 5d 0d 00 33 |R R2,[R1|,#-4]..3|
|00000a60| 49 2e 4b 25 3a 41 44 44 | 20 52 35 2c 52 35 2c 52 |I.K%:ADD| R5,R5,R|
|00000a70| 32 3a 41 44 44 20 52 35 | 2c 52 35 2c 23 34 3a 53 |2:ADD R5|,R5,#4:S|
|00000a80| 54 52 20 52 35 2c 5b 52 | 30 2c 23 2d 34 5d 3a 4c |TR R5,[R|0,#-4]:L|
|00000a90| 44 52 20 52 31 2c 5b 52 | 31 5d 3a 53 54 52 20 52 |DR R1,[R|1]:STR R|
|00000aa0| 31 2c 5b 52 30 5d 0d 00 | 34 39 53 54 52 20 52 30 |1,[R0]..|49STR R0|
|00000ab0| 2c 5b 52 34 5d 3a 2e 4c | 25 3a 41 44 52 20 52 31 |,[R4]:.L|%:ADR R1|
|00000ac0| 2c 5f 6d 65 6d 72 76 25 | 3a 53 54 52 20 52 30 2c |,_memrv%|:STR R0,|
|00000ad0| 5b 52 31 5d 3a 4d 4f 56 | 20 50 43 2c 52 31 34 0d |[R1]:MOV| PC,R14.|
|00000ae0| 00 35 49 2e 43 25 3a 41 | 44 52 20 52 31 2c 5f 6d |.5I.C%:A|DR R1,_m|
|00000af0| 65 6d 6f 72 79 25 3a 2e | 4d 25 3a 4c 44 52 20 52 |emory%:.|M%:LDR R|
|00000b00| 32 2c 5b 52 31 5d 3a 43 | 4d 50 20 52 32 2c 23 30 |2,[R1]:C|MP R2,#0|
|00000b10| 3a 42 45 51 20 4e 25 3a | 43 4d 50 20 52 32 2c 52 |:BEQ N%:|CMP R2,R|
|00000b20| 30 3a 42 45 51 20 4f 25 | 0d 00 36 4e 4d 4f 56 4c |0:BEQ O%|..6NMOVL|
|00000b30| 54 20 52 31 2c 52 32 3a | 42 4c 54 20 4d 25 3a 2e |T R1,R2:|BLT M%:.|
|00000b40| 4e 25 3a 4d 4f 56 20 52 | 31 2c 23 30 3a 2e 4f 25 |N%:MOV R|1,#0:.O%|
|00000b50| 3a 41 44 52 20 52 30 2c | 5f 6d 65 6d 72 76 25 3a |:ADR R0,|_memrv%:|
|00000b60| 53 54 52 20 52 31 2c 5b | 52 30 5d 3a 4d 4f 56 20 |STR R1,[|R0]:MOV |
|00000b70| 50 43 2c 52 31 34 0d 00 | 37 48 2e 52 25 3a 41 44 |PC,R14..|7H.R%:AD|
|00000b80| 52 20 52 34 2c 5f 6d 65 | 6d 6f 72 79 25 3a 4c 44 |R R4,_me|mory%:LD|
|00000b90| 52 20 52 32 2c 5b 52 34 | 5d 3a 2e 54 25 3a 43 4d |R R2,[R4|]:.T%:CM|
|00000ba0| 50 20 52 32 2c 23 30 3a | 42 45 51 20 55 25 3a 4c |P R2,#0:|BEQ U%:L|
|00000bb0| 44 52 20 52 33 2c 5b 52 | 32 2c 23 2d 34 5d 0d 00 |DR R3,[R|2,#-4]..|
|00000bc0| 38 4a 41 44 44 20 52 33 | 2c 52 33 2c 52 32 3a 43 |8JADD R3|,R3,R2:C|
|00000bd0| 4d 50 20 52 33 2c 52 30 | 3a 42 45 51 20 56 25 3a |MP R3,R0|:BEQ V%:|
|00000be0| 4d 4f 56 20 52 34 2c 52 | 32 3a 4c 44 52 20 52 32 |MOV R4,R|2:LDR R2|
|00000bf0| 2c 5b 52 32 5d 3a 42 20 | 54 25 3a 2e 55 25 3a 4d |,[R2]:B |T%:.U%:M|
|00000c00| 4f 56 20 52 32 2c 23 30 | 0d 00 39 49 2e 56 25 3a |OV R2,#0|..9I.V%:|
|00000c10| 41 44 52 20 52 31 2c 5f | 6d 65 6d 72 76 25 3a 53 |ADR R1,_|memrv%:S|
|00000c20| 54 52 20 52 32 2c 5b 52 | 31 5d 3a 41 44 52 20 52 |TR R2,[R|1]:ADR R|
|00000c30| 31 2c 5f 6d 65 6d 72 76 | 32 25 3a 53 54 52 20 52 |1,_memrv|2%:STR R|
|00000c40| 34 2c 5b 52 31 5d 3a 4d | 4f 56 20 50 43 2c 52 31 |4,[R1]:M|OV PC,R1|
|00000c50| 34 0d 00 3a 42 2e 57 25 | 3a 41 44 52 20 52 31 2c |4..:B.W%|:ADR R1,|
|00000c60| 5f 6d 65 6d 6f 72 79 25 | 3a 4d 4f 56 20 52 30 2c |_memory%|:MOV R0,|
|00000c70| 23 30 3a 4c 44 52 20 52 | 32 2c 5b 52 31 5d 3a 2e |#0:LDR R|2,[R1]:.|
|00000c80| 59 25 3a 43 4d 50 20 52 | 32 2c 23 30 3a 42 45 51 |Y%:CMP R|2,#0:BEQ|
|00000c90| 20 53 25 0d 00 3b 31 4c | 44 52 20 52 33 2c 5b 52 | S%..;1L|DR R3,[R|
|00000ca0| 32 2c 23 2d 34 5d 3a 41 | 44 44 20 52 30 2c 52 30 |2,#-4]:A|DD R0,R0|
|00000cb0| 2c 52 33 3a 4c 44 52 20 | 52 32 2c 5b 52 32 5d 3a |,R3:LDR |R2,[R2]:|
|00000cc0| 42 20 59 25 0d 00 3c 2d | 2e 53 25 3a 41 44 52 20 |B Y%..<-|.S%:ADR |
|00000cd0| 52 31 2c 5f 6d 65 6d 72 | 76 25 3a 53 54 52 20 52 |R1,_memr|v%:STR R|
|00000ce0| 30 2c 5b 52 31 5d 3a 4d | 4f 56 20 50 43 2c 52 31 |0,[R1]:M|OV PC,R1|
|00000cf0| 34 0d 00 3d 42 2e 44 25 | 3a 53 54 4d 46 44 20 52 |4..=B.D%|:STMFD R|
|00000d00| 31 33 21 2c 7b 52 38 2d | 52 31 30 2c 52 31 34 7d |13!,{R8-|R10,R14}|
|00000d10| 3a 43 4d 50 20 52 30 2c | 23 30 3a 4c 44 4d 45 51 |:CMP R0,|#0:LDMEQ|
|00000d20| 46 44 20 52 31 33 21 2c | 7b 52 38 2d 52 31 30 2c |FD R13!,|{R8-R10,|
|00000d30| 50 43 7d 0d 00 3e 2d 43 | 4d 50 20 52 31 2c 52 32 |PC}..>-C|MP R1,R2|
|00000d40| 3a 4c 44 4d 45 51 46 44 | 20 52 31 33 21 2c 7b 52 |:LDMEQFD| R13!,{R|
|00000d50| 38 2d 52 31 30 2c 50 43 | 7d 3a 42 4c 54 20 6c 25 |8-R10,PC|}:BLT l%|
|00000d60| 0d 00 3f 48 2e 67 25 3a | 53 55 42 53 20 52 30 2c |..?H.g%:|SUBS R0,|
|00000d70| 52 30 2c 23 33 32 3a 42 | 4c 54 20 68 25 3a 4c 44 |R0,#32:B|LT h%:LD|
|00000d80| 4d 49 41 20 52 31 21 2c | 7b 52 33 2d 52 31 30 7d |MIA R1!,|{R3-R10}|
|00000d90| 3a 53 54 4d 49 41 20 52 | 32 21 2c 7b 52 33 2d 52 |:STMIA R|2!,{R3-R|
|00000da0| 31 30 7d 3a 42 20 67 25 | 0d 00 40 51 2e 68 25 3a |10}:B g%|..@Q.h%:|
|00000db0| 41 44 44 53 20 52 30 2c | 52 30 2c 23 33 32 3a 2e |ADDS R0,|R0,#32:.|
|00000dc0| 69 25 3a 4c 44 4d 45 51 | 46 44 20 52 31 33 21 2c |i%:LDMEQ|FD R13!,|
|00000dd0| 7b 52 38 2d 52 31 30 2c | 50 43 7d 3a 4c 44 52 20 |{R8-R10,|PC}:LDR |
|00000de0| 52 34 2c 5b 52 31 5d 2c | 23 34 3a 53 54 52 20 52 |R4,[R1],|#4:STR R|
|00000df0| 34 2c 5b 52 32 5d 2c 23 | 34 0d 00 41 16 53 55 42 |4,[R2],#|4..A.SUB|
|00000e00| 53 20 52 30 2c 52 30 2c | 23 34 3a 42 20 69 25 0d |S R0,R0,|#4:B i%.|
|00000e10| 00 42 21 2e 6c 25 3a 41 | 44 44 20 52 31 2c 52 31 |.B!.l%:A|DD R1,R1|
|00000e20| 2c 52 30 3a 41 44 44 20 | 52 32 2c 52 32 2c 52 30 |,R0:ADD |R2,R2,R0|
|00000e30| 0d 00 43 48 2e 6d 25 3a | 53 55 42 53 20 52 30 2c |..CH.m%:|SUBS R0,|
|00000e40| 52 30 2c 23 33 32 3a 42 | 4c 54 20 6e 25 3a 4c 44 |R0,#32:B|LT n%:LD|
|00000e50| 4d 44 42 20 52 31 21 2c | 7b 52 33 2d 52 31 30 7d |MDB R1!,|{R3-R10}|
|00000e60| 3a 53 54 4d 44 42 20 52 | 32 21 2c 7b 52 33 2d 52 |:STMDB R|2!,{R3-R|
|00000e70| 31 30 7d 3a 42 20 6d 25 | 0d 00 44 44 2e 6e 25 3a |10}:B m%|..DD.n%:|
|00000e80| 41 44 44 53 20 52 30 2c | 52 30 2c 23 33 32 3a 2e |ADDS R0,|R0,#32:.|
|00000e90| 6f 25 3a 4c 44 4d 45 51 | 46 44 20 52 31 33 21 2c |o%:LDMEQ|FD R13!,|
|00000ea0| 7b 52 38 2d 52 31 30 2c | 50 43 7d 3a 4c 44 52 20 |{R8-R10,|PC}:LDR |
|00000eb0| 52 34 2c 5b 52 31 2c 23 | 2d 34 5d 21 0d 00 45 27 |R4,[R1,#|-4]!..E'|
|00000ec0| 53 54 52 20 52 34 2c 5b | 52 32 2c 23 2d 34 5d 21 |STR R4,[|R2,#-4]!|
|00000ed0| 3a 53 55 42 53 20 52 30 | 2c 52 30 2c 23 34 3a 42 |:SUBS R0|,R0,#4:B|
|00000ee0| 20 6f 25 0d 00 46 14 2e | 5f 6d 65 6d 6f 72 79 25 | o%..F..|_memory%|
|00000ef0| 20 45 51 55 44 20 30 0d | 00 47 13 2e 5f 6d 65 6d | EQUD 0.|.G.._mem|
|00000f00| 72 76 25 20 45 51 55 44 | 20 30 0d 00 48 14 2e 5f |rv% EQUD| 0..H.._|
|00000f10| 6d 65 6d 72 76 32 25 20 | 45 51 55 44 20 30 0d 00 |memrv2% |EQUD 0..|
|00000f20| 49 07 5d 3a ed 0d 00 4a | 05 e1 0d 00 4b 04 0d 00 |I.]:...J|....K...|
|00000f30| 4c 16 dd a4 5f 6d 6f 72 | 65 5f 6d 65 6d 6f 72 79 |L..._mor|e_memory|
|00000f40| 28 53 25 29 0d 00 4d 1c | ea 20 4d 25 2c 4c 25 2c |(S%)..M.|. M%,L%,|
|00000f50| 41 25 2c 58 25 2c 59 25 | 2c 5a 25 3a 4d 25 3d 30 |A%,X%,Y%|,Z%:M%=0|
|00000f60| 0d 00 4e 10 e7 20 5f 6d | 65 6d 64 69 6d 25 20 8c |..N.. _m|emdim% .|
|00000f70| 0d 00 4f 4d 20 20 41 25 | 3d e0 3a d6 20 5f 6d 65 |..OM A%|=.:. _me|
|00000f80| 6d 5f 63 6f 64 65 25 2b | 31 36 3a 4c 25 3d 21 5f |m_code%+|16:L%=!_|
|00000f90| 6d 65 6d 72 76 25 3a e7 | 20 4c 25 3c 3e 30 20 8c |memrv%:.| L%<>0 .|
|00000fa0| 20 53 25 2d 3d 21 28 4c | 25 2d 34 29 2d 34 3a 21 | S%-=!(L|%-4)-4:!|
|00000fb0| 21 5f 6d 65 6d 72 76 32 | 25 3d 21 4c 25 0d 00 50 |!_memrv2|%=!L%..P|
|00000fc0| 4b 20 20 e7 20 53 25 3c | 28 93 2d e0 2d 32 30 34 |K . S%<|(.-.-204|
|00000fd0| 38 29 20 8c 20 de 20 4d | 25 20 53 25 2d 31 3a 21 |8) . . M|% S%-1:!|
|00000fe0| 4d 25 3d 53 25 2d 34 3a | e7 20 4c 25 3c 3e 30 20 |M%=S%-4:|. L%<>0 |
|00000ff0| 8c 20 4d 25 3d 4c 25 2d | 34 3a 21 4d 25 3d 53 25 |. M%=L%-|4:!M%=S%|
|00001000| 2b 21 28 4c 25 2d 34 29 | 0d 00 51 05 cc 0d 00 52 |+!(L%-4)|..Q....R|
|00001010| 54 20 20 41 25 3d 5f 6d | 74 6f 70 25 3a d6 20 5f |T A%=_m|top%:. _|
|00001020| 6d 65 6d 5f 63 6f 64 65 | 25 2b 31 36 3a 4c 25 3d |mem_code|%+16:L%=|
|00001030| 21 5f 6d 65 6d 72 76 25 | 3a e7 20 4c 25 3c 3e 30 |!_memrv%|:. L%<>0|
|00001040| 20 8c 20 53 25 2d 3d 21 | 28 4c 25 2d 34 29 2d 34 | . S%-=!|(L%-4)-4|
|00001050| 3a 21 28 21 5f 6d 65 6d | 72 76 32 25 29 3d 21 4c |:!(!_mem|rv2%)=!L|
|00001060| 25 0d 00 53 2a 20 20 c8 | 99 20 26 34 30 30 45 43 |%..S* .|. &400EC|
|00001070| 2c 2d 31 2c 2d 31 20 b8 | 20 58 25 2c 59 25 2c 5a |,-1,-1 .| X%,Y%,Z|
|00001080| 25 3a e7 20 53 25 3c 5a | 25 20 8c 0d 00 54 6b 20 |%:. S%<Z|% ...Tk |
|00001090| 20 20 20 c8 99 20 26 34 | 30 30 45 43 2c 58 25 2b | .. &4|00EC,X%+|
|000010a0| 53 25 2c 59 25 20 b8 20 | 5a 25 3a 4d 25 3d 58 25 |S%,Y% . |Z%:M%=X%|
|000010b0| 2b 26 38 30 30 30 3a 21 | 4d 25 3d 5a 25 2d 58 25 |+&8000:!|M%=Z%-X%|
|000010c0| 2d 34 3a 5f 6d 74 6f 70 | 25 3d 5a 25 2b 26 38 30 |-4:_mtop|%=Z%+&80|
|000010d0| 30 30 3a e7 20 4c 25 3c | 3e 30 20 8c 20 4d 25 3d |00:. L%<|>0 . M%=|
|000010e0| 4c 25 2d 34 3a 21 4d 25 | 3d 5a 25 2d 58 25 2b 21 |L%-4:!M%|=Z%-X%+!|
|000010f0| 28 4c 25 2d 34 29 0d 00 | 55 07 20 20 cd 0d 00 56 |(L%-4)..|U. ...V|
|00001100| 05 cd 0d 00 57 13 e7 20 | 4d 25 3c 3e 30 20 8c 20 |....W.. |M%<>0 . |
|00001110| 4d 25 2b 3d 34 0d 00 58 | 07 3d 4d 25 0d 00 59 04 |M%+=4..X|.=M%..Y.|
|00001120| 0d 00 5a 12 dd f2 5f 6c | 65 73 73 5f 6d 65 6d 6f |..Z..._l|ess_memo|
|00001130| 72 79 0d 00 5b 1a ea 20 | 41 25 2c 42 25 2c 4c 25 |ry..[.. |A%,B%,L%|
|00001140| 2c 43 25 2c 53 25 2c 4e | 25 2c 44 25 0d 00 5c 1d |,C%,S%,N|%,D%..\.|
|00001150| 41 25 3d 5f 6d 74 6f 70 | 25 3a d6 20 5f 6d 65 6d |A%=_mtop|%:. _mem|
|00001160| 5f 63 6f 64 65 25 2b 31 | 36 0d 00 5d 2b 42 25 3d |_code%+1|6..]+B%=|
|00001170| 21 5f 6d 65 6d 72 76 25 | 3a 43 25 3d 21 5f 6d 65 |!_memrv%|:C%=!_me|
|00001180| 6d 72 76 32 25 3a 42 25 | 2d 3d 34 3a 4c 25 3d 34 |mrv2%:B%|-=4:L%=4|
|00001190| 2b 21 42 25 0d 00 5e 3b | 44 25 3d 28 4c 25 20 81 |+!B%..^;|D%=(L% .|
|000011a0| 20 5f 6d 70 73 69 7a 65 | 25 29 2a 5f 6d 70 73 69 | _mpsize|%)*_mpsi|
|000011b0| 7a 65 25 3a 4e 25 3d 4c | 25 2d 44 25 3a 53 25 3d |ze%:N%=L|%-D%:S%=|
|000011c0| 5f 6d 74 6f 70 25 2d 44 | 25 2d 26 38 30 30 30 0d |_mtop%-D|%-&8000.|
|000011d0| 00 5f 28 c8 99 20 26 34 | 30 30 45 43 2c 53 25 2c |._(.. &4|00EC,S%,|
|000011e0| 2d 31 20 b8 20 53 25 3a | 5f 6d 74 6f 70 25 3d 53 |-1 . S%:|_mtop%=S|
|000011f0| 25 2b 26 38 30 30 30 0d | 00 60 1d e7 20 4e 25 3e |%+&8000.|.`.. N%>|
|00001200| 37 20 8c 20 21 42 25 3d | 4e 25 2d 34 3a 8b 20 21 |7 . !B%=|N%-4:. !|
|00001210| 43 25 3d 30 0d 00 61 05 | e1 0d 00 62 04 0d 00 63 |C%=0..a.|...b...c|
|00001220| 15 2a 7c 73 74 6f 70 20 | 50 52 4f 43 6d 65 6d 6f |.*|stop |PROCmemo|
|00001230| 72 79 0d 00 64 1c 2a 7c | 73 74 61 72 74 20 50 52 |ry..d.*||start PR|
|00001240| 4f 43 6d 65 6d 6f 72 79 | 5f 73 6d 61 6c 6c 0d 00 |OCmemory|_small..|
|00001250| 65 17 2a 7c 21 50 52 4f | 43 6d 65 6d 6f 72 79 5f |e.*|!PRO|Cmemory_|
|00001260| 73 6d 61 6c 6c 0d 00 66 | 43 2a 7c 21 54 68 69 73 |small..f|C*|!This|
|00001270| 20 70 72 6f 63 65 64 75 | 72 65 20 77 69 6c 6c 20 | procedu|re will |
|00001280| 73 65 74 20 74 68 65 20 | 27 73 6d 61 6c 6c 27 20 |set the |'small' |
|00001290| 6d 65 6d 6f 72 79 20 61 | 6c 6c 6f 63 61 74 69 6f |memory a|llocatio|
|000012a0| 6e 20 61 73 20 74 68 65 | 0d 00 67 42 2a 7c 21 63 |n as the|..gB*|!c|
|000012b0| 75 72 72 65 6e 74 20 61 | 6c 6c 6f 63 61 74 69 6f |urrent a|llocatio|
|000012c0| 6e 20 6d 65 74 68 6f 64 | 2e 20 54 68 69 73 20 63 |n method|. This c|
|000012d0| 61 6e 20 62 65 20 64 6f | 6e 65 20 61 74 20 61 6e |an be do|ne at an|
|000012e0| 79 20 74 69 6d 65 20 61 | 6e 64 0d 00 68 42 2a 7c |y time a|nd..hB*||
|000012f0| 21 61 6c 6f 6e 67 20 77 | 69 74 68 20 27 50 52 4f |!along w|ith 'PRO|
|00001300| 43 6d 65 6d 6f 72 79 5f | 6c 61 72 67 65 27 20 61 |Cmemory_|large' a|
|00001310| 6c 6c 6f 77 73 20 62 6f | 74 68 20 6d 65 6d 6f 72 |llows bo|th memor|
|00001320| 79 20 61 6c 6c 6f 63 61 | 74 69 6f 6e 0d 00 69 2b |y alloca|tion..i+|
|00001330| 2a 7c 21 6d 65 74 68 6f | 64 73 20 74 6f 20 62 65 |*|!metho|ds to be|
|00001340| 20 75 73 65 64 20 61 74 | 20 74 68 65 20 73 61 6d | used at| the sam|
|00001350| 65 20 74 69 6d 65 2e 0d | 00 6a 12 dd f2 6d 65 6d |e time..|.j...mem|
|00001360| 6f 72 79 5f 73 6d 61 6c | 6c 0d 00 6b 0e 5f 6d 65 |ory_smal|l..k._me|
|00001370| 6d 64 69 6d 25 3d b9 0d | 00 6c 05 e1 0d 00 6d 04 |mdim%=..|.l....m.|
|00001380| 0d 00 6e 1b 2a 7c 73 74 | 6f 70 20 50 52 4f 43 6d |..n.*|st|op PROCm|
|00001390| 65 6d 6f 72 79 5f 73 6d | 61 6c 6c 0d 00 6f 1c 2a |emory_sm|all..o.*|
|000013a0| 7c 73 74 61 72 74 20 50 | 52 4f 43 6d 65 6d 6f 72 ||start P|ROCmemor|
|000013b0| 79 5f 6c 61 72 67 65 0d | 00 70 17 2a 7c 21 50 52 |y_large.|.p.*|!PR|
|000013c0| 4f 43 6d 65 6d 6f 72 79 | 5f 6c 61 72 67 65 0d 00 |OCmemory|_large..|
|000013d0| 71 07 2a 7c 21 0d 00 72 | 43 2a 7c 21 54 68 69 73 |q.*|!..r|C*|!This|
|000013e0| 20 70 72 6f 63 65 64 75 | 72 65 20 77 69 6c 6c 20 | procedu|re will |
|000013f0| 73 65 74 20 74 68 65 20 | 27 6c 61 72 67 65 27 20 |set the |'large' |
|00001400| 6d 65 6d 6f 72 79 20 61 | 6c 6c 6f 63 61 74 69 6f |memory a|llocatio|
|00001410| 6e 20 61 73 20 74 68 65 | 0d 00 73 42 2a 7c 21 63 |n as the|..sB*|!c|
|00001420| 75 72 72 65 6e 74 20 61 | 6c 6c 6f 63 61 74 69 6f |urrent a|llocatio|
|00001430| 6e 20 6d 65 74 68 6f 64 | 2e 20 54 68 69 73 20 63 |n method|. This c|
|00001440| 61 6e 20 62 65 20 64 6f | 6e 65 20 61 74 20 61 6e |an be do|ne at an|
|00001450| 79 20 74 69 6d 65 20 61 | 6e 64 0d 00 74 42 2a 7c |y time a|nd..tB*||
|00001460| 21 61 6c 6f 6e 67 20 77 | 69 74 68 20 27 50 52 4f |!along w|ith 'PRO|
|00001470| 43 6d 65 6d 6f 72 79 5f | 73 6d 61 6c 6c 27 20 61 |Cmemory_|small' a|
|00001480| 6c 6c 6f 77 73 20 62 6f | 74 68 20 6d 65 6d 6f 72 |llows bo|th memor|
|00001490| 79 20 61 6c 6c 6f 63 61 | 74 69 6f 6e 0d 00 75 2b |y alloca|tion..u+|
|000014a0| 2a 7c 21 6d 65 74 68 6f | 64 73 20 74 6f 20 62 65 |*|!metho|ds to be|
|000014b0| 20 75 73 65 64 20 61 74 | 20 74 68 65 20 73 61 6d | used at| the sam|
|000014c0| 65 20 74 69 6d 65 2e 0d | 00 76 12 dd f2 6d 65 6d |e time..|.v...mem|
|000014d0| 6f 72 79 5f 6c 61 72 67 | 65 0d 00 77 0e 5f 6d 65 |ory_larg|e..w._me|
|000014e0| 6d 64 69 6d 25 3d a3 0d | 00 78 05 e1 0d 00 79 04 |mdim%=..|.x....y.|
|000014f0| 0d 00 7a 1b 2a 7c 73 74 | 6f 70 20 50 52 4f 43 6d |..z.*|st|op PROCm|
|00001500| 65 6d 6f 72 79 5f 6c 61 | 72 67 65 0d 00 7b 14 2a |emory_la|rge..{.*|
|00001510| 7c 73 74 61 72 74 20 46 | 4e 6d 61 6c 6c 6f 63 0d ||start F|Nmalloc.|
|00001520| 00 7c 17 2a 7c 21 46 4e | 6d 61 6c 6c 6f 63 28 20 |.|.*|!FN|malloc( |
|00001530| 73 69 7a 65 20 29 0d 00 | 7d 07 2a 7c 21 0d 00 7e |size )..|}.*|!..~|
|00001540| 4e 2a 7c 21 54 68 69 73 | 20 66 75 6e 63 74 69 6f |N*|!This| functio|
|00001550| 6e 20 72 65 74 75 72 6e | 73 20 61 20 70 6f 69 6e |n return|s a poin|
|00001560| 74 65 72 20 74 6f 20 74 | 68 65 20 73 74 61 72 74 |ter to t|he start|
|00001570| 20 6f 66 20 61 20 62 6c | 6f 63 6b 20 6f 66 20 6d | of a bl|ock of m|
|00001580| 65 6d 6f 72 79 20 77 68 | 69 63 68 0d 00 7f 51 2a |emory wh|ich...Q*|
|00001590| 7c 21 69 73 20 61 74 20 | 6c 65 61 73 74 20 27 73 ||!is at |least 's|
|000015a0| 69 7a 65 27 20 62 79 74 | 65 73 20 6c 6f 6e 67 2e |ize' byt|es long.|
|000015b0| 20 49 66 20 6d 65 6d 6f | 72 79 20 63 61 6e 20 6e | If memo|ry can n|
|000015c0| 6f 74 20 62 65 20 61 6c | 6c 6f 63 61 74 65 64 20 |ot be al|located |
|000015d0| 74 68 65 20 66 75 6e 63 | 74 69 6f 6e 0d 00 80 4d |the func|tion...M|
|000015e0| 2a 7c 21 77 69 6c 6c 20 | 65 69 74 68 65 72 20 72 |*|!will |either r|
|000015f0| 61 69 73 65 20 61 6e 20 | 45 52 52 4f 52 20 6f 72 |aise an |ERROR or|
|00001600| 20 72 65 74 75 72 6e 20 | 30 20 28 64 65 70 65 6e | return |0 (depen|
|00001610| 64 69 6e 67 20 6f 6e 20 | 74 68 65 20 73 65 74 74 |ding on |the sett|
|00001620| 69 6e 67 20 67 69 76 65 | 6e 0d 00 81 29 2a 7c 21 |ing give|n...)*|!|
|00001630| 61 74 20 69 6e 69 74 69 | 61 6c 69 73 61 74 69 6f |at initi|alisatio|
|00001640| 6e 20 6f 66 20 74 68 65 | 20 6c 69 62 72 61 72 79 |n of the| library|
|00001650| 29 2e 0d 00 82 10 dd a4 | 6d 61 6c 6c 6f 63 28 41 |).......|malloc(A|
|00001660| 25 29 0d 00 83 0b ea 20 | 4d 25 2c 53 25 0d 00 84 |%)..... |M%,S%...|
|00001670| 2d 53 25 3d 41 25 3a 41 | 25 3d 31 32 2b 28 41 25 |-S%=A%:A|%=12+(A%|
|00001680| 20 81 20 31 36 29 2a 31 | 36 3a e7 20 41 25 3c 53 | . 16)*1|6:. A%<S|
|00001690| 25 20 8c 20 41 25 2b 3d | 31 36 0d 00 85 1c d6 20 |% . A%+=|16..... |
|000016a0| 5f 6d 65 6d 5f 63 6f 64 | 65 25 3a 4d 25 3d 21 5f |_mem_cod|e%:M%=!_|
|000016b0| 6d 65 6d 72 76 25 0d 00 | 86 0c e7 20 4d 25 3d 30 |memrv%..|... M%=0|
|000016c0| 20 8c 0d 00 87 1c 20 20 | 4d 25 3d a4 5f 6d 6f 72 | ..... |M%=._mor|
|000016d0| 65 5f 6d 65 6d 6f 72 79 | 28 41 25 2b 34 29 0d 00 |e_memory|(A%+4)..|
|000016e0| 88 05 cd 0d 00 89 47 e7 | 20 4d 25 3c 3e 30 20 8c |......G.| M%<>0 .|
|000016f0| 20 53 25 3d 21 28 4d 25 | 2d 34 29 3a e7 20 53 25 | S%=!(M%|-4):. S%|
|00001700| 2d 41 25 3e 31 35 20 8c | 20 21 28 4d 25 2d 34 29 |-A%>15 .| !(M%-4)|
|00001710| 3d 41 25 3a f2 61 64 64 | 5f 66 72 65 65 28 4d 25 |=A%:.add|_free(M%|
|00001720| 2b 41 25 2c 53 25 2d 41 | 25 29 0d 00 8a 37 e7 20 |+A%,S%-A|%)...7. |
|00001730| 4d 25 3d 30 20 80 20 5f | 6d 65 6d 5f 65 72 72 6f |M%=0 . _|mem_erro|
|00001740| 72 25 20 8c 20 85 20 31 | 31 2c 22 43 61 6e 27 74 |r% . . 1|1,"Can't|
|00001750| 20 61 6c 6c 6f 63 61 74 | 65 20 6d 65 6d 6f 72 79 | allocat|e memory|
|00001760| 22 0d 00 8b 07 3d 4d 25 | 0d 00 8c 04 0d 00 8d 13 |"....=M%|........|
|00001770| 2a 7c 73 74 6f 70 20 46 | 4e 6d 61 6c 6c 6f 63 0d |*|stop F|Nmalloc.|
|00001780| 00 8e 14 2a 7c 73 74 61 | 72 74 20 50 52 4f 43 66 |...*|sta|rt PROCf|
|00001790| 72 65 65 0d 00 8f 1a 2a | 7c 21 50 52 4f 43 66 72 |ree....*||!PROCfr|
|000017a0| 65 65 28 20 70 6f 69 6e | 74 65 72 20 29 0d 00 90 |ee( poin|ter )...|
|000017b0| 07 2a 7c 21 0d 00 91 50 | 2a 7c 21 44 65 61 6c 6c |.*|!...P|*|!Deall|
|000017c0| 6f 63 61 74 65 73 20 74 | 68 65 20 6d 65 6d 6f 72 |ocates t|he memor|
|000017d0| 79 20 70 6f 69 6e 74 65 | 64 20 74 6f 20 62 79 20 |y pointe|d to by |
|000017e0| 27 70 6f 69 6e 74 65 72 | 27 2e 20 54 68 65 20 73 |'pointer|'. The s|
|000017f0| 75 70 70 6c 69 65 64 20 | 70 6f 69 6e 74 65 72 20 |upplied |pointer |
|00001800| 4d 55 53 54 0d 00 92 51 | 2a 7c 21 62 65 20 6f 6e |MUST...Q|*|!be on|
|00001810| 65 20 67 69 76 65 6e 20 | 62 79 20 65 69 74 68 65 |e given |by eithe|
|00001820| 72 20 46 4e 6d 61 6c 6c | 6f 63 20 6f 72 20 50 52 |r FNmall|oc or PR|
|00001830| 4f 43 72 65 61 6c 6c 6f | 63 2e 20 50 61 73 73 69 |OCreallo|c. Passi|
|00001840| 6e 67 20 61 6e 79 20 6f | 74 68 65 72 20 70 6f 69 |ng any o|ther poi|
|00001850| 6e 74 65 72 73 0d 00 93 | 39 2a 7c 21 77 69 6c 6c |nters...|9*|!will|
|00001860| 20 63 61 75 73 65 20 74 | 68 65 20 6c 69 62 72 61 | cause t|he libra|
|00001870| 72 79 20 74 6f 20 66 61 | 69 6c 20 61 74 20 73 6f |ry to fa|il at so|
|00001880| 6d 65 20 6c 65 74 65 72 | 20 64 61 74 65 2e 0d 00 |me leter| date...|
|00001890| 94 0e dd f2 66 72 65 65 | 28 41 25 29 0d 00 95 08 |....free|(A%)....|
|000018a0| ea 20 4c 25 0d 00 96 1e | d6 20 5f 6d 65 6d 5f 63 |. L%....|. _mem_c|
|000018b0| 6f 64 65 25 2b 34 3a 4c | 25 3d 21 5f 6d 65 6d 72 |ode%+4:L|%=!_memr|
|000018c0| 76 25 0d 00 97 41 e7 20 | 28 4c 25 2b 21 28 4c 25 |v%...A. |(L%+!(L%|
|000018d0| 2d 34 29 29 3d 5f 6d 74 | 6f 70 25 20 80 20 28 34 |-4))=_mt|op% . (4|
|000018e0| 2b 21 28 4c 25 2d 34 29 | 29 3e 3d 5f 6d 70 73 69 |+!(L%-4)|)>=_mpsi|
|000018f0| 7a 65 25 20 8c 20 f2 5f | 6c 65 73 73 5f 6d 65 6d |ze% . ._|less_mem|
|00001900| 6f 72 79 0d 00 98 05 e1 | 0d 00 99 04 0d 00 9a 13 |ory.....|........|
|00001910| 2a 7c 73 74 6f 70 20 50 | 52 4f 43 66 72 65 65 0d |*|stop P|ROCfree.|
|00001920| 00 9b 18 2a 7c 73 74 61 | 72 74 20 50 52 4f 43 61 |...*|sta|rt PROCa|
|00001930| 64 64 5f 66 72 65 65 0d | 00 9c 2d 2a 7c 21 50 52 |dd_free.|..-*|!PR|
|00001940| 4f 43 61 64 64 5f 66 72 | 65 65 28 20 73 74 61 72 |OCadd_fr|ee( star|
|00001950| 74 5f 61 64 64 72 65 73 | 73 20 2c 20 6c 65 6e 67 |t_addres|s , leng|
|00001960| 74 68 20 29 0d 00 9d 07 | 2a 7c 21 0d 00 9e 49 2a |th )....|*|!...I*|
|00001970| 7c 21 54 68 69 73 20 70 | 72 6f 63 65 64 75 72 65 ||!This p|rocedure|
|00001980| 20 63 61 6e 20 62 65 20 | 75 73 65 64 20 66 6f 72 | can be |used for|
|00001990| 20 70 61 73 73 69 6e 67 | 20 6e 65 77 20 62 6c 6f | passing| new blo|
|000019a0| 63 6b 73 20 6f 66 20 6d | 65 6d 6f 72 79 20 74 6f |cks of m|emory to|
|000019b0| 20 74 68 65 0d 00 9f 4e | 2a 7c 21 6c 69 62 72 61 | the...N|*|!libra|
|000019c0| 72 79 2e 20 59 6f 75 20 | 73 68 6f 75 6c 64 20 4e |ry. You |should N|
|000019d0| 4f 54 20 70 61 73 73 20 | 74 68 69 73 20 70 72 6f |OT pass |this pro|
|000019e0| 63 65 64 75 72 65 20 62 | 6c 6f 63 6b 73 20 61 6c |cedure b|locks al|
|000019f0| 72 65 61 64 79 20 61 6c | 6c 6f 63 61 74 65 64 20 |ready al|located |
|00001a00| 62 79 0d 00 a0 4d 2a 7c | 21 74 68 69 73 20 6c 69 |by...M*||!this li|
|00001a10| 62 72 61 72 79 2c 20 72 | 61 74 68 65 72 20 69 74 |brary, r|ather it|
|00001a20| 20 73 68 6f 75 6c 64 20 | 62 65 20 75 73 65 64 20 | should |be used |
|00001a30| 66 6f 72 20 6e 65 77 20 | 62 6c 6f 63 6b 73 20 6f |for new |blocks o|
|00001a40| 66 20 6d 65 6d 6f 72 79 | 20 67 61 69 6e 65 64 0d |f memory| gained.|
|00001a50| 00 a1 4f 2a 7c 21 66 72 | 6f 6d 20 65 6c 73 65 77 |..O*|!fr|om elsew|
|00001a60| 68 65 72 65 20 28 65 67 | 2e 20 66 72 6f 6d 20 74 |here (eg|. from t|
|00001a70| 68 65 20 44 49 4d 20 63 | 6f 6d 6d 61 6e 64 29 2e |he DIM c|ommand).|
|00001a80| 20 54 68 65 20 27 73 74 | 61 72 74 5f 61 64 64 72 | The 'st|art_addr|
|00001a90| 65 73 73 27 20 73 68 6f | 75 6c 64 20 62 65 0d 00 |ess' sho|uld be..|
|00001aa0| a2 4d 2a 7c 21 74 68 65 | 20 69 6e 69 74 69 61 6c |.M*|!the| initial|
|00001ab0| 20 61 64 64 72 65 73 73 | 20 6f 66 20 74 68 65 20 | address| of the |
|00001ac0| 62 6c 6f 63 6b 2c 20 61 | 6e 64 20 27 6c 65 6e 67 |block, a|nd 'leng|
|00001ad0| 74 68 27 20 73 68 6f 75 | 6c 64 20 62 65 20 74 68 |th' shou|ld be th|
|00001ae0| 65 20 6c 65 6e 67 74 68 | 20 6f 66 0d 00 a3 11 2a |e length| of....*|
|00001af0| 7c 21 74 68 65 20 62 6c | 6f 63 6b 2e 0d 00 a4 15 ||!the bl|ock.....|
|00001b00| dd f2 61 64 64 5f 66 72 | 65 65 28 41 25 2c 4c 25 |..add_fr|ee(A%,L%|
|00001b10| 29 0d 00 a5 3a 4c 25 3d | 28 4c 25 20 81 20 31 36 |)...:L%=|(L% . 16|
|00001b20| 29 2a 31 36 3a e7 20 4c | 25 3e 30 20 8c 20 21 41 |)*16:. L|%>0 . !A|
|00001b30| 25 3d 4c 25 2d 34 3a 41 | 25 2b 3d 34 3a d6 20 5f |%=L%-4:A|%+=4:. _|
|00001b40| 6d 65 6d 5f 63 6f 64 65 | 25 2b 34 0d 00 a6 05 e1 |mem_code|%+4.....|
|00001b50| 0d 00 a7 04 0d 00 a8 17 | 2a 7c 73 74 6f 70 20 50 |........|*|stop P|
|00001b60| 52 4f 43 61 64 64 5f 66 | 72 65 65 0d 00 a9 17 2a |ROCadd_f|ree....*|
|00001b70| 7c 73 74 61 72 74 20 50 | 52 4f 43 72 65 61 6c 6c ||start P|ROCreall|
|00001b80| 6f 63 0d 00 aa 28 2a 7c | 21 50 52 4f 43 72 65 61 |oc...(*||!PROCrea|
|00001b90| 6c 6c 6f 63 28 20 70 6f | 69 6e 74 65 72 20 2c 20 |lloc( po|inter , |
|00001ba0| 6e 65 77 5f 73 69 7a 65 | 20 29 0d 00 ab 07 2a 7c |new_size| )....*||
|00001bb0| 21 0d 00 ac 4a 2a 7c 21 | 54 68 69 73 20 70 72 6f |!...J*|!|This pro|
|00001bc0| 63 65 64 75 72 65 20 74 | 61 6b 65 73 20 74 68 65 |cedure t|akes the|
|00001bd0| 20 62 6c 6f 63 6b 20 70 | 6f 69 6e 74 65 64 20 74 | block p|ointed t|
|00001be0| 6f 20 62 79 20 27 70 6f | 69 6e 74 65 72 27 20 61 |o by 'po|inter' a|
|00001bf0| 6e 64 20 6d 61 6b 65 73 | 20 69 74 0d 00 ad 4c 2a |nd makes| it...L*|
|00001c00| 7c 21 61 74 20 6c 65 61 | 73 74 20 27 6e 65 77 5f ||!at lea|st 'new_|
|00001c10| 73 69 7a 65 27 20 62 79 | 74 65 73 20 6c 6f 6e 67 |size' by|tes long|
|00001c20| 2e 20 27 70 6f 69 6e 74 | 65 72 20 6d 75 73 74 20 |. 'point|er must |
|00001c30| 62 65 20 61 20 70 6f 69 | 6e 74 65 72 20 70 72 65 |be a poi|nter pre|
|00001c40| 76 69 6f 75 73 6c 79 0d | 00 ae 4c 2a 7c 21 67 69 |viously.|..L*|!gi|
|00001c50| 76 65 6e 20 62 79 20 46 | 4e 6d 61 6c 6c 6f 63 20 |ven by F|Nmalloc |
|00001c60| 6f 72 20 50 52 4f 43 72 | 65 61 6c 6c 6f 63 2e 20 |or PROCr|ealloc. |
|00001c70| 52 65 61 6c 6c 6f 63 61 | 74 69 6f 6e 20 6d 61 79 |Realloca|tion may|
|00001c80| 20 72 65 71 75 69 72 65 | 20 72 65 6c 6f 63 61 74 | require| relocat|
|00001c90| 69 6f 6e 0d 00 af 4a 2a | 7c 21 6f 66 20 74 68 65 |ion...J*||!of the|
|00001ca0| 20 62 6c 6f 63 6b 2c 20 | 69 6e 20 77 68 69 63 68 | block, |in which|
|00001cb0| 20 63 61 73 65 20 74 68 | 65 20 70 6f 69 6e 74 65 | case th|e pointe|
|00001cc0| 72 20 69 73 20 75 70 64 | 61 74 65 64 20 61 6e 64 |r is upd|ated and|
|00001cd0| 20 74 68 65 20 63 6f 6e | 74 65 6e 74 73 0d 00 b0 | the con|tents...|
|00001ce0| 4a 2a 7c 21 63 6f 70 69 | 65 64 20 74 6f 20 74 68 |J*|!copi|ed to th|
|00001cf0| 65 20 6e 65 77 20 6c 6f | 63 61 74 69 6f 6e 2e 20 |e new lo|cation. |
|00001d00| 49 66 20 61 20 4e 55 4c | 4c 20 70 6f 69 6e 74 65 |If a NUL|L pointe|
|00001d10| 72 20 69 73 20 67 69 76 | 65 6e 2c 20 50 52 4f 43 |r is giv|en, PROC|
|00001d20| 72 65 61 6c 6c 6f 63 0d | 00 b1 4a 2a 7c 21 62 65 |realloc.|..J*|!be|
|00001d30| 68 61 76 65 73 20 6c 69 | 6b 65 20 6d 61 6c 6c 6f |haves li|ke mallo|
|00001d40| 63 2e 20 49 66 20 74 68 | 65 20 62 6c 6f 63 6b 20 |c. If th|e block |
|00001d50| 63 61 6e 20 6e 6f 74 20 | 62 65 20 65 78 74 65 6e |can not |be exten|
|00001d60| 64 65 64 20 6e 6f 72 20 | 72 65 6c 6f 63 61 74 65 |ded nor |relocate|
|00001d70| 64 0d 00 b2 47 2a 7c 21 | 74 68 65 6e 20 74 68 69 |d...G*|!|then thi|
|00001d80| 73 20 70 72 6f 63 65 64 | 75 72 65 20 77 69 6c 6c |s proced|ure will|
|00001d90| 20 65 69 74 68 65 72 20 | 72 61 69 73 65 20 61 6e | either |raise an|
|00001da0| 20 45 52 52 4f 52 20 28 | 6e 75 6d 62 65 72 20 31 | ERROR (|number 1|
|00001db0| 31 29 20 6f 72 20 64 6f | 0d 00 b3 47 2a 7c 21 6e |1) or do|...G*|!n|
|00001dc0| 6f 74 68 69 6e 67 20 28 | 69 65 2e 20 6c 65 61 76 |othing (|ie. leav|
|00001dd0| 65 20 74 68 65 20 62 6c | 6f 63 6b 20 61 73 20 69 |e the bl|ock as i|
|00001de0| 74 20 77 61 73 29 20 64 | 65 70 65 6e 64 69 6e 67 |t was) d|epending|
|00001df0| 20 6f 6e 20 74 68 65 20 | 73 65 74 74 69 6e 67 0d | on the |setting.|
|00001e00| 00 b4 1b 2a 7c 21 67 69 | 76 65 6e 20 74 6f 20 50 |...*|!gi|ven to P|
|00001e10| 52 4f 43 6d 65 6d 6f 72 | 79 2e 0d 00 b5 16 dd f2 |ROCmemor|y.......|
|00001e20| 72 65 61 6c 6c 6f 63 28 | f8 20 50 25 2c 4e 25 29 |realloc(|. P%,N%)|
|00001e30| 0d 00 b6 0e ea 20 41 25 | 2c 42 25 2c 43 25 0d 00 |..... A%|,B%,C%..|
|00001e40| b7 1d e7 20 50 25 3d 30 | 20 8c 20 50 25 3d a4 6d |... P%=0| . P%=.m|
|00001e50| 61 6c 6c 6f 63 28 4e 25 | 29 3a e1 0d 00 b8 38 43 |alloc(N%|):....8C|
|00001e60| 25 3d 21 28 50 25 2d 34 | 29 3a 42 25 3d 4e 25 3a |%=!(P%-4|):B%=N%:|
|00001e70| 4e 25 3d 31 32 2b 28 4e | 25 20 81 20 31 36 29 2a |N%=12+(N|% . 16)*|
|00001e80| 31 36 3a e7 20 4e 25 3c | 42 25 20 8c 20 4e 25 2b |16:. N%<|B% . N%+|
|00001e90| 3d 31 36 0d 00 b9 0e e7 | 20 4e 25 3c 3d 43 25 20 |=16.....| N%<=C% |
|00001ea0| 8c 0d 00 ba 36 20 20 e7 | 20 28 43 25 2d 4e 25 29 |....6 .| (C%-N%)|
|00001eb0| 3e 31 35 20 8c 20 21 28 | 50 25 2d 34 29 3d 4e 25 |>15 . !(|P%-4)=N%|
|00001ec0| 3a f2 61 64 64 5f 66 72 | 65 65 28 50 25 2b 4e 25 |:.add_fr|ee(P%+N%|
|00001ed0| 2c 43 25 2d 4e 25 29 0d | 00 bb 05 cc 0d 00 bc 4c |,C%-N%).|.......L|
|00001ee0| 20 20 41 25 3d 50 25 2b | 43 25 2b 34 3a d6 20 5f | A%=P%+|C%+4:. _|
|00001ef0| 6d 65 6d 5f 63 6f 64 65 | 25 2b 38 3a 42 25 3d 21 |mem_code|%+8:B%=!|
|00001f00| 5f 6d 65 6d 72 76 25 3a | 41 25 3d 30 3a e7 20 42 |_memrv%:|A%=0:. B|
|00001f10| 25 3c 3e 30 20 8c 20 42 | 25 3d 21 42 25 3a 41 25 |%<>0 . B|%=!B%:A%|
|00001f20| 3d 21 28 42 25 2d 34 29 | 0d 00 bd 1d 20 20 e7 20 |=!(B%-4)|.... . |
|00001f30| 42 25 3c 3e 30 20 80 20 | 43 25 2b 41 25 2b 34 3e |B%<>0 . |C%+A%+4>|
|00001f40| 3d 4e 25 20 8c 0d 00 be | 25 20 20 20 20 21 21 5f |=N% ....|% !!_|
|00001f50| 6d 65 6d 72 76 25 3d 21 | 42 25 3a 21 28 50 25 2d |memrv%=!|B%:!(P%-|
|00001f60| 34 29 3d 43 25 2b 41 25 | 2b 34 0d 00 bf 07 20 20 |4)=C%+A%|+4.... |
|00001f70| cc 0d 00 c0 1c 20 20 20 | 20 41 25 3d 43 25 3a 43 |..... | A%=C%:C|
|00001f80| 25 3d a4 6d 61 6c 6c 6f | 63 28 4e 25 29 0d 00 c1 |%=.mallo|c(N%)...|
|00001f90| 11 20 20 20 20 e7 20 43 | 25 3c 3e 30 20 8c 0d 00 |. . C|%<>0 ...|
|00001fa0| c2 2f 20 20 20 20 20 20 | 42 25 3d 50 25 3a d6 20 |./ |B%=P%:. |
|00001fb0| 5f 6d 65 6d 5f 63 6f 64 | 65 25 2b 31 32 3a f2 66 |_mem_cod|e%+12:.f|
|00001fc0| 72 65 65 28 50 25 29 3a | 50 25 3d 43 25 0d 00 c3 |ree(P%):|P%=C%...|
|00001fd0| 09 20 20 20 20 cc 0d 00 | c4 36 20 20 20 20 20 20 |. ...|.6 |
|00001fe0| e7 20 5f 6d 65 6d 5f 65 | 72 72 6f 72 25 20 8c 20 |. _mem_e|rror% . |
|00001ff0| 85 20 31 31 2c 22 43 61 | 6e 27 74 20 61 6c 6c 6f |. 11,"Ca|n't allo|
|00002000| 63 61 74 65 20 6d 65 6d | 6f 72 79 22 0d 00 c5 09 |cate mem|ory"....|
|00002010| 20 20 20 20 cd 0d 00 c6 | 07 20 20 cd 0d 00 c7 05 | ....|. .....|
|00002020| cd 0d 00 c8 05 e1 0d 00 | c9 04 0d 00 ca 16 2a 7c |........|......*||
|00002030| 73 74 6f 70 20 50 52 4f | 43 72 65 61 6c 6c 6f 63 |stop PRO|Crealloc|
|00002040| 0d 00 cb 12 2a 7c 73 74 | 61 72 74 20 46 4e 66 72 |....*|st|art FNfr|
|00002050| 65 65 0d 00 cc 0d 2a 7c | 21 46 4e 66 72 65 65 0d |ee....*||!FNfree.|
|00002060| 00 cd 07 2a 7c 21 0d 00 | ce 50 2a 7c 21 54 68 69 |...*|!..|.P*|!Thi|
|00002070| 73 20 66 75 6e 63 74 69 | 6f 6e 20 72 65 74 75 72 |s functi|on retur|
|00002080| 6e 73 20 74 68 65 20 74 | 6f 74 61 6c 20 6d 65 6d |ns the t|otal mem|
|00002090| 6f 72 79 20 61 76 61 69 | 6c 61 62 6c 65 20 66 6f |ory avai|lable fo|
|000020a0| 72 20 61 6c 6c 6f 63 61 | 74 69 6f 6e 20 75 6e 64 |r alloca|tion und|
|000020b0| 65 72 20 74 68 65 0d 00 | cf 4e 2a 7c 21 63 75 72 |er the..|.N*|!cur|
|000020c0| 72 65 6e 74 20 6d 65 6d | 6f 72 79 20 61 6c 6c 6f |rent mem|ory allo|
|000020d0| 63 61 74 69 6f 6e 20 6d | 65 74 68 6f 64 2e 20 54 |cation m|ethod. T|
|000020e0| 68 69 73 20 69 6e 63 6c | 75 64 65 73 20 74 68 65 |his incl|udes the|
|000020f0| 20 6d 65 6d 6f 72 79 20 | 61 76 61 69 6c 61 62 6c | memory |availabl|
|00002100| 65 20 69 6e 0d 00 d0 4e | 2a 7c 21 74 68 65 20 6c |e in...N|*|!the l|
|00002110| 69 62 72 61 72 69 65 73 | 20 66 72 65 65 20 6d 65 |ibraries| free me|
|00002120| 6d 6f 72 79 20 73 74 72 | 75 63 74 75 72 65 2c 20 |mory str|ucture, |
|00002130| 61 6e 64 20 65 69 74 68 | 65 72 20 74 68 65 20 6d |and eith|er the m|
|00002140| 65 6d 6f 72 79 20 61 76 | 61 69 6c 61 62 6c 65 20 |emory av|ailable |
|00002150| 74 6f 0d 00 d1 4d 2a 7c | 21 42 61 73 69 63 27 73 |to...M*||!Basic's|
|00002160| 20 44 49 4d 20 63 6f 6d | 6d 61 6e 64 20 28 6c 65 | DIM com|mand (le|
|00002170| 73 73 20 32 6b 29 20 6f | 72 20 74 68 65 20 6d 65 |ss 2k) o|r the me|
|00002180| 6d 6f 72 79 20 61 76 61 | 69 6c 61 62 6c 65 20 69 |mory ava|ilable i|
|00002190| 6e 20 74 68 65 20 57 49 | 4d 50 20 66 72 65 65 0d |n the WI|MP free.|
|000021a0| 00 d2 13 2a 7c 21 6d 65 | 6d 6f 72 79 20 70 6f 6f |...*|!me|mory poo|
|000021b0| 6c 2e 0d 00 d3 0a dd a4 | 66 72 65 65 0d 00 d4 0b |l.......|free....|
|000021c0| ea 20 41 25 2c 42 25 0d | 00 d5 1f d6 20 5f 6d 65 |. A%,B%.|.... _me|
|000021d0| 6d 5f 63 6f 64 65 25 2b | 32 30 3a 41 25 3d 21 5f |m_code%+|20:A%=!_|
|000021e0| 6d 65 6d 72 76 25 0d 00 | d6 3f e7 20 5f 6d 65 6d |memrv%..|.?. _mem|
|000021f0| 64 69 6d 25 20 8c 20 41 | 25 2b 3d 28 93 2d e0 2d |dim% . A|%+=(.-.-|
|00002200| 32 30 34 38 29 3a 8b 20 | c8 99 20 26 34 30 30 45 |2048):. |.. &400E|
|00002210| 43 2c 2d 31 2c 2d 31 20 | b8 20 2c 2c 42 25 3a 41 |C,-1,-1 |. ,,B%:A|
|00002220| 25 2b 3d 42 25 0d 00 d7 | 07 3d 41 25 0d 00 d8 04 |%+=B%...|.=A%....|
|00002230| 0d 00 d9 11 2a 7c 73 74 | 6f 70 20 46 4e 66 72 65 |....*|st|op FNfre|
|00002240| 65 0d 00 da 15 2a 7c 73 | 74 61 72 74 20 46 4e 73 |e....*|s|tart FNs|
|00002250| 69 7a 65 5f 6f 66 0d 00 | db 1b 2a 7c 21 46 4e 73 |ize_of..|..*|!FNs|
|00002260| 69 7a 65 5f 6f 66 28 20 | 70 6f 69 6e 74 65 72 20 |ize_of( |pointer |
|00002270| 29 0d 00 dc 07 2a 7c 21 | 0d 00 dd 4b 2a 7c 21 54 |)....*|!|...K*|!T|
|00002280| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 72 65 74 |his func|tion ret|
|00002290| 75 72 6e 73 20 74 68 65 | 20 73 69 7a 65 20 6f 66 |urns the| size of|
|000022a0| 20 74 68 65 20 62 6c 6f | 63 6b 20 70 6f 69 6e 74 | the blo|ck point|
|000022b0| 65 64 20 74 6f 20 62 79 | 20 27 70 6f 69 6e 74 65 |ed to by| 'pointe|
|000022c0| 72 27 2e 0d 00 de 11 dd | a4 73 69 7a 65 5f 6f 66 |r'......|.size_of|
|000022d0| 28 50 25 29 0d 00 df 0c | 3d 21 28 50 25 2d 34 29 |(P%)....|=!(P%-4)|
|000022e0| 0d 00 e0 04 0d 00 e1 14 | 2a 7c 73 74 6f 70 20 46 |........|*|stop F|
|000022f0| 4e 73 69 7a 65 5f 6f 66 | 0d 00 e2 18 2a 7c 73 74 |Nsize_of|....*|st|
|00002300| 61 72 74 20 50 52 4f 43 | 6d 65 6d 5f 63 6f 70 79 |art PROC|mem_copy|
|00002310| 0d 00 e3 3c 2a 7c 21 50 | 52 4f 43 6d 65 6d 5f 63 |...<*|!P|ROCmem_c|
|00002320| 6f 70 79 28 20 62 79 74 | 65 73 20 2c 20 73 6f 75 |opy( byt|es , sou|
|00002330| 72 63 65 5f 61 64 64 72 | 65 73 73 20 2c 20 64 65 |rce_addr|ess , de|
|00002340| 73 74 5f 61 64 64 72 65 | 73 73 20 29 0d 00 e4 07 |st_addre|ss )....|
|00002350| 2a 7c 21 0d 00 e5 4c 2a | 7c 21 43 6f 70 69 65 73 |*|!...L*||!Copies|
|00002360| 20 74 68 65 20 67 69 76 | 65 6e 20 6e 75 6d 62 65 | the giv|en numbe|
|00002370| 72 20 6f 66 20 62 79 74 | 65 73 20 66 72 6f 6d 20 |r of byt|es from |
|00002380| 73 6f 75 72 63 65 5f 61 | 64 64 72 65 73 73 20 74 |source_a|ddress t|
|00002390| 6f 20 64 65 73 74 5f 61 | 64 64 72 65 73 73 2e 0d |o dest_a|ddress..|
|000023a0| 00 e6 4c 2a 7c 21 42 6f | 74 68 20 61 64 64 72 65 |..L*|!Bo|th addre|
|000023b0| 73 73 65 73 20 6d 75 73 | 74 20 62 65 20 77 6f 72 |sses mus|t be wor|
|000023c0| 64 20 61 6c 6c 69 67 6e | 65 64 2c 20 61 6e 64 20 |d allign|ed, and |
|000023d0| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 62 79 |the numb|er of by|
|000023e0| 74 65 73 20 6d 75 73 74 | 20 62 65 0d 00 e7 41 2a |tes must| be...A*|
|000023f0| 7c 21 61 20 6d 75 6c 74 | 69 70 6c 65 20 6f 66 20 ||!a mult|iple of |
|00002400| 34 2e 20 4f 76 65 72 6c | 61 70 70 69 6e 67 20 62 |4. Overl|apping b|
|00002410| 6c 6f 63 6b 73 20 61 72 | 65 20 68 61 6e 64 6c 65 |locks ar|e handle|
|00002420| 64 20 63 6f 72 72 65 63 | 74 6c 79 2e 0d 00 e8 18 |d correc|tly.....|
|00002430| dd f2 6d 65 6d 5f 63 6f | 70 79 28 41 25 2c 42 25 |..mem_co|py(A%,B%|
|00002440| 2c 43 25 29 0d 00 e9 13 | d6 20 5f 6d 65 6d 5f 63 |,C%)....|. _mem_c|
|00002450| 6f 64 65 25 2b 31 32 0d | 00 ea 05 e1 0d 00 eb 04 |ode%+12.|........|
|00002460| 0d 00 ec 17 2a 7c 73 74 | 6f 70 20 50 52 4f 43 6d |....*|st|op PROCm|
|00002470| 65 6d 5f 63 6f 70 79 0d | 00 ed 04 0d ff |em_copy.|..... |
+--------+-------------------------+-------------------------+--------+--------+