home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / c / countervar < prev    next >
ArcFS Archive  |  1997-06-16  |  7.2 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: ArcFS Archive (archive/arcFS).

You can browse this item here: countervar

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert ArcFS Archive (archive/arcFS) magic Supported
100% file RISC OS archive (ArcFS format) default
99% file data default
100% TrID Acorn ArcFS Archive default
100% gt2 Kopftext: 'Archive' default (weak)
100% detectItEasy Archive: ArcFS default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 41 72 63 68 69 76 65 00 | b4 00 00 00 54 03 00 00 |Archive.|....T...|
|00000010| 28 00 00 00 64 00 00 00 | 00 00 00 00 00 00 00 00 |(...d...|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 82 43 6f 75 6e 74 65 72 | 48 65 78 00 88 00 00 00 |.Counter|Hex.....|
|00000070| 47 fc ff ff 47 85 13 64 | 03 00 5b 39 88 00 00 00 |G...G..d|..[9....|
|00000080| 24 00 00 00 82 43 6f 75 | 6e 74 65 72 4d 73 67 00 |$....Cou|nterMsg.|
|00000090| fa 07 00 00 47 ff ff ff | 59 88 8a 64 33 00 63 b7 |....G...|Y..d3.c.|
|000000a0| fa 07 00 00 d0 00 00 00 | 82 43 6f 75 6e 74 65 72 |........|.Counter|
|000000b0| 53 72 63 00 a9 0f 00 00 | 47 fb ff ff 03 ee 2c 64 |Src.....|G.....,d|
|000000c0| 33 00 b2 18 a9 0f 00 00 | ee 08 00 00 82 43 6f 75 |3.......|.....Cou|
|000000d0| 6e 74 65 72 56 61 72 00 | 8c 00 00 00 47 fc ff ff |nterVar.|....G...|
|000000e0| 7b f6 2c 64 03 00 9c 45 | 8c 00 00 00 bb 18 00 00 |{.,d...E|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000280| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000290| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 46 69 6c 65 | 44 61 74 61 82 43 6f 75 |....File|Data.Cou|
|00000360| 6e 74 65 72 48 65 78 00 | 88 00 00 00 47 fc ff ff |nterHex.|....G...|
|00000370| 47 85 13 64 03 00 5b 39 | 1c 40 2d e9 70 00 8f e2 |G..d..[9|.@-.p...|
|00000380| 0c 20 a0 e1 0a 3d a0 e3 | 49 00 02 ef 1c 80 bd 68 |. ...=..|I......h|
|00000390| 03 00 9c e8 00 00 31 e3 | 0f 00 00 1b 10 10 8f e2 |......1.|........|
|000003a0| 4c 20 a0 e3 00 30 a0 e3 | 10 40 a0 e3 24 00 02 ef |L ...0..|.@..$...|
|000003b0| 1c 80 bd e8 08 00 00 ea | 08 40 2d e9 2c 00 9f e5 |........|.@-.,...|
|000003c0| 01 30 80 e2 24 30 8f e5 | 24 10 8f e2 0c 20 a0 e3 |.0..$0..|$.... ..|
|000003d0| d4 00 02 ef 0c 20 62 72 | 08 80 bd e8 01 40 2d e9 |..... br|.....@-.|
|000003e0| 10 00 a0 e3 21 00 02 ef | 00 20 8f 75 01 80 bd e8 |....!...|. .u....|
|000003f0| 00 00 00 00 76 61 72 2f | 61 2c 76 61 6c 75 65 00 |....var/|a,value.|
|00000400| 46 69 6c 65 44 61 74 61 | 82 43 6f 75 6e 74 65 72 |FileData|.Counter|
|00000410| 4d 73 67 00 fa 07 00 00 | 47 ff ff ff 59 88 8a 64 |Msg.....|G...Y..d|
|00000420| 03 00 63 b7 a9 20 43 6f | 70 79 72 69 67 68 74 20 |..c.. Co|pyright |
|00000430| 4e 69 63 68 6f 6c 61 73 | 20 43 6c 61 72 6b 20 31 |Nicholas| Clark 1|
|00000440| 39 39 37 0a 42 61 73 65 | 64 20 6f 6e 20 74 68 65 |997.Base|d on the|
|00000450| 20 63 6f 64 65 20 76 61 | 72 69 61 62 6c 65 20 65 | code va|riable e|
|00000460| 78 61 6d 70 6c 65 20 69 | 6e 20 74 68 65 20 50 52 |xample i|n the PR|
|00000470| 4d 0a 0a 43 6f 75 6e 74 | 65 72 56 61 72 20 69 73 |M..Count|erVar is|
|00000480| 20 61 20 73 68 6f 72 74 | 20 28 31 34 30 20 62 79 | a short| (140 by|
|00000490| 74 65 73 29 20 75 74 69 | 6c 69 74 79 20 74 6f 20 |tes) uti|lity to |
|000004a0| 63 72 65 61 74 65 20 61 | 6e 20 4f 53 20 76 61 72 |create a|n OS var|
|000004b0| 69 61 62 6c 65 20 77 68 | 69 63 68 20 61 63 74 73 |iable wh|ich acts|
|000004c0| 20 61 73 20 61 20 63 6f | 75 6e 74 65 72 2e 20 45 | as a co|unter. E|
|000004d0| 76 65 72 79 20 74 69 6d | 65 20 74 68 69 73 20 76 |very tim|e this v|
|000004e0| 61 72 69 61 62 6c 65 20 | 69 73 20 72 65 61 64 2c |ariable |is read,|
|000004f0| 20 69 74 73 20 76 61 6c | 75 65 20 69 73 20 61 75 | its val|ue is au|
|00000500| 74 6f 6d 61 74 69 63 61 | 6c 6c 79 20 69 6e 63 72 |tomatica|lly incr|
|00000510| 65 6d 65 6e 74 65 64 2e | 20 49 74 20 69 73 20 64 |emented.| It is d|
|00000520| 65 73 69 67 6e 65 64 20 | 74 6f 20 62 65 20 72 65 |esigned |to be re|
|00000530| 70 6c 61 63 65 20 70 61 | 72 74 73 20 6f 66 20 63 |place pa|rts of c|
|00000540| 6f 64 65 20 74 68 61 74 | 20 63 75 72 72 65 6e 74 |ode that| current|
|00000550| 6c 79 20 72 65 61 64 2c | 20 69 6e 63 72 65 6d 65 |ly read,| increme|
|00000560| 6e 74 20 61 6e 64 20 77 | 72 69 74 65 20 61 20 63 |nt and w|rite a c|
|00000570| 6f 6e 76 65 6e 74 69 6f | 6e 61 6c 20 65 6e 76 69 |onventio|nal envi|
|00000580| 72 6f 6e 6d 65 6e 74 20 | 76 61 72 69 61 62 6c 65 |ronment |variable|
|00000590| 20 28 65 67 20 74 68 65 | 20 55 6e 69 78 4c 69 62 | (eg the| UnixLib|
|000005a0| 20 70 69 70 65 20 63 6f | 75 6e 74 65 72 29 0a 0a | pipe co|unter)..|
|000005b0| 54 68 65 20 75 74 69 6c | 69 74 79 20 69 73 20 61 |The util|ity is a|
|000005c0| 62 6c 65 20 74 6f 20 63 | 72 65 61 74 65 20 61 6e |ble to c|reate an|
|000005d0| 79 20 6e 75 6d 62 65 72 | 20 6f 66 20 63 6f 75 6e |y number| of coun|
|000005e0| 74 65 72 20 76 61 72 69 | 61 62 6c 65 73 20 2d 20 |ter vari|ables - |
|000005f0| 63 61 6c 6c 20 69 74 20 | 6f 6e 63 65 20 66 6f 72 |call it |once for|
|00000600| 20 65 61 63 68 20 63 6f | 75 6e 74 65 72 20 74 6f | each co|unter to|
|00000610| 20 63 72 65 61 74 65 2e | 20 54 68 65 20 6e 61 6d | create.| The nam|
|00000620| 65 20 6f 66 20 74 68 65 | 20 76 61 72 69 61 62 6c |e of the| variabl|
|00000630| 65 20 74 6f 20 63 72 65 | 61 74 65 20 69 73 20 73 |e to cre|ate is s|
|00000640| 75 70 70 6c 69 65 64 20 | 61 73 20 74 68 65 20 66 |upplied |as the f|
|00000650| 69 72 73 74 20 70 61 72 | 61 6d 65 74 65 72 2c 20 |irst par|ameter, |
|00000660| 74 68 65 20 6f 70 74 69 | 6f 6e 61 6c 20 73 65 63 |the opti|onal sec|
|00000670| 6f 6e 64 20 70 61 72 61 | 6d 65 74 65 72 20 69 73 |ond para|meter is|
|00000680| 20 74 68 65 20 69 6e 69 | 74 69 61 6c 20 76 61 6c | the ini|tial val|
|00000690| 75 65 20 28 64 65 66 61 | 75 6c 74 73 20 74 6f 20 |ue (defa|ults to |
|000006a0| 7a 65 72 6f 29 0a 0a 53 | 79 6e 74 61 78 3a 20 43 |zero)..S|yntax: C|
|000006b0| 6f 75 6e 74 65 72 56 61 | 72 20 3c 4e 61 6d 65 3e |ounterVa|r <Name>|
|000006c0| 20 5b 3c 49 6e 69 74 69 | 61 6c 20 56 61 6c 75 65 | [<Initi|al Value|
|000006d0| 3e 5d 0a 0a 43 6f 75 6e | 74 65 72 48 65 78 20 63 |>]..Coun|terHex c|
|000006e0| 6f 75 6e 74 73 20 69 6e | 20 68 65 78 61 64 65 63 |ounts in| hexadec|
|000006f0| 69 6d 61 6c 20 72 61 74 | 68 65 72 20 74 68 61 6e |imal rat|her than|
|00000700| 20 64 65 63 69 6d 61 6c | 20 28 61 6e 64 20 61 6c | decimal| (and al|
|00000710| 77 61 79 73 20 67 65 6e | 65 72 61 74 65 73 20 65 |ways gen|erates e|
|00000720| 78 61 63 74 6c 79 20 38 | 20 63 68 61 72 61 63 74 |xactly 8| charact|
|00000730| 65 72 20 6f 75 74 70 75 | 74 2e 29 0a 0a 54 68 65 |er outpu|t.)..The|
|00000740| 20 63 6f 75 6e 74 65 72 | 20 76 61 72 69 61 62 6c | counter| variabl|
|00000750| 65 20 69 73 20 69 6d 70 | 6c 65 6d 65 6e 74 65 64 |e is imp|lemented|
|00000760| 20 61 73 20 61 20 63 6f | 64 65 20 76 61 72 69 61 | as a co|de varia|
|00000770| 62 6c 65 20 2d 20 74 68 | 65 20 61 64 76 61 6e 74 |ble - th|e advant|
|00000780| 61 67 65 73 20 6f 66 20 | 74 68 69 73 20 6d 65 74 |ages of |this met|
|00000790| 68 6f 64 20 6f 76 65 72 | 20 72 65 61 64 69 6e 67 |hod over| reading|
|000007a0| 2c 20 6d 6f 64 69 66 79 | 69 6e 67 20 61 6e 64 20 |, modify|ing and |
|000007b0| 77 72 69 74 69 6e 67 20 | 61 20 63 6f 6e 76 65 6e |writing |a conven|
|000007c0| 74 69 6f 6e 61 6c 20 76 | 61 72 69 61 62 6c 65 20 |tional v|ariable |
|000007d0| 66 72 6f 6d 20 69 6e 73 | 69 64 65 20 79 6f 75 72 |from ins|ide your|
|000007e0| 20 63 6f 64 65 20 61 72 | 65 3a 0a 0a 30 3a 20 54 | code ar|e:..0: T|
|000007f0| 68 65 20 63 6f 64 65 20 | 76 61 72 69 61 62 6c 65 |he code |variable|
|00000800| 20 6d 65 74 68 6f 64 20 | 69 73 20 61 6c 6d 6f 73 | method |is almos|
|00000810| 74 20 63 65 72 74 61 69 | 6e 6c 79 20 6d 6f 72 65 |t certai|nly more|
|00000820| 20 63 6f 6d 70 61 63 74 | 2e 0a 31 3a 20 54 68 69 | compact|..1: Thi|
|00000830| 73 20 6d 65 74 68 6f 64 | 20 77 69 6c 6c 20 62 65 |s method| will be|
|00000840| 20 66 61 73 74 65 72 20 | 2d 20 6f 6e 6c 79 20 6f | faster |- only o|
|00000850| 6e 65 20 53 57 49 20 63 | 61 6c 6c 20 74 6f 20 72 |ne SWI c|all to r|
|00000860| 65 61 64 20 74 68 65 20 | 76 61 72 69 61 62 6c 65 |ead the |variable|
|00000870| 2c 20 6e 6f 6e 65 20 74 | 6f 0a 20 20 20 77 72 69 |, none t|o. wri|
|00000880| 74 65 20 69 74 20 62 61 | 63 6b 0a 32 3a 20 5b 41 |te it ba|ck.2: [A|
|00000890| 73 20 6c 6f 6e 67 20 61 | 73 20 79 6f 75 20 61 72 |s long a|s you ar|
|000008a0| 65 6e 27 74 20 74 72 79 | 69 6e 67 20 74 6f 20 72 |en't try|ing to r|
|000008b0| 65 61 64 20 74 68 65 20 | 63 6f 75 6e 74 65 72 20 |ead the |counter |
|000008c0| 75 6e 64 65 72 20 69 6e | 74 65 72 72 75 70 74 73 |under in|terrupts|
|000008d0| 5d 20 79 6f 75 20 63 61 | 6e 27 74 0a 20 20 20 61 |] you ca|n't. a|
|000008e0| 63 63 69 64 65 6e 74 61 | 6c 6c 79 20 72 65 61 64 |ccidenta|lly read|
|000008f0| 20 74 68 65 20 73 61 6d | 65 20 76 61 6c 75 65 20 | the sam|e value |
|00000900| 74 77 69 63 65 2e 0a 20 | 20 20 55 73 69 6e 67 20 |twice.. | Using |
|00000910| 61 20 63 6f 6e 76 65 6e | 74 69 6f 6e 61 6c 20 76 |a conven|tional v|
|00000920| 61 72 69 61 62 6c 65 2c | 20 74 77 6f 20 70 72 6f |ariable,| two pro|
|00000930| 67 72 61 6d 73 20 72 75 | 6e 6e 69 6e 67 20 69 6e |grams ru|nning in|
|00000940| 20 74 61 73 6b 20 77 69 | 6e 64 6f 77 73 20 63 61 | task wi|ndows ca|
|00000950| 6e 2c 20 69 66 0a 20 20 | 20 6f 6e 65 20 69 73 20 |n, if. | one is |
|00000960| 75 6e 6c 75 63 6b 79 20 | 65 6e 6f 75 67 68 20 74 |unlucky |enough t|
|00000970| 6f 20 72 65 61 64 20 74 | 68 65 20 76 61 6c 75 65 |o read t|he value|
|00000980| 20 6a 75 73 74 20 61 66 | 74 65 72 20 61 20 73 65 | just af|ter a se|
|00000990| 63 6f 6e 64 20 70 72 6f | 67 72 61 6d 20 68 61 73 |cond pro|gram has|
|000009a0| 20 72 65 61 64 0a 20 20 | 20 69 74 2c 20 62 75 74 | read. | it, but|
|000009b0| 20 6a 75 73 74 20 62 65 | 66 6f 72 65 20 74 68 65 | just be|fore the|
|000009c0| 20 73 65 63 6f 6e 64 20 | 70 72 6f 67 72 61 6d 20 | second |program |
|000009d0| 77 72 69 74 65 73 20 62 | 61 63 6b 20 74 68 65 20 |writes b|ack the |
|000009e0| 69 6e 63 72 65 6d 65 6e | 74 65 64 20 76 61 6c 75 |incremen|ted valu|
|000009f0| 65 2e 0a 0a 43 75 72 72 | 65 6e 74 6c 79 20 79 6f |e...Curr|ently yo|
|00000a00| 75 20 63 61 6e 20 77 72 | 69 74 65 20 62 61 63 6b |u can wr|ite back|
|00000a10| 20 74 6f 20 74 68 65 20 | 76 61 72 69 61 62 6c 65 | to the |variable|
|00000a20| 20 74 6f 20 73 65 74 20 | 74 68 65 20 63 6f 75 6e | to set |the coun|
|00000a30| 74 65 72 20 74 6f 20 74 | 68 61 74 20 76 61 6c 75 |ter to t|hat valu|
|00000a40| 65 20 2d 20 49 27 6d 20 | 6e 6f 74 20 73 75 72 65 |e - I'm |not sure|
|00000a50| 20 69 66 20 74 68 69 73 | 20 69 73 20 61 20 67 6f | if this| is a go|
|00000a60| 6f 64 20 74 68 69 6e 67 | 2c 20 62 75 74 20 69 74 |od thing|, but it|
|00000a70| 20 64 6f 65 73 20 61 6c | 6c 6f 77 20 70 72 6f 67 | does al|low prog|
|00000a80| 72 61 6d 73 20 74 68 61 | 74 20 61 72 65 20 6e 6f |rams tha|t are no|
|00000a90| 74 20 61 77 61 72 65 20 | 6f 66 20 74 68 65 20 61 |t aware |of the a|
|00000aa0| 75 74 6f 2d 69 6e 63 72 | 65 6d 65 6e 74 20 74 6f |uto-incr|ement to|
|00000ab0| 20 74 72 65 61 74 20 74 | 68 69 73 20 76 61 72 69 | treat t|his vari|
|00000ac0| 61 62 6c 65 20 61 73 20 | 69 66 20 69 74 20 77 65 |able as |if it we|
|00000ad0| 72 65 20 6e 6f 74 68 69 | 6e 67 20 73 70 65 63 69 |re nothi|ng speci|
|00000ae0| 61 6c 2e 0a 0a 48 6f 70 | 65 66 75 6c 6c 79 20 74 |al...Hop|efully t|
|00000af0| 68 65 20 73 6f 75 72 63 | 65 20 73 65 72 76 65 73 |he sourc|e serves|
|00000b00| 20 61 73 20 61 6e 20 65 | 78 61 6d 70 6c 65 20 6f | as an e|xample o|
|00000b10| 66 20 68 6f 77 20 74 6f | 20 77 72 69 74 65 20 61 |f how to| write a|
|00000b20| 20 74 72 61 6e 73 69 65 | 6e 74 20 75 74 69 6c 69 | transie|nt utili|
|00000b30| 74 79 2c 20 61 6e 64 20 | 68 6f 77 20 74 6f 20 77 |ty, and |how to w|
|00000b40| 72 69 74 65 20 61 20 63 | 6f 64 65 20 76 61 72 69 |rite a c|ode vari|
|00000b50| 61 62 6c 65 2e 0a 0a 49 | 20 77 6f 75 6c 64 20 70 |able...I| would p|
|00000b60| 72 65 66 65 72 20 69 74 | 20 69 74 20 69 66 20 79 |refer it| it if y|
|00000b70| 6f 75 20 64 69 73 74 72 | 69 62 75 74 65 20 74 68 |ou distr|ibute th|
|00000b80| 65 20 73 6f 75 72 63 65 | 20 77 69 74 68 20 74 68 |e source| with th|
|00000b90| 65 20 65 78 65 63 75 74 | 61 62 6c 65 0a 46 65 65 |e execut|able.Fee|
|00000ba0| 6c 20 66 72 65 65 20 74 | 6f 20 75 73 65 20 74 68 |l free t|o use th|
|00000bb0| 69 73 20 69 6e 20 61 6e | 79 74 68 69 6e 67 20 66 |is in an|ything f|
|00000bc0| 72 65 65 2e 20 46 65 65 | 6c 20 66 72 65 65 20 74 |ree. Fee|l free t|
|00000bd0| 6f 20 6d 6f 64 69 66 79 | 2f 69 6d 70 72 6f 76 65 |o modify|/improve|
|00000be0| 20 69 74 2e 0a 46 65 65 | 6c 20 6f 62 6c 69 67 65 | it..Fee|l oblige|
|00000bf0| 64 20 74 6f 20 73 65 6e | 64 20 6d 65 20 61 6e 79 |d to sen|d me any|
|00000c00| 20 62 75 67 20 66 69 78 | 65 73 20 61 74 20 3c 6e | bug fix|es at <n|
|00000c10| 69 63 6b 63 40 64 6f 6e | 65 2e 6e 65 74 3e 46 69 |ickc@don|e.net>Fi|
|00000c20| 6c 65 44 61 74 61 82 43 | 6f 75 6e 74 65 72 53 72 |leData.C|ounterSr|
|00000c30| 63 00 a9 0f 00 00 47 fb | ff ff 03 ee 2c 64 03 00 |c.....G.|....,d..|
|00000c40| b2 18 0d 00 0a 11 f4 20 | 3e 43 6f 75 6e 74 65 72 |....... |>Counter|
|00000c50| 53 72 63 0d 00 14 25 f4 | 20 a9 20 43 6f 70 79 72 |Src...%.| . Copyr|
|00000c60| 69 67 68 74 20 4e 69 63 | 68 6f 6c 61 73 20 43 6c |ight Nic|holas Cl|
|00000c70| 61 72 6b 20 31 39 39 37 | 0d 00 1e 34 f4 20 42 61 |ark 1997|...4. Ba|
|00000c80| 73 65 64 20 6f 6e 20 74 | 68 65 20 63 6f 64 65 20 |sed on t|he code |
|00000c90| 76 61 72 69 61 62 6c 65 | 20 65 78 61 6d 70 6c 65 |variable| example|
|00000ca0| 20 69 6e 20 74 68 65 20 | 50 52 4d 2e 0d 00 28 4b | in the |PRM...(K|
|00000cb0| f4 20 49 20 77 6f 75 6c | 64 20 70 72 65 66 65 72 |. I woul|d prefer|
|00000cc0| 20 69 74 20 69 74 20 69 | 66 20 79 6f 75 20 64 69 | it it i|f you di|
|00000cd0| 73 74 72 69 62 75 74 65 | 20 74 68 65 20 73 6f 75 |stribute| the sou|
|00000ce0| 72 63 65 20 77 69 74 68 | 20 74 68 65 20 65 78 65 |rce with| the exe|
|00000cf0| 63 75 74 61 62 6c 65 0d | 00 32 4d f4 20 46 65 65 |cutable.|.2M. Fee|
|00000d00| 6c 20 66 72 65 65 20 74 | 6f 20 75 73 65 20 74 68 |l free t|o use th|
|00000d10| 69 73 20 69 6e 20 61 6e | 79 74 68 69 6e 67 20 66 |is in an|ything f|
|00000d20| 72 65 65 2e 20 46 65 65 | 6c 20 66 72 65 65 20 74 |ree. Fee|l free t|
|00000d30| 6f 20 6d 6f 64 69 66 79 | 2f 69 6d 70 72 6f 76 65 |o modify|/improve|
|00000d40| 20 69 74 2e 0d 00 3c 3f | f4 20 46 65 65 6c 20 6f | it...<?|. Feel o|
|00000d50| 62 6c 69 67 65 64 20 74 | 6f 20 73 65 6e 64 20 6d |bliged t|o send m|
|00000d60| 65 20 61 6e 79 20 62 75 | 67 20 66 69 78 65 73 20 |e any bu|g fixes |
|00000d70| 61 74 20 3c 6e 69 63 6b | 63 40 64 6f 6e 65 2e 6e |at <nick|c@done.n|
|00000d80| 65 74 3e 0d 00 46 05 3a | 0d 00 50 0c 68 65 78 25 |et>..F.:|..P.hex%|
|00000d90| 20 3d 20 b9 0d 00 5a 36 | f4 20 54 72 75 65 20 74 | = ...Z6|. True t|
|00000da0| 6f 20 63 6f 75 6e 74 20 | 69 6e 20 68 65 78 2c 20 |o count |in hex, |
|00000db0| 66 61 6c 73 65 20 74 6f | 20 63 6f 75 6e 74 20 69 |false to| count i|
|00000dc0| 6e 20 64 65 63 69 6d 61 | 6c 2e 0d 00 64 05 3a 0d |n decima|l...d.:.|
|00000dd0| 00 6e 0a f2 61 73 73 65 | 6d 0d 00 78 15 de 20 43 |.n..asse|m..x.. C|
|00000de0| 25 20 31 30 32 34 2c 20 | 42 25 20 32 35 36 0d 00 |% 1024, |B% 256..|
|00000df0| 82 11 76 61 72 24 20 3d | 20 22 6d 6f 6f 66 22 0d |..var$ =| "moof".|
|00000e00| 00 8c 15 24 42 25 20 3d | 20 76 61 72 24 20 2b 20 |...$B% =| var$ + |
|00000e10| 22 20 39 22 0d 00 96 0f | d6 20 70 72 65 5f 73 74 |" 9"....|. pre_st|
|00000e20| 61 72 74 0d 00 a0 14 ff | 20 22 53 68 6f 77 20 22 |art.....| "Show "|
|00000e30| 20 2b 20 76 61 72 24 0d | 00 aa 14 ff 20 22 53 68 | + var$.|.... "Sh|
|00000e40| 6f 77 20 22 20 2b 20 76 | 61 72 24 0d 00 b4 2d f4 |ow " + v|ar$...-.|
|00000e50| 20 4d 6f 6f 66 20 69 73 | 20 61 20 72 65 67 69 73 | Moof is| a regis|
|00000e60| 74 65 72 65 64 20 74 72 | 61 64 6d 61 72 6b 20 6f |tered tr|admark o|
|00000e70| 66 20 41 70 70 6c 65 2e | 0d 00 be 3a f4 20 28 77 |f Apple.|...:. (w|
|00000e80| 68 69 63 68 20 69 73 20 | 6f 6e 65 20 75 70 20 6f |hich is |one up o|
|00000e90| 6e 20 4d 24 2c 20 77 68 | 6f 20 68 61 76 65 6e 27 |n M$, wh|o haven'|
|00000ea0| 74 20 28 79 65 74 29 20 | 72 65 67 69 73 74 65 72 |t (yet) |register|
|00000eb0| 65 64 0d 00 c8 26 f4 20 | 22 57 68 65 72 65 20 64 |ed...&. |"Where d|
|00000ec0| 6f 20 79 6f 75 20 77 61 | 6e 74 20 74 6f 20 67 6f |o you wa|nt to go|
|00000ed0| 20 74 6f 64 61 79 22 29 | 0d 00 d2 04 0d 00 dc 2a | today")|.......*|
|00000ee0| 21 76 61 6c 75 65 20 3d | 20 30 20 3a 20 f4 20 52 |!value =| 0 : . R|
|00000ef0| 65 73 65 74 20 74 68 65 | 20 64 65 66 61 75 6c 74 |eset the| default|
|00000f00| 20 76 61 6c 75 65 0d 00 | e6 04 0d 00 f0 06 2a 2e | value..|......*.|
|00000f10| 0d 00 fa 13 e8 20 22 53 | 61 76 65 20 61 73 3a 20 |..... "S|ave as: |
|00000f20| 22 61 24 0d 01 04 30 e7 | 20 61 24 3c 3e 22 22 20 |"a$...0.| a$<>"" |
|00000f30| c8 99 20 22 4f 53 5f 46 | 69 6c 65 22 2c 26 30 41 |.. "OS_F|ile",&0A|
|00000f40| 2c 61 24 2c 26 46 46 43 | 2c 2c 73 74 61 72 74 2c |,a$,&FFC|,,start,|
|00000f50| 65 6e 64 0d 01 0e 05 e0 | 0d 01 18 04 0d 01 22 0a |end.....|......".|
|00000f60| f2 61 73 73 65 6d 0d 01 | 2c 05 e0 0d 01 36 05 3a |.assem..|,....6.:|
|00000f70| 0d 01 40 0c dd 20 f2 61 | 73 73 65 6d 0d 01 4a 13 |..@.. .a|ssem..J.|
|00000f80| 63 6f 64 65 6c 65 6e 25 | 20 3d 20 31 30 32 34 0d |codelen%| = 1024.|
|00000f90| 01 54 14 de 20 63 6f 64 | 65 25 20 63 6f 64 65 6c |.T.. cod|e% codel|
|00000fa0| 65 6e 25 0d 01 5e 05 3a | 0d 01 68 05 3a 0d 01 72 |en%..^.:|..h.:..r|
|00000fb0| 1d e3 20 6f 70 74 20 3d | 20 25 31 30 30 30 20 b8 |.. opt =| %1000 .|
|00000fc0| 20 25 31 30 31 30 20 88 | 20 32 0d 01 7c 05 3a 0d | %1010 .| 2..|.:.|
|00000fd0| 01 86 0c 50 25 3d 63 6f | 64 65 25 0d 01 90 16 4c |...P%=co|de%....L|
|00000fe0| 25 20 3d 20 50 25 20 2b | 20 63 6f 64 65 6c 65 6e |% = P% +| codelen|
|00000ff0| 25 0d 01 9a 05 3a 0d 01 | a4 0c 5b 4f 50 54 20 6f |%....:..|..[OPT o|
|00001000| 70 74 0d 01 ae 0e 2e 70 | 72 65 5f 73 74 61 72 74 |pt.....p|re_start|
|00001010| 0d 01 b8 4f 4d 4f 56 20 | 20 20 20 20 52 31 32 2c |...OMOV | R12,|
|00001020| 20 52 32 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | R2 | |
|00001030| 3b 20 50 72 65 74 65 6e | 64 20 74 68 61 74 20 77 |; Preten|d that w|
|00001040| 65 20 68 61 76 65 20 62 | 65 65 6e 20 63 61 6c 6c |e have b|een call|
|00001050| 65 64 20 61 73 20 61 20 | 75 74 69 6c 69 74 79 0d |ed as a |utility.|
|00001060| 01 c2 0a 2e 73 74 61 72 | 74 0d 01 cc 35 53 54 4d |....star|t...5STM|
|00001070| 46 44 20 20 20 52 31 33 | 21 2c 20 7b 52 32 2d 52 |FD R13|!, {R2-R|
|00001080| 34 2c 52 31 34 7d 20 20 | 20 3b 20 53 61 76 65 20 |4,R14} | ; Save |
|00001090| 72 65 74 75 72 6e 20 61 | 64 64 72 65 73 73 0d 01 |return a|ddress..|
|000010a0| d6 54 3b 20 44 6f 6e 27 | 74 20 6b 6e 6f 77 20 69 |.T; Don'|t know i|
|000010b0| 66 20 77 65 20 6e 65 65 | 64 20 74 6f 20 70 72 65 |f we nee|d to pre|
|000010c0| 73 65 72 76 65 20 72 65 | 67 69 73 74 65 72 73 2c |serve re|gisters,|
|000010d0| 20 73 6f 20 65 72 72 20 | 6e 65 61 72 20 74 68 65 | so err |near the|
|000010e0| 20 73 69 64 65 20 6f 66 | 20 63 61 75 74 69 6f 6e | side of| caution|
|000010f0| 2e 2e 0d 01 e0 1d 41 44 | 52 20 20 20 20 20 52 30 |......AD|R R0|
|00001100| 2c 20 73 79 6e 74 61 78 | 5f 73 74 72 69 6e 67 0d |, syntax|_string.|
|00001110| 01 ea 33 4d 4f 56 20 20 | 20 20 20 52 32 2c 20 52 |..3MOV | R2, R|
|00001120| 31 32 20 20 20 20 20 20 | 20 20 20 20 20 20 20 3b |12 | ;|
|00001130| 20 42 75 66 66 65 72 20 | 66 6f 72 20 6f 75 74 70 | Buffer |for outp|
|00001140| 75 74 0d 01 f4 38 4d 4f | 56 20 20 20 20 20 52 33 |ut...8MO|V R3|
|00001150| 2c 20 23 36 34 30 20 20 | 20 20 20 20 20 20 20 20 |, #640 | |
|00001160| 20 20 3b 20 4d 6f 72 65 | 20 6c 69 6b 65 20 31 30 | ; More| like 10|
|00001170| 32 34 20 2d 20 73 74 61 | 63 6b 0d 01 fe 4a 53 57 |24 - sta|ck...JSW|
|00001180| 49 20 20 20 20 20 22 58 | 4f 53 5f 52 65 61 64 41 |I "X|OS_ReadA|
|00001190| 72 67 73 22 20 20 20 20 | 20 20 3b 20 52 31 20 28 |rgs" | ; R1 (|
|000011a0| 63 6f 6d 6d 61 6e 64 20 | 74 61 69 6c 29 20 69 73 |command |tail) is|
|000011b0| 20 69 6e 20 74 68 65 20 | 72 69 67 68 74 20 70 6c | in the |right pl|
|000011c0| 61 63 65 2e 0d 02 08 52 | 20 20 20 20 20 20 20 20 |ace....R| |
|000011d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000011e0| 20 20 20 20 3b 20 54 68 | 69 6e 67 73 20 6c 69 6b | ; Th|ings lik|
|000011f0| 65 20 74 68 69 73 20 6d | 61 6b 65 20 79 6f 75 20 |e this m|ake you |
|00001200| 74 68 69 6e 6b 20 74 68 | 61 74 20 79 6f 75 72 20 |think th|at your |
|00001210| 4f 53 20 77 61 73 0d 02 | 12 2c 20 20 20 20 20 20 |OS was..|., |
|00001220| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001230| 20 20 20 20 20 20 3b 20 | 2a 64 65 73 69 67 6e 65 | ; |*designe|
|00001240| 64 2a 0d 02 1c 04 0d 02 | 26 33 4c 44 4d 56 53 46 |d*......|&3LDMVSF|
|00001250| 44 20 52 31 33 21 2c 20 | 7b 52 32 2d 52 34 2c 50 |D R13!, |{R2-R4,P|
|00001260| 43 7d 20 20 20 20 3b 20 | 42 61 69 6c 20 6f 75 74 |C} ; |Bail out|
|00001270| 20 69 66 20 65 72 72 6f | 72 0d 02 30 04 0d 02 3a | if erro|r..0...:|
|00001280| 26 3b 20 57 65 20 61 72 | 65 6e 27 74 20 69 6e 20 |&; We ar|en't in |
|00001290| 72 65 61 64 20 6f 6e 6c | 79 20 6d 65 6d 6f 72 79 |read onl|y memory|
|000012a0| 2e 2e 2e 0d 02 44 04 0d | 02 4e 18 4c 44 4d 49 41 |.....D..|.N.LDMIA|
|000012b0| 20 20 20 52 31 32 2c 20 | 7b 52 30 2c 52 31 7d 0d | R12, |{R0,R1}.|
|000012c0| 02 58 54 54 45 51 20 20 | 20 20 20 52 31 2c 20 23 |.XTTEQ | R1, #|
|000012d0| 30 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 3b |0 | ;|
|000012e0| 20 49 66 20 74 68 65 72 | 65 20 69 73 20 61 20 76 | If ther|e is a v|
|000012f0| 61 6c 75 65 20 74 6f 20 | 75 73 65 20 74 6f 20 69 |alue to |use to i|
|00001300| 6e 69 74 69 61 6c 69 73 | 65 20 74 68 69 73 20 77 |nitialis|e this w|
|00001310| 69 6c 6c 0d 02 62 2d 20 | 20 20 20 20 20 20 20 20 |ill..b- | |
|00001320| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001330| 20 20 20 3b 20 70 6f 69 | 6e 74 20 74 6f 20 69 74 | ; poi|nt to it|
|00001340| 0d 02 6c 04 0d 02 76 3b | 42 4c 4e 45 20 20 20 20 |..l...v;|BLNE |
|00001350| 77 72 69 74 65 5f 63 6f | 64 65 20 20 20 20 20 20 |write_co|de |
|00001360| 20 20 20 20 3b 20 48 61 | 63 6b 20 74 68 69 6e 67 | ; Ha|ck thing|
|00001370| 73 20 69 6e 20 70 6c 61 | 63 65 2e 20 38 2d 29 0d |s in pla|ce. 8-).|
|00001380| 02 80 53 3b 20 5b 4f 4b | 20 2d 20 74 68 65 20 66 |..S; [OK| - the f|
|00001390| 6f 72 6d 61 6c 20 65 6e | 74 79 20 70 61 72 61 6d |ormal en|ty param|
|000013a0| 65 74 65 72 73 20 74 6f | 20 77 72 69 74 65 20 76 |eters to| write v|
|000013b0| 61 6c 75 65 20 61 72 65 | 20 52 31 20 2d 3e 20 76 |alue are| R1 -> v|
|000013c0| 61 6c 75 65 2c 20 52 32 | 20 3d 20 6c 65 6e 67 74 |alue, R2| = lengt|
|000013d0| 68 2c 0d 02 8a 46 3b 20 | 20 62 75 74 20 49 20 63 |h,...F; | but I c|
|000013e0| 61 6e 20 73 65 65 20 74 | 68 65 20 63 6f 64 65 20 |an see t|he code |
|000013f0| 69 6e 20 71 75 65 73 74 | 69 6f 6e 20 6a 75 73 74 |in quest|ion just|
|00001400| 20 62 65 6c 6f 77 2c 20 | 61 6e 64 20 69 74 20 69 | below, |and it i|
|00001410| 73 20 68 61 70 70 79 5d | 0d 02 94 04 0d 02 9e 27 |s happy]|.......'|
|00001420| 3b 20 52 30 20 63 6f 6e | 74 61 69 6e 73 20 61 20 |; R0 con|tains a |
|00001430| 70 6f 69 6e 74 65 72 20 | 74 6f 20 74 68 65 20 6e |pointer |to the n|
|00001440| 61 6d 65 0d 02 a8 34 41 | 44 52 20 20 20 20 20 52 |ame...4A|DR R|
|00001450| 31 2c 20 63 6f 64 65 20 | 20 20 20 20 20 20 20 20 |1, code | |
|00001460| 20 20 20 3b 20 53 74 61 | 72 74 20 6f 66 20 63 6f | ; Sta|rt of co|
|00001470| 64 65 20 62 6f 64 79 0d | 02 b2 28 4d 4f 56 20 20 |de body.|..(MOV |
|00001480| 20 20 20 52 32 2c 20 23 | 65 6e 64 5f 63 6f 64 65 | R2, #|end_code|
|00001490| 2d 63 6f 64 65 20 20 3b | 20 4c 65 6e 67 74 68 0d |-code ;| Length.|
|000014a0| 02 bc 31 4d 4f 56 20 20 | 20 20 20 52 33 2c 20 23 |..1MOV | R3, #|
|000014b0| 30 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 3b |0 | ;|
|000014c0| 20 43 6f 6e 74 65 78 74 | 20 70 6f 69 6e 74 65 72 | Context| pointer|
|000014d0| 0d 02 c6 30 4d 4f 56 20 | 20 20 20 20 52 34 2c 20 |...0MOV | R4, |
|000014e0| 23 26 31 30 20 20 20 20 | 20 20 20 20 20 20 20 20 |#&10 | |
|000014f0| 3b 20 27 53 70 65 63 69 | 61 6c 27 20 74 79 70 65 |; 'Speci|al' type|
|00001500| 0d 02 d0 2b 53 57 49 20 | 20 20 20 20 22 58 4f 53 |...+SWI | "XOS|
|00001510| 5f 53 65 74 56 61 72 56 | 61 6c 22 20 20 20 20 20 |_SetVarV|al" |
|00001520| 3b 20 43 72 65 61 74 65 | 20 69 74 0d 02 da 1c 4c |; Create| it....L|
|00001530| 44 4d 46 44 20 20 20 52 | 31 33 21 2c 20 7b 52 32 |DMFD R|13!, {R2|
|00001540| 2d 52 34 2c 50 43 7d 0d | 02 e4 09 2e 63 6f 64 65 |-R4,PC}.|....code|
|00001550| 0d 02 ee 36 42 20 20 20 | 20 20 20 20 77 72 69 74 |...6B | writ|
|00001560| 65 5f 63 6f 64 65 20 20 | 20 20 20 20 20 20 20 20 |e_code | |
|00001570| 3b 20 42 72 61 6e 63 68 | 20 74 6f 20 77 72 69 74 |; Branch| to writ|
|00001580| 65 20 63 6f 64 65 0d 02 | f8 20 2e 72 65 61 64 5f |e code..|. .read_|
|00001590| 63 6f 64 65 20 20 20 20 | 20 20 20 20 20 20 20 20 |code | |
|000015a0| 20 20 20 20 20 20 0d 03 | 02 35 53 54 4d 46 44 20 | ..|.5STMFD |
|000015b0| 20 20 52 31 33 21 2c 20 | 7b 52 33 2c 52 31 34 7d | R13!, |{R3,R14}|
|000015c0| 20 20 20 20 20 20 3b 20 | 53 61 76 65 20 72 65 74 | ; |Save ret|
|000015d0| 75 72 6e 20 61 64 64 72 | 65 73 73 0d 03 0c 04 0d |urn addr|ess.....|
|000015e0| 03 16 34 4c 44 52 20 20 | 20 20 20 52 30 2c 20 76 |..4LDR | R0, v|
|000015f0| 61 6c 75 65 20 20 20 20 | 20 20 20 20 20 20 20 3b |alue | ;|
|00001600| 20 47 65 74 20 70 72 65 | 76 69 6f 75 73 20 76 61 | Get pre|vious va|
|00001610| 6c 75 65 0d 03 20 48 41 | 44 44 20 20 20 20 20 52 |lue.. HA|DD R|
|00001620| 33 2c 20 52 30 2c 20 23 | 31 20 20 20 20 20 20 20 |3, R0, #|1 |
|00001630| 20 20 20 3b 20 41 75 74 | 6f 2d 69 6e 63 72 65 61 | ; Aut|o-increa|
|00001640| 73 65 20 69 74 20 28 62 | 75 74 20 64 69 73 70 6c |se it (b|ut displ|
|00001650| 61 79 20 6f 72 69 67 69 | 6e 61 6c 0d 03 2a 2f 53 |ay origi|nal..*/S|
|00001660| 54 52 20 20 20 20 20 52 | 33 2c 20 76 61 6c 75 65 |TR R|3, value|
|00001670| 20 20 20 20 20 20 20 20 | 20 20 20 3b 20 57 72 69 | | ; Wri|
|00001680| 74 65 20 69 74 20 62 61 | 63 6b 0d 03 34 04 0d 03 |te it ba|ck..4...|
|00001690| 3e 3b 41 44 52 20 20 20 | 20 20 52 31 2c 20 62 75 |>;ADR | R1, bu|
|000016a0| 66 66 65 72 20 20 20 20 | 20 20 20 20 20 20 3b 20 |ffer | ; |
|000016b0| 42 75 66 66 65 72 20 66 | 6f 72 20 97 49 49 20 63 |Buffer f|or .II c|
|000016c0| 6f 6e 76 65 72 73 69 6f | 6e 0d 03 48 33 4d 4f 56 |onversio|n..H3MOV|
|000016d0| 20 20 20 20 20 52 32 2c | 20 23 31 32 20 20 20 20 | R2,| #12 |
|000016e0| 20 20 20 20 20 20 20 20 | 20 3b 20 4d 61 78 20 6c | | ; Max l|
|000016f0| 65 6e 20 6f 66 20 62 75 | 66 66 65 72 0d 03 52 05 |en of bu|ffer..R.|
|00001700| 5d 0d 03 5c 04 0d 03 66 | 0c e7 20 68 65 78 25 20 |]..\...f|.. hex% |
|00001710| 8c 0d 03 70 0c 5b 4f 50 | 54 20 6f 70 74 0d 03 7a |...p.[OP|T opt..z|
|00001720| 1d 53 57 49 20 20 20 20 | 20 22 58 4f 53 5f 43 6f |.SWI | "XOS_Co|
|00001730| 6e 76 65 72 74 48 65 78 | 38 22 0d 03 84 40 52 53 |nvertHex|8"...@RS|
|00001740| 42 56 43 20 20 20 52 32 | 2c 20 52 32 2c 20 23 31 |BVC R2|, R2, #1|
|00001750| 32 20 20 20 20 20 20 20 | 20 20 3b 20 43 6f 6e 76 |2 | ; Conv|
|00001760| 65 72 74 20 27 62 79 74 | 65 73 20 6c 65 66 74 27 |ert 'byt|es left'|
|00001770| 20 74 6f 20 6c 65 6e 67 | 74 68 0d 03 8e 05 5d 0d | to leng|th....].|
|00001780| 03 98 05 cc 0d 03 a2 0c | 5b 4f 50 54 20 6f 70 74 |........|[OPT opt|
|00001790| 0d 03 ac 21 53 57 49 20 | 20 20 20 20 22 58 4f 53 |...!SWI | "XOS|
|000017a0| 5f 42 69 6e 61 72 79 54 | 6f 44 65 63 69 6d 61 6c |_BinaryT|oDecimal|
|000017b0| 22 0d 03 b6 2f 4d 4f 56 | 56 43 20 20 20 52 30 2c |".../MOV|VC R0,|
|000017c0| 20 52 31 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | R1 | |
|000017d0| 20 3b 20 50 6f 69 6e 74 | 65 72 20 69 6e 20 52 30 | ; Point|er in R0|
|000017e0| 0d 03 c0 05 5d 0d 03 ca | 05 cd 0d 03 d4 04 0d 03 |....]...|........|
|000017f0| de 0c 5b 4f 50 54 20 6f | 70 74 0d 03 e8 28 4c 44 |..[OPT o|pt...(LD|
|00001800| 4d 46 44 20 52 31 33 21 | 2c 20 7b 52 33 2c 50 43 |MFD R13!|, {R3,PC|
|00001810| 7d 20 20 20 20 20 20 20 | 20 20 3b 20 52 65 74 75 |} | ; Retu|
|00001820| 72 6e 0d 03 f2 04 0d 03 | fc 0f 2e 77 72 69 74 65 |rn......|...write|
|00001830| 5f 63 6f 64 65 0d 04 06 | 35 53 54 4d 46 44 20 20 |_code...|5STMFD |
|00001840| 20 52 31 33 21 2c 20 7b | 52 30 2c 20 52 31 34 7d | R13!, {|R0, R14}|
|00001850| 20 20 20 20 20 3b 20 53 | 61 76 65 20 72 65 74 75 | ; S|ave retu|
|00001860| 72 6e 20 61 64 64 72 65 | 73 73 0d 04 10 05 5d 0d |rn addre|ss....].|
|00001870| 04 1a 04 0d 04 24 0c e7 | 20 68 65 78 25 20 8c 0d |.....$..| hex% ..|
|00001880| 04 2e 0c 5b 4f 50 54 20 | 6f 70 74 0d 04 38 34 4d |...[OPT |opt..84M|
|00001890| 4f 56 20 20 20 20 20 52 | 30 2c 20 23 31 36 20 20 |OV R|0, #16 |
|000018a0| 20 20 20 20 20 20 20 20 | 20 20 20 3b 20 42 61 73 | | ; Bas|
|000018b0| 65 20 31 36 20 62 79 20 | 64 65 66 61 75 6c 74 0d |e 16 by |default.|
|000018c0| 04 42 05 5d 0d 04 4c 05 | cc 0d 04 56 0c 5b 4f 50 |.B.]..L.|...V.[OP|
|000018d0| 54 20 6f 70 74 0d 04 60 | 34 4d 4f 56 20 20 20 20 |T opt..`|4MOV |
|000018e0| 20 52 30 2c 20 23 31 30 | 20 20 20 20 20 20 20 20 | R0, #10| |
|000018f0| 20 20 20 20 20 3b 20 42 | 61 73 65 20 31 30 20 62 | ; B|ase 10 b|
|00001900| 79 20 64 65 66 61 75 6c | 74 0d 04 6a 05 5d 0d 04 |y defaul|t..j.]..|
|00001910| 74 05 cd 0d 04 7e 04 0d | 04 88 0c 5b 4f 50 54 20 |t....~..|...[OPT |
|00001920| 6f 70 74 0d 04 92 3a 53 | 57 49 20 20 20 20 20 22 |opt...:S|WI "|
|00001930| 58 4f 53 5f 52 65 61 64 | 55 6e 73 69 67 6e 65 64 |XOS_Read|Unsigned|
|00001940| 22 20 20 3b 20 52 31 20 | 73 65 74 20 63 6f 72 72 |" ; R1 |set corr|
|00001950| 65 63 74 6c 79 20 61 6c | 72 65 61 64 79 0d 04 9c |ectly al|ready...|
|00001960| 31 53 54 52 56 43 20 20 | 20 52 32 2c 20 76 61 6c |1STRVC | R2, val|
|00001970| 75 65 20 20 20 20 20 20 | 20 20 20 20 20 3b 20 57 |ue | ; W|
|00001980| 72 69 74 65 20 74 68 65 | 20 76 61 6c 75 65 0d 04 |rite the| value..|
|00001990| a6 28 4c 44 4d 56 43 46 | 44 20 52 31 33 21 2c 20 |.(LDMVCF|D R13!, |
|000019a0| 7b 52 30 2c 20 50 43 7d | 20 20 20 20 20 20 3b 20 |{R0, PC}| ; |
|000019b0| 52 65 74 75 72 6e 0d 04 | a7 37 4c 44 4d 46 44 20 |Return..|.7LDMFD |
|000019c0| 20 20 52 31 33 21 2c 20 | 7b 52 34 2c 20 50 43 7d | R13!, |{R4, PC}|
|000019d0| 20 20 20 20 20 20 3b 20 | 52 65 74 75 72 6e 2c 20 | ; |Return, |
|000019e0| 70 72 65 73 65 72 76 69 | 6e 67 20 52 30 0d 04 b0 |preservi|ng R0...|
|000019f0| 04 0d 04 ba 0a 2e 76 61 | 6c 75 65 0d 04 c4 0d 45 |......va|lue....E|
|00001a00| 51 55 44 20 20 20 20 30 | 0d 04 ce 04 0d 04 d8 0b |QUD 0|........|
|00001a10| 2e 62 75 66 66 65 72 0d | 04 e2 12 2e 73 79 6e 74 |.buffer.|....synt|
|00001a20| 61 78 5f 73 74 72 69 6e | 67 0d 04 ec 3f 45 51 55 |ax_strin|g...?EQU|
|00001a30| 53 20 20 20 20 22 76 61 | 72 2f 61 2c 76 61 6c 75 |S "va|r/a,valu|
|00001a40| 65 22 20 20 20 20 20 20 | 20 3b 20 53 79 6e 74 61 |e" | ; Synta|
|00001a50| 78 20 73 74 72 69 6e 67 | 20 66 6f 72 20 4f 53 5f |x string| for OS_|
|00001a60| 52 65 61 64 41 72 67 73 | 0d 04 f6 4c 45 51 55 42 |ReadArgs|...LEQUB|
|00001a70| 20 20 20 20 30 20 20 20 | 20 20 20 20 20 20 20 20 | 0 | |
|00001a80| 20 20 20 20 20 20 20 20 | 3b 20 64 6f 75 62 6c 65 | |; double|
|00001a90| 73 20 75 70 20 61 73 20 | 62 75 66 66 65 72 20 66 |s up as |buffer f|
|00001aa0| 6f 72 20 73 74 72 69 6e | 67 20 63 6f 6e 76 65 72 |or strin|g conver|
|00001ab0| 73 69 6f 6e 0d 05 00 50 | 3b 20 28 48 65 6e 63 65 |sion...P|; (Hence|
|00001ac0| 20 74 68 61 74 20 73 74 | 72 69 6e 67 20 6d 75 73 | that st|ring mus|
|00001ad0| 74 20 62 65 20 61 74 20 | 6c 65 61 73 74 20 31 31 |t be at |least 11|
|00001ae0| 20 63 68 61 72 73 20 70 | 6c 75 73 20 31 20 74 65 | chars p|lus 1 te|
|00001af0| 72 6d 69 6e 61 74 69 6e | 67 20 7a 65 72 6f 20 62 |rminatin|g zero b|
|00001b00| 79 74 65 2e 0d 05 0a 0d | 2e 65 6e 64 5f 63 6f 64 |yte.....|.end_cod|
|00001b10| 65 0d 05 14 54 3b 20 44 | 6f 6e 27 74 20 75 73 65 |e...T; D|on't use|
|00001b20| 20 2f 65 20 74 6f 20 65 | 76 61 6c 75 61 74 65 20 | /e to e|valuate |
|00001b30| 76 61 6c 75 65 20 61 73 | 20 69 74 20 69 73 20 6e |value as| it is n|
|00001b40| 61 73 74 79 20 61 6e 64 | 20 72 65 74 75 72 6e 73 |asty and| returns|
|00001b50| 20 61 20 70 61 72 61 6d | 65 74 65 72 20 62 6c 6f | a param|eter blo|
|00001b60| 63 6b 20 6f 66 0d 05 1e | 0e 3b 20 74 68 65 20 66 |ck of...|.; the f|
|00001b70| 6f 72 6d 0d 05 28 27 3b | 20 54 79 70 65 20 28 31 |orm..(';| Type (1|
|00001b80| 20 62 79 74 65 29 20 56 | 61 6c 75 65 20 28 34 20 | byte) V|alue (4 |
|00001b90| 62 79 74 65 73 20 69 6e | 74 29 0d 05 32 38 3b 20 |bytes in|t)..28; |
|00001ba0| 5b 48 65 6e 63 65 20 74 | 68 65 20 56 61 6c 75 65 |[Hence t|he Value|
|00001bb0| 20 69 73 20 2a 2a 6e 6f | 74 2a 2a 20 77 6f 72 64 | is **no|t** word|
|00001bc0| 20 61 6c 69 67 6e 65 64 | 2e 20 42 6c 65 75 72 67 | aligned|. Bleurg|
|00001bd0| 2e 5d 0d 05 3c 08 2e 65 | 6e 64 0d 05 46 05 5d 0d |.]..<..e|nd..F.].|
|00001be0| 05 50 05 ed 0d 05 5a 05 | e1 0d ff 46 69 6c 65 44 |.P....Z.|...FileD|
|00001bf0| 61 74 61 82 43 6f 75 6e | 74 65 72 56 61 72 00 8c |ata.Coun|terVar..|
|00001c00| 00 00 00 47 fc ff ff 7b | f6 2c 64 03 00 9c 45 1c |...G...{|.,d...E.|
|00001c10| 40 2d e9 74 00 8f e2 0c | 20 a0 e1 0a 3d a0 e3 49 |@-.t....| ...=..I|
|00001c20| 00 02 ef 1c 80 bd 68 03 | 00 9c e8 00 00 31 e3 0f |......h.|.....1..|
|00001c30| 00 00 1b 10 10 8f e2 50 | 20 a0 e3 00 30 a0 e3 10 |.......P| ...0...|
|00001c40| 40 a0 e3 24 00 02 ef 1c | 80 bd e8 08 00 00 ea 08 |@..$....|........|
|00001c50| 40 2d e9 30 00 9f e5 01 | 30 80 e2 28 30 8f e5 28 |@-.0....|0..(0..(|
|00001c60| 10 8f e2 0c 20 a0 e3 d4 | 00 02 ef 0c 20 62 72 08 |.... ...|.... br.|
|00001c70| 80 bd e8 01 40 2d e9 10 | 00 a0 e3 21 00 02 ef 04 |....@-..|...!....|
|00001c80| 20 8f 75 01 80 bd 78 10 | 80 bd e8 00 00 00 00 76 | .u...x.|.......v|
|00001c90| 61 72 2f 61 2c 76 61 6c | 75 65 00 |ar/a,val|ue. |
+--------+-------------------------+-------------------------+--------+--------+