home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: getpargs.sha
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| ext
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| POSIX shell script text executable
| default
| |
99%
| file
| assembler source text
| default (weak)
| |
98%
| file
| a /bin/sh script, ASCII text executable
| default (weak)
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| x-fmt/111 Plain Text File
| default
| |
100%
| gt2
| Shell Skript: '/bin/sh'
| default (weak)
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| binwalkID
| Executable script, shebang: "/bin/sh"
| default (weak)
| |
100%
| xdgMime
| application/x-shellscript
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 23 21 20 2f 62 69 6e 2f | 73 68 0a 3a 20 54 68 69 |#! /bin/|sh.: Thi|
|00000010| 73 20 69 73 20 61 20 73 | 68 61 72 20 61 72 63 68 |s is a s|har arch|
|00000020| 69 76 65 2e 20 20 45 78 | 74 72 61 63 74 20 77 69 |ive. Ex|tract wi|
|00000030| 74 68 20 73 68 2c 20 6e | 6f 74 20 63 73 68 2e 0a |th sh, n|ot csh..|
|00000040| 65 63 68 6f 20 78 20 2d | 20 67 65 74 70 61 72 67 |echo x -| getparg|
|00000050| 73 2e 73 0a 63 61 74 20 | 3e 20 67 65 74 70 61 72 |s.s.cat |> getpar|
|00000060| 67 73 2e 73 20 3c 3c 20 | 27 52 61 7a 7a 6c 65 21 |gs.s << |'Razzle!|
|00000070| 44 61 7a 7a 6c 65 27 0a | 7c 0a 7c 20 67 65 74 70 |Dazzle'.||.| getp|
|00000080| 61 72 67 73 20 2d 20 47 | 65 74 20 50 61 73 63 61 |args - G|et Pasca|
|00000090| 6c 20 61 72 67 75 6d 65 | 6e 74 73 20 69 6e 74 6f |l argume|nts into|
|000000a0| 20 43 20 73 75 62 72 6f | 75 74 69 6e 65 2f 66 75 | C subro|utine/fu|
|000000b0| 6e 63 74 69 6f 6e 2e 0a | 7c 0a 7c 20 49 6e 20 75 |nction..||.| In u|
|000000c0| 73 69 6e 67 20 74 68 69 | 73 20 4d 61 63 2f 43 20 |sing thi|s Mac/C |
|000000d0| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 2c 20 75 73 75 |environm|ent, usu|
|000000e0| 61 6c 6c 79 20 63 61 6c | 6c 73 20 61 72 65 20 6d |ally cal|ls are m|
|000000f0| 61 64 65 20 66 72 6f 6d | 20 43 20 70 72 6f 67 72 |ade from| C progr|
|00000100| 61 6d 73 0a 7c 20 20 69 | 6e 74 6f 20 74 68 65 20 |ams.| i|nto the |
|00000110| 50 61 73 63 61 6c 20 74 | 6f 6f 6c 62 6f 78 3b 20 |Pascal t|oolbox; |
|00000120| 20 74 68 69 73 20 61 72 | 67 75 6d 65 6e 74 20 63 | this ar|gument c|
|00000130| 6f 6e 76 65 72 73 69 6f | 6e 20 69 73 20 68 61 6e |onversio|n is han|
|00000140| 64 6c 65 64 20 61 75 74 | 6f 2d 0a 7c 20 20 6d 61 |dled aut|o-.| ma|
|00000150| 74 69 63 6c 79 2e 20 20 | 4f 6e 20 72 61 72 65 20 |ticly. |On rare |
|00000160| 6f 63 63 61 73 69 6f 6e | 73 2c 20 61 20 50 61 73 |occasion|s, a Pas|
|00000170| 63 61 6c 20 74 6f 6f 6c | 62 6f 78 20 66 75 6e 63 |cal tool|box func|
|00000180| 74 69 6f 6e 20 28 73 75 | 63 68 20 61 73 0a 7c 20 |tion (su|ch as.| |
|00000190| 20 54 72 61 63 6b 43 6f | 6e 74 72 6f 6c 29 20 77 | TrackCo|ntrol) w|
|000001a0| 61 6e 74 73 20 74 6f 20 | 63 61 6c 6c 20 61 20 43 |ants to |call a C|
|000001b0| 20 72 6f 75 74 69 6e 65 | 2e 20 20 47 65 74 70 61 | routine|. Getpa|
|000001c0| 72 67 73 20 69 73 20 75 | 73 65 64 20 69 6e 20 73 |rgs is u|sed in s|
|000001d0| 75 63 68 20 63 61 73 65 | 73 0a 7c 20 20 74 6f 20 |uch case|s.| to |
|000001e0| 6d 61 6b 65 20 74 68 65 | 20 50 61 73 63 61 6c 20 |make the| Pascal |
|000001f0| 61 72 67 75 6d 65 6e 74 | 73 20 61 63 63 65 73 73 |argument|s access|
|00000200| 61 62 6c 65 20 74 6f 20 | 43 2e 20 20 49 6e 20 61 |able to |C. In a|
|00000210| 64 64 69 74 69 6f 6e 2c | 20 67 65 74 70 61 72 67 |ddition,| getparg|
|00000220| 73 0a 7c 20 20 61 64 6a | 75 73 74 73 20 74 68 65 |s.| adj|usts the|
|00000230| 20 73 74 61 63 6b 20 66 | 6f 72 20 61 20 70 72 6f | stack f|or a pro|
|00000240| 70 65 72 20 50 61 73 63 | 61 6c 20 72 65 74 75 72 |per Pasc|al retur|
|00000250| 6e 2e 0a 7c 0a 7c 20 43 | 61 6c 6c 65 64 20 61 73 |n..|.| C|alled as|
|00000260| 20 74 68 65 20 31 73 74 | 20 6c 69 6e 65 20 6f 66 | the 1st| line of|
|00000270| 20 61 20 43 20 73 75 62 | 72 6f 75 74 69 6e 65 20 | a C sub|routine |
|00000280| 74 68 61 74 20 68 61 73 | 20 6e 6f 20 61 72 67 75 |that has| no argu|
|00000290| 6d 65 6e 74 73 3a 0a 7c | 20 20 66 75 6e 72 65 74 |ments:.|| funret|
|000002a0| 70 74 72 20 3d 20 67 65 | 74 70 61 72 67 73 28 26 |ptr = ge|tpargs(&|
|000002b0| 70 61 73 63 61 6c 61 72 | 67 73 74 72 75 63 74 2c |pascalar|gstruct,|
|000002c0| 20 73 69 7a 65 6f 66 20 | 70 61 73 63 61 6c 61 72 | sizeof |pascalar|
|000002d0| 67 73 74 72 75 63 74 29 | 3b 0a 7c 0a 7c 20 22 70 |gstruct)|;.|.| "p|
|000002e0| 61 73 63 61 6c 61 72 67 | 73 74 72 75 63 74 22 20 |ascalarg|struct" |
|000002f0| 69 73 20 61 20 73 74 72 | 75 63 74 75 72 65 20 64 |is a str|ucture d|
|00000300| 65 63 6c 61 72 65 64 20 | 6c 6f 63 61 6c 20 74 6f |eclared |local to|
|00000310| 20 74 68 65 20 43 20 73 | 75 62 72 6f 75 74 69 6e | the C s|ubroutin|
|00000320| 65 20 61 6e 64 20 69 73 | 0a 7c 20 20 66 69 6c 6c |e and is|.| fill|
|00000330| 65 64 20 69 6e 20 77 69 | 74 68 20 74 68 65 20 50 |ed in wi|th the P|
|00000340| 61 73 63 61 6c 20 61 72 | 67 75 6d 65 6e 74 73 2c |ascal ar|guments,|
|00000350| 20 69 6e 20 73 74 61 63 | 6b 20 6f 72 64 65 72 20 | in stac|k order |
|00000360| 28 72 65 76 65 72 73 65 | 64 29 20 61 6e 64 20 77 |(reverse|d) and w|
|00000370| 69 74 68 0a 7c 20 20 74 | 68 65 20 70 72 6f 70 65 |ith.| t|he prope|
|00000380| 72 20 50 61 73 63 61 6c | 20 63 61 6c 6c 69 6e 67 |r Pascal| calling|
|00000390| 20 63 6f 6e 76 65 6e 74 | 69 6f 6e 20 61 72 67 75 | convent|ion argu|
|000003a0| 6d 65 6e 74 20 74 79 70 | 65 73 2e 20 20 0a 7c 0a |ment typ|es. .|.|
|000003b0| 7c 20 22 66 75 6e 72 65 | 74 70 74 72 22 20 67 65 || "funre|tptr" ge|
|000003c0| 74 73 20 74 68 65 20 61 | 64 64 72 65 73 73 20 6f |ts the a|ddress o|
|000003d0| 66 20 74 68 65 20 50 61 | 73 63 61 6c 20 72 65 74 |f the Pa|scal ret|
|000003e0| 75 72 6e 20 76 61 6c 75 | 65 2e 20 20 54 68 69 73 |urn valu|e. This|
|000003f0| 20 69 73 20 6f 6e 6c 79 | 0a 7c 20 20 75 73 65 66 | is only|.| usef|
|00000400| 75 6c 20 69 66 20 79 6f | 75 20 61 72 65 20 62 65 |ul if yo|u are be|
|00000410| 69 6e 67 20 63 61 6c 6c | 65 64 20 61 73 20 61 20 |ing call|ed as a |
|00000420| 66 75 6e 63 74 69 6f 6e | 3b 20 20 69 66 20 79 6f |function|; if yo|
|00000430| 75 20 73 74 6f 72 65 20 | 69 6e 74 6f 20 74 68 69 |u store |into thi|
|00000440| 73 0a 7c 20 20 6c 6f 63 | 61 74 69 6f 6e 2c 20 62 |s.| loc|ation, b|
|00000450| 65 20 73 75 72 65 20 74 | 6f 20 75 73 65 20 74 68 |e sure t|o use th|
|00000460| 65 20 70 72 6f 70 65 72 | 20 65 78 70 65 63 74 65 |e proper| expecte|
|00000470| 64 20 50 61 73 63 61 6c | 20 74 79 70 65 20 26 20 |d Pascal| type & |
|00000480| 6c 65 6e 67 74 68 2e 0a | 7c 0a 7c 20 49 20 6b 6e |length..||.| I kn|
|00000490| 6f 77 20 74 68 69 73 20 | 72 65 65 6b 73 20 6f 66 |ow this |reeks of|
|000004a0| 20 6b 6c 75 64 67 65 72 | 79 3b 20 20 69 66 20 79 | kludger|y; if y|
|000004b0| 6f 75 20 66 69 6e 64 20 | 61 20 62 65 74 74 65 72 |ou find |a better|
|000004c0| 20 77 61 79 20 74 6f 20 | 64 6f 20 74 68 69 73 0a | way to |do this.|
|000004d0| 7c 20 28 73 68 6f 72 74 | 20 6f 66 20 61 6c 74 65 || (short| of alte|
|000004e0| 72 69 6e 67 20 74 68 65 | 20 43 20 6c 61 6e 67 75 |ring the| C langu|
|000004f0| 61 67 65 20 63 61 6c 6c | 69 6e 67 20 63 6f 6e 76 |age call|ing conv|
|00000500| 65 6e 74 69 6f 6e 73 20 | 74 6f 20 62 65 20 74 68 |entions |to be th|
|00000510| 61 74 20 6f 66 20 50 61 | 73 63 61 6c 29 2c 0a 7c |at of Pa|scal),.||
|00000520| 20 70 6c 65 61 73 65 20 | 6c 65 74 20 6d 65 20 6b | please |let me k|
|00000530| 6e 6f 77 2e 2e 2e 0a 7c | 0a 7c 0a 7c 20 43 6f 70 |now....||.|.| Cop|
|00000540| 79 72 69 67 68 74 20 28 | 43 29 20 31 39 38 34 2c |yright (|C) 1984,|
|00000550| 20 53 74 61 6e 66 6f 72 | 64 20 55 6e 69 76 2e 20 | Stanfor|d Univ. |
|00000560| 53 55 4d 45 58 20 70 72 | 6f 6a 65 63 74 2e 0a 7c |SUMEX pr|oject..||
|00000570| 20 4d 61 79 20 62 65 20 | 75 73 65 64 20 62 75 74 | May be |used but|
|00000580| 20 6e 6f 74 20 73 6f 6c | 64 20 77 69 74 68 6f 75 | not sol|d withou|
|00000590| 74 20 70 65 72 6d 69 73 | 73 69 6f 6e 2e 0a 7c 0a |t permis|sion..|.|
|000005a0| 7c 20 68 69 73 74 6f 72 | 79 0a 7c 20 30 35 2f 32 || histor|y.| 05/2|
|000005b0| 39 2f 38 34 09 43 72 6f | 66 74 09 43 72 65 61 74 |9/84.Cro|ft.Creat|
|000005c0| 65 64 2e 0a 7c 20 30 35 | 2f 33 30 2f 38 34 09 43 |ed..| 05|/30/84.C|
|000005d0| 72 6f 66 74 09 41 64 64 | 65 64 20 66 75 6e 72 65 |roft.Add|ed funre|
|000005e0| 74 70 74 72 20 73 74 75 | 66 66 2e 0a 7c 20 30 31 |tptr stu|ff..| 01|
|000005f0| 2f 31 30 2f 38 35 09 4d | 6f 79 09 4f 70 74 69 6d |/10/85.M|oy.Optim|
|00000600| 69 7a 65 2e 0a 7c 0a 09 | 2e 64 61 74 61 0a 09 2e |ize..|..|.data...|
|00000610| 74 65 78 74 0a 09 2e 67 | 6c 6f 62 6c 09 67 65 74 |text...g|lobl.get|
|00000620| 70 61 72 67 73 0a 0a 7c | 20 66 69 72 73 74 20 63 |pargs..|| first c|
|00000630| 6f 70 79 20 74 68 65 20 | 70 61 73 63 61 6c 61 72 |opy the |pascalar|
|00000640| 67 73 74 72 75 63 74 20 | 66 72 6f 6d 20 73 74 61 |gstruct |from sta|
|00000650| 63 6b 20 69 6e 74 6f 20 | 74 68 65 20 43 20 73 74 |ck into |the C st|
|00000660| 72 75 63 74 2e 0a 0a 67 | 65 74 70 61 72 67 73 3a |ruct...g|etpargs:|
|00000670| 0a 09 6d 6f 76 6c 09 73 | 70 40 28 38 29 2c 64 30 |..movl.s|p@(8),d0|
|00000680| 09 7c 20 63 6f 75 6e 74 | 0a 09 62 65 71 73 09 2e |.| count|..beqs..|
|00000690| 4c 33 09 09 7c 20 6e 6f | 74 68 69 6e 67 20 74 6f |L3..| no|thing to|
|000006a0| 20 64 6f 2c 20 6a 75 73 | 74 20 72 65 74 75 72 6e | do, jus|t return|
|000006b0| 20 66 75 6e 72 65 74 70 | 74 72 0a 09 6d 6f 76 6c | funretp|tr..movl|
|000006c0| 09 73 70 40 28 34 29 2c | 61 31 09 7c 20 64 73 74 |.sp@(4),|a1.| dst|
|000006d0| 20 73 74 72 75 63 74 20 | 61 64 64 72 0a 09 6d 6f | struct |addr..mo|
|000006e0| 76 6c 09 61 36 2c 61 30 | 0a 09 61 64 64 71 6c 09 |vl.a6,a0|..addql.|
|000006f0| 23 38 2c 61 30 09 09 7c | 20 73 72 63 20 73 74 61 |#8,a0..|| src sta|
|00000700| 63 6b 20 61 64 64 72 0a | 09 61 73 72 6c 09 23 31 |ck addr.|.asrl.#1|
|00000710| 2c 64 30 09 09 7c 20 63 | 6f 6e 76 65 72 74 20 74 |,d0..| c|onvert t|
|00000720| 6f 20 77 6f 72 64 20 63 | 6f 75 6e 74 0a 09 73 75 |o word c|ount..su|
|00000730| 62 71 6c 09 23 31 2c 64 | 30 0a 2e 4c 31 3a 09 6d |bql.#1,d|0..L1:.m|
|00000740| 6f 76 77 09 61 30 40 2b | 2c 61 31 40 2b 0a 09 64 |ovw.a0@+|,a1@+..d|
|00000750| 62 72 61 09 64 30 2c 2e | 4c 31 0a 0a 7c 20 6e 6f |bra.d0,.|L1..| no|
|00000760| 77 20 72 65 6d 6f 76 65 | 20 74 68 65 20 50 61 73 |w remove| the Pas|
|00000770| 63 61 6c 20 61 72 67 75 | 6d 65 6e 74 73 20 66 72 |cal argu|ments fr|
|00000780| 6f 6d 20 74 68 65 20 73 | 74 61 63 6b 20 62 79 20 |om the s|tack by |
|00000790| 73 68 69 66 74 69 6e 67 | 20 69 74 20 75 70 2e 0a |shifting| it up..|
|000007a0| 0a 09 6d 6f 76 6c 09 61 | 36 2c 61 31 0a 09 61 64 |..movl.a|6,a1..ad|
|000007b0| 64 71 6c 09 23 38 2c 61 | 31 09 09 7c 20 73 72 63 |dql.#8,a|1..| src|
|000007c0| 0a 09 6d 6f 76 6c 09 61 | 31 2c 64 30 0a 09 73 75 |..movl.a|1,d0..su|
|000007d0| 62 6c 09 73 70 2c 64 30 | 09 09 7c 20 73 69 7a 65 |bl.sp,d0|..| size|
|000007e0| 6f 66 20 73 74 61 63 6b | 0a 09 61 73 72 6c 09 23 |of stack|..asrl.#|
|000007f0| 31 2c 64 30 09 09 7c 20 | 63 6f 6e 76 65 72 74 20 |1,d0..| |convert |
|00000800| 74 6f 20 77 6f 72 64 20 | 63 6f 75 6e 74 0a 09 73 |to word |count..s|
|00000810| 75 62 71 6c 09 23 31 2c | 64 30 0a 2e 4c 32 3a 09 |ubql.#1,|d0..L2:.|
|00000820| 6d 6f 76 77 09 61 31 40 | 2d 2c 61 30 40 2d 0a 09 |movw.a1@|-,a0@-..|
|00000830| 64 62 72 61 09 64 30 2c | 2e 4c 32 0a 0a 7c 20 75 |dbra.d0,|.L2..| u|
|00000840| 70 64 61 74 65 20 73 70 | 20 61 6e 64 20 66 70 0a |pdate sp| and fp.|
|00000850| 0a 09 6d 6f 76 6c 09 73 | 70 40 28 38 29 2c 64 30 |..movl.s|p@(8),d0|
|00000860| 09 7c 20 73 74 61 63 6b | 20 73 68 69 66 74 20 64 |.| stack| shift d|
|00000870| 69 73 74 61 6e 63 65 0a | 09 61 64 64 6c 09 64 30 |istance.|.addl.d0|
|00000880| 2c 61 36 0a 09 61 64 64 | 6c 09 64 30 2c 73 70 0a |,a6..add|l.d0,sp.|
|00000890| 2e 4c 33 3a 09 6d 6f 76 | 6c 09 61 36 2c 64 30 09 |.L3:.mov|l.a6,d0.|
|000008a0| 09 7c 20 72 65 74 75 72 | 6e 20 66 75 6e 72 65 74 |.| retur|n funret|
|000008b0| 70 74 72 0a 09 61 64 64 | 71 6c 09 23 38 2c 64 30 |ptr..add|ql.#8,d0|
|000008c0| 0a 09 72 74 73 0a 0a 0a | 0a 0a 0a 52 61 7a 7a 6c |..rts...|...Razzl|
|000008d0| 65 21 44 61 7a 7a 6c 65 | 0a 65 63 68 6f 20 78 20 |e!Dazzle|.echo x |
|000008e0| 2d 20 73 65 74 70 61 72 | 67 73 2e 73 0a 63 61 74 |- setpar|gs.s.cat|
|000008f0| 20 3e 20 73 65 74 70 61 | 72 67 73 2e 73 20 3c 3c | > setpa|rgs.s <<|
|00000900| 20 27 52 61 7a 7a 6c 65 | 21 44 61 7a 7a 6c 65 27 | 'Razzle|!Dazzle'|
|00000910| 0a 7c 20 73 65 74 70 61 | 72 67 73 20 2d 20 53 65 |.| setpa|rgs - Se|
|00000920| 74 20 50 61 73 63 61 6c | 20 61 72 67 75 6d 65 6e |t Pascal| argumen|
|00000930| 74 73 20 66 6f 72 20 61 | 20 70 72 6f 63 65 64 75 |ts for a| procedu|
|00000940| 72 63 65 20 63 61 6c 6c | 20 66 72 6f 6d 20 43 2e |rce call| from C.|
|00000950| 0a 7c 0a 7c 20 55 73 65 | 66 75 6c 20 77 68 65 6e |.|.| Use|ful when|
|00000960| 20 68 61 76 69 6e 67 20 | 74 6f 20 63 61 6c 6c 20 | having |to call |
|00000970| 61 20 50 61 73 63 61 6c | 20 70 72 6f 63 65 64 75 |a Pascal| procedu|
|00000980| 72 65 20 64 69 72 65 63 | 74 6c 79 2c 20 61 73 20 |re direc|tly, as |
|00000990| 77 68 65 6e 20 72 65 70 | 6c 61 63 69 6e 67 0a 7c |when rep|lacing.||
|000009a0| 20 61 20 77 69 6e 64 6f | 77 2c 20 63 6f 6e 74 72 | a windo|w, contr|
|000009b0| 6f 6c 20 6f 72 20 6d 65 | 6e 75 20 64 65 66 69 6e |ol or me|nu defin|
|000009c0| 69 74 69 6f 6e 20 66 75 | 6e 63 74 69 6f 6e 20 77 |ition fu|nction w|
|000009d0| 69 74 68 20 61 20 43 20 | 72 6f 75 74 69 6e 65 2c |ith a C |routine,|
|000009e0| 20 62 75 74 20 6c 61 74 | 65 72 0a 7c 20 70 61 73 | but lat|er.| pas|
|000009f0| 73 69 6e 67 20 6f 6e 20 | 74 68 65 20 61 72 67 75 |sing on |the argu|
|00000a00| 6d 65 6e 74 73 20 28 67 | 6f 74 74 65 6e 20 77 69 |ments (g|otten wi|
|00000a10| 74 68 20 67 65 74 70 61 | 72 67 73 29 20 74 6f 20 |th getpa|rgs) to |
|00000a20| 74 68 65 20 74 72 75 65 | 20 64 65 66 69 6e 69 74 |the true| definit|
|00000a30| 69 6f 6e 0a 7c 20 66 75 | 6e 63 74 69 6f 6e 2e 20 |ion.| fu|nction. |
|00000a40| 20 54 68 65 20 61 72 67 | 75 6d 65 6e 74 73 20 74 | The arg|uments t|
|00000a50| 6f 20 73 65 74 70 61 72 | 67 73 20 69 73 20 74 68 |o setpar|gs is th|
|00000a60| 65 20 73 61 6d 65 20 61 | 73 20 74 6f 20 67 65 74 |e same a|s to get|
|00000a70| 70 61 72 67 73 2e 0a 7c | 0a 7c 09 73 65 74 70 61 |pargs..||.|.setpa|
|00000a80| 72 67 73 28 26 70 61 73 | 63 61 6c 61 72 67 73 74 |rgs(&pas|calargst|
|00000a90| 72 75 63 74 2c 20 73 69 | 7a 65 6f 66 20 70 61 73 |ruct, si|zeof pas|
|00000aa0| 63 61 6c 61 72 67 73 74 | 72 75 63 74 29 3b 0a 7c |calargst|ruct);.||
|00000ab0| 0a 7c 20 49 66 20 74 68 | 65 20 50 61 73 63 61 6c |.| If th|e Pascal|
|00000ac0| 20 70 72 6f 63 65 64 75 | 72 65 20 72 65 74 75 72 | procedu|re retur|
|00000ad0| 6e 73 20 61 20 76 61 6c | 75 65 2c 20 74 68 65 20 |ns a val|ue, the |
|00000ae0| 72 6f 75 74 69 6e 65 20 | 61 6c 6c 6f 63 70 76 61 |routine |allocpva|
|00000af0| 6c 20 28 74 6f 20 61 6c | 6c 6f 63 61 74 65 0a 7c |l (to al|locate.||
|00000b00| 20 73 70 61 63 65 20 6f | 6e 20 74 68 65 20 73 74 | space o|n the st|
|00000b10| 61 63 6b 29 20 73 68 6f | 75 6c 64 20 62 65 20 63 |ack) sho|uld be c|
|00000b20| 61 6c 6c 65 64 2e 20 20 | 41 66 74 65 72 20 74 68 |alled. |After th|
|00000b30| 65 20 76 61 6c 75 65 64 | 20 69 73 20 75 73 65 64 |e valued| is used|
|00000b40| 2c 20 63 61 6c 6c 20 66 | 72 65 65 70 76 61 6c 0a |, call f|reepval.|
|00000b50| 7c 20 74 6f 20 66 72 65 | 65 20 74 68 65 20 28 70 || to fre|e the (p|
|00000b60| 72 65 76 69 6f 75 73 6c | 79 29 20 61 6c 6c 6f 63 |reviousl|y) alloc|
|00000b70| 61 74 65 64 20 73 74 61 | 63 6b 20 73 70 61 63 65 |ated sta|ck space|
|00000b80| 2e 0a 7c 0a 7c 20 48 69 | 73 74 6f 72 79 0a 7c 0a |..|.| Hi|story.|.|
|00000b90| 7c 20 30 31 2f 31 30 2f | 38 35 09 4d 6f 79 09 43 || 01/10/|85.Moy.C|
|00000ba0| 72 65 61 74 65 64 2e 0a | 7c 0a 09 2e 64 61 74 61 |reated..||...data|
|00000bb0| 0a 09 2e 74 65 78 74 0a | 09 2e 67 6c 6f 62 6c 09 |...text.|..globl.|
|00000bc0| 73 65 74 70 61 72 67 73 | 0a 0a 7c 20 73 68 69 66 |setpargs|..| shif|
|00000bd0| 74 20 74 68 65 20 73 74 | 61 63 6b 20 75 70 20 74 |t the st|ack up t|
|00000be0| 6f 20 6d 61 6b 65 20 72 | 6f 6f 6d 20 66 6f 72 20 |o make r|oom for |
|00000bf0| 74 68 65 20 50 61 73 63 | 61 6c 20 61 72 67 75 6d |the Pasc|al argum|
|00000c00| 65 6e 74 73 0a 0a 73 65 | 74 70 61 72 67 73 3a 0a |ents..se|tpargs:.|
|00000c10| 09 6d 6f 76 6c 09 73 70 | 40 28 38 29 2c 64 30 09 |.movl.sp|@(8),d0.|
|00000c20| 7c 20 62 79 74 65 20 63 | 6f 75 6e 74 0a 09 62 65 || byte c|ount..be|
|00000c30| 71 73 09 2e 4c 32 09 09 | 7c 20 6e 6f 74 68 69 6e |qs..L2..|| nothin|
|00000c40| 67 20 74 6f 20 64 6f 0a | 09 6d 6f 76 6c 09 73 70 |g to do.|.movl.sp|
|00000c50| 2c 61 30 09 09 7c 20 73 | 72 63 20 61 64 64 72 65 |,a0..| s|rc addre|
|00000c60| 73 73 0a 09 73 75 62 6c | 09 64 30 2c 73 70 09 09 |ss..subl|.d0,sp..|
|00000c70| 7c 20 61 64 6a 75 73 74 | 20 73 74 61 63 6b 20 70 || adjust| stack p|
|00000c80| 6f 69 6e 74 65 72 0a 09 | 6d 6f 76 6c 09 73 70 2c |ointer..|movl.sp,|
|00000c90| 61 31 09 09 7c 20 64 73 | 74 20 61 64 64 72 65 73 |a1..| ds|t addres|
|00000ca0| 73 0a 09 6d 6f 76 6c 09 | 61 30 40 2b 2c 61 31 40 |s..movl.|a0@+,a1@|
|00000cb0| 2b 09 7c 20 6d 6f 76 65 | 20 72 65 74 75 72 6e 20 |+.| move| return |
|00000cc0| 61 64 64 72 65 73 73 0a | 09 6d 6f 76 6c 09 61 30 |address.|.movl.a0|
|00000cd0| 40 2b 2c 61 31 40 2b 09 | 7c 20 6d 6f 76 65 20 73 |@+,a1@+.|| move s|
|00000ce0| 74 72 75 63 74 75 72 65 | 20 61 64 64 72 65 73 73 |tructure| address|
|00000cf0| 0a 09 6d 6f 76 6c 09 61 | 30 40 2c 61 31 40 2b 09 |..movl.a|0@,a1@+.|
|00000d00| 7c 20 6d 6f 76 65 20 62 | 79 74 65 20 63 6f 75 6e || move b|yte coun|
|00000d10| 74 0a 0a 7c 20 63 6f 70 | 79 20 74 68 65 20 70 61 |t..| cop|y the pa|
|00000d20| 73 63 61 6c 20 61 72 67 | 75 6d 65 6e 74 73 0a 0a |scal arg|uments..|
|00000d30| 09 6d 6f 76 6c 09 73 70 | 40 28 34 29 2c 61 30 09 |.movl.sp|@(4),a0.|
|00000d40| 7c 20 73 72 63 20 28 73 | 74 72 75 63 74 75 72 65 || src (s|tructure|
|00000d50| 29 20 61 64 64 72 65 73 | 73 0a 09 61 73 72 6c 09 |) addres|s..asrl.|
|00000d60| 23 31 2c 64 30 09 09 7c | 20 63 6f 6e 76 65 72 74 |#1,d0..|| convert|
|00000d70| 20 74 6f 20 77 6f 72 64 | 20 63 6f 75 6e 74 0a 09 | to word| count..|
|00000d80| 73 75 62 71 6c 09 23 31 | 2c 64 30 0a 2e 4c 31 3a |subql.#1|,d0..L1:|
|00000d90| 09 6d 6f 76 77 09 61 30 | 40 2b 2c 61 31 40 2b 09 |.movw.a0|@+,a1@+.|
|00000da0| 7c 20 63 6f 70 79 2c 20 | 6f 6e 65 20 77 6f 72 64 || copy, |one word|
|00000db0| 20 61 74 20 61 20 74 69 | 6d 65 0a 09 64 62 72 61 | at a ti|me..dbra|
|00000dc0| 09 64 30 2c 2e 4c 31 0a | 2e 4c 32 3a 09 72 74 73 |.d0,.L1.|.L2:.rts|
|00000dd0| 0a 52 61 7a 7a 6c 65 21 | 44 61 7a 7a 6c 65 0a 65 |.Razzle!|Dazzle.e|
|00000de0| 63 68 6f 20 78 20 2d 20 | 61 6c 6c 6f 63 70 76 61 |cho x - |allocpva|
|00000df0| 6c 2e 73 0a 63 61 74 20 | 3e 20 61 6c 6c 6f 63 70 |l.s.cat |> allocp|
|00000e00| 76 61 6c 2e 73 20 3c 3c | 20 27 52 61 7a 7a 6c 65 |val.s <<| 'Razzle|
|00000e10| 21 44 61 7a 7a 6c 65 27 | 0a 7c 20 61 6c 6c 6f 63 |!Dazzle'|.| alloc|
|00000e20| 70 76 61 6c 20 2d 20 41 | 6c 6c 6f 63 61 74 65 20 |pval - A|llocate |
|00000e30| 73 70 61 63 65 20 6f 6e | 20 74 68 65 20 73 74 61 |space on| the sta|
|00000e40| 63 6b 20 66 6f 72 20 61 | 20 70 61 73 63 61 6c 20 |ck for a| pascal |
|00000e50| 72 65 74 75 72 6e 20 76 | 61 6c 75 65 2e 0a 7c 0a |return v|alue..|.|
|00000e60| 7c 20 41 6c 6c 6f 63 61 | 74 65 73 20 74 68 65 20 || Alloca|tes the |
|00000e70| 72 65 71 75 65 73 74 65 | 64 20 6e 75 6d 62 65 72 |requeste|d number|
|00000e80| 20 6f 66 20 62 79 74 65 | 73 20 28 6d 75 73 74 20 | of byte|s (must |
|00000e90| 62 65 20 65 76 65 6e 29 | 20 6f 6e 20 74 6f 70 20 |be even)| on top |
|00000ea0| 6f 66 20 74 68 65 20 73 | 74 61 63 6b 2e 0a 7c 20 |of the s|tack..| |
|00000eb0| 41 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 74 68 65 |A pointe|r to the|
|00000ec0| 20 61 6c 6c 6f 63 61 74 | 65 64 20 61 72 65 61 20 | allocat|ed area |
|00000ed0| 69 73 20 72 65 74 75 72 | 6e 65 64 2e 0a 7c 0a 7c |is retur|ned..|.||
|00000ee0| 09 70 6f 69 6e 74 65 72 | 20 3d 20 61 6c 6c 6f 63 |.pointer| = alloc|
|00000ef0| 70 76 61 6c 28 6e 75 6d | 62 79 74 65 73 29 3b 0a |pval(num|bytes);.|
|00000f00| 7c 0a 7c 20 54 68 65 20 | 61 6c 6c 6f 63 61 74 65 ||.| The |allocate|
|00000f10| 64 20 73 70 61 63 65 20 | 73 68 6f 75 6c 64 20 62 |d space |should b|
|00000f20| 65 20 66 72 65 65 64 20 | 77 69 74 68 20 66 72 65 |e freed |with fre|
|00000f30| 65 70 76 61 6c 2e 0a 7c | 0a 7c 20 48 69 73 74 6f |epval..||.| Histo|
|00000f40| 72 79 0a 7c 20 30 31 2f | 31 30 2f 38 34 09 4d 6f |ry.| 01/|10/84.Mo|
|00000f50| 79 09 43 72 65 61 74 65 | 64 2e 0a 7c 0a 09 2e 67 |y.Create|d..|...g|
|00000f60| 6c 6f 62 6c 09 61 6c 6c | 6f 63 70 76 61 6c 0a 61 |lobl.all|ocpval.a|
|00000f70| 6c 6c 6f 63 70 76 61 6c | 3a 0a 09 6d 6f 76 6c 09 |llocpval|:..movl.|
|00000f80| 73 70 2c 61 30 09 09 7c | 20 63 75 72 72 65 6e 74 |sp,a0..|| current|
|00000f90| 20 73 74 61 63 6b 20 70 | 6f 73 69 74 69 6f 6e 0a | stack p|osition.|
|00000fa0| 09 73 75 62 6c 09 73 70 | 40 28 34 29 2c 61 30 09 |.subl.sp|@(4),a0.|
|00000fb0| 7c 20 6e 65 77 20 73 74 | 61 63 6b 20 74 6f 70 0a || new st|ack top.|
|00000fc0| 09 6d 6f 76 6c 09 73 70 | 40 2c 61 30 40 09 09 7c |.movl.sp|@,a0@..||
|00000fd0| 20 6d 6f 76 65 20 72 65 | 74 75 72 6e 20 61 64 64 | move re|turn add|
|00000fe0| 72 65 73 73 0a 09 6d 6f | 76 6c 09 61 30 2c 73 70 |ress..mo|vl.a0,sp|
|00000ff0| 09 09 7c 20 61 64 6a 75 | 73 74 20 73 74 61 63 6b |..| adju|st stack|
|00001000| 0a 09 6d 6f 76 6c 09 73 | 70 2c 64 30 0a 09 61 64 |..movl.s|p,d0..ad|
|00001010| 64 71 6c 09 23 38 2c 64 | 30 09 09 7c 20 72 65 74 |dql.#8,d|0..| ret|
|00001020| 75 72 6e 20 76 61 6c 75 | 65 0a 09 72 74 73 0a 52 |urn valu|e..rts.R|
|00001030| 61 7a 7a 6c 65 21 44 61 | 7a 7a 6c 65 0a 65 63 68 |azzle!Da|zzle.ech|
|00001040| 6f 20 78 20 2d 20 66 72 | 65 65 70 76 61 6c 2e 73 |o x - fr|eepval.s|
|00001050| 0a 63 61 74 20 3e 20 66 | 72 65 65 70 76 61 6c 2e |.cat > f|reepval.|
|00001060| 73 20 3c 3c 20 27 52 61 | 7a 7a 6c 65 21 44 61 7a |s << 'Ra|zzle!Daz|
|00001070| 7a 6c 65 27 0a 7c 20 66 | 72 65 65 70 76 61 6c 20 |zle'.| f|reepval |
|00001080| 2d 20 46 72 65 65 20 73 | 70 61 63 65 20 6f 6e 20 |- Free s|pace on |
|00001090| 74 68 65 20 73 74 61 63 | 6b 20 70 72 65 76 69 6f |the stac|k previo|
|000010a0| 75 73 6c 79 20 61 6c 6c | 6f 63 61 74 65 64 20 77 |usly all|ocated w|
|000010b0| 69 74 68 20 61 6c 6c 6f | 63 70 76 61 6c 2e 0a 7c |ith allo|cpval..||
|000010c0| 0a 7c 20 46 72 65 65 73 | 20 74 68 65 20 72 65 71 |.| Frees| the req|
|000010d0| 75 65 73 74 65 64 20 6e | 75 6d 62 65 72 20 6f 66 |uested n|umber of|
|000010e0| 20 62 79 74 65 73 20 28 | 6d 75 73 74 20 62 65 20 | bytes (|must be |
|000010f0| 65 76 65 6e 29 20 66 72 | 6f 6d 20 74 6f 70 20 6f |even) fr|om top o|
|00001100| 66 20 74 68 65 20 73 74 | 61 63 6b 2e 0a 7c 0a 7c |f the st|ack..|.||
|00001110| 09 66 72 65 65 70 76 61 | 6c 28 6e 75 6d 62 79 74 |.freepva|l(numbyt|
|00001120| 65 73 29 3b 0a 7c 0a 7c | 20 54 68 65 20 6e 75 6d |es);.|.|| The num|
|00001130| 62 65 72 20 6f 66 20 62 | 79 74 65 73 20 6d 75 73 |ber of b|ytes mus|
|00001140| 74 20 63 6f 72 72 65 73 | 70 6f 6e 64 20 74 6f 20 |t corres|pond to |
|00001150| 74 68 61 74 20 61 6c 6c | 6f 63 61 74 65 64 20 77 |that all|ocated w|
|00001160| 69 74 68 20 61 6c 6c 6f | 63 70 76 61 6c 2e 0a 7c |ith allo|cpval..||
|00001170| 0a 7c 20 48 69 73 74 6f | 72 79 0a 7c 20 30 31 2f |.| Histo|ry.| 01/|
|00001180| 31 30 2f 38 34 09 4d 6f | 79 09 43 72 65 61 74 65 |10/84.Mo|y.Create|
|00001190| 64 2e 0a 7c 0a 09 2e 67 | 6c 6f 62 6c 09 66 72 65 |d..|...g|lobl.fre|
|000011a0| 65 70 76 61 6c 0a 66 72 | 65 65 70 76 61 6c 3a 0a |epval.fr|eepval:.|
|000011b0| 09 6d 6f 76 6c 09 73 70 | 2c 61 30 09 09 7c 20 63 |.movl.sp|,a0..| c|
|000011c0| 75 72 72 65 6e 74 20 73 | 74 61 63 6b 20 70 6f 73 |urrent s|tack pos|
|000011d0| 69 74 69 6f 6e 0a 09 61 | 64 64 6c 09 73 70 40 28 |ition..a|ddl.sp@(|
|000011e0| 34 29 2c 61 30 09 7c 20 | 6e 65 77 20 73 74 61 63 |4),a0.| |new stac|
|000011f0| 6b 20 74 6f 70 0a 09 6d | 6f 76 6c 09 73 70 40 2c |k top..m|ovl.sp@,|
|00001200| 61 30 40 09 09 7c 20 6d | 6f 76 65 20 72 65 74 75 |a0@..| m|ove retu|
|00001210| 72 6e 20 61 64 64 72 65 | 73 73 0a 09 6d 6f 76 6c |rn addre|ss..movl|
|00001220| 09 61 30 2c 73 70 09 09 | 7c 20 61 64 6a 75 73 74 |.a0,sp..|| adjust|
|00001230| 20 73 74 61 63 6b 0a 09 | 72 74 73 0a 52 61 7a 7a | stack..|rts.Razz|
|00001240| 6c 65 21 44 61 7a 7a 6c | 65 0a |le!Dazzl|e. |
+--------+-------------------------+-------------------------+--------+--------+