home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 8 / Eagles_Nest_Mac_Collection_Disc_8.TOAST / Developer Tools⁄Additions / SADE14a3 / SADE 1.4a3 / SADE Example Scripts / sc7 < prev   
MacBinary  |  1992-07-10  |  4.9 KB  |  [TEXT/sade]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Fri Jul 10 13:00:00 1992, modified Fri Jul 10 13:00:00 1992, creator 'sade', type ASCII, 4246 bytes "sc7" , at 0x1116 475 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
0% TrID Sybase iAnywhere database files default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[sade]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 03 73 63 37 00 00 00 | 00 00 00 00 00 00 00 00 |..sc7...|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|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 54 45 58 54 73 61 64 | 65 01 00 00 00 00 00 00 |.TEXTsad|e.......|
|00000050| 00 00 00 00 00 10 96 00 | 00 01 db a6 83 72 90 a6 |........|.....r..|
|00000060| 83 72 90 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.r......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 07 8f 00 00 |........|........|
|00000080| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000090| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|000000a0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|000000b0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|000000c0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|000000d0| 23 23 23 23 23 23 23 23 | 23 23 0d 23 09 53 79 6d |########|##.#.Sym|
|000000e0| 62 6f 6c 69 63 20 41 70 | 70 6c 69 63 61 74 69 6f |bolic Ap|plicatio|
|000000f0| 6e 20 44 65 62 75 67 67 | 69 6e 67 20 45 6e 76 69 |n Debugg|ing Envi|
|00000100| 72 6f 6e 6d 65 6e 74 20 | 31 2e 34 0d 23 0d 23 09 |ronment |1.4.#.#.|
|00000110| 63 6f 70 79 72 69 67 68 | 74 20 41 70 70 6c 65 20 |copyrigh|t Apple |
|00000120| 43 6f 6d 70 75 74 65 72 | 2c 20 49 6e 63 2e 20 31 |Computer|, Inc. 1|
|00000130| 39 38 37 2d 31 39 39 31 | 0d 23 09 41 6c 6c 20 72 |987-1991|.#.All r|
|00000140| 69 67 68 74 73 20 72 65 | 73 65 72 76 65 64 2e 0d |ights re|served..|
|00000150| 23 0d 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |#.######|########|
|00000160| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000170| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000180| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000190| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|000001a0| 23 23 23 23 23 23 23 23 | 23 23 23 23 0d 0d 0d 64 |########|####...d|
|000001b0| 65 66 69 6e 65 20 5f 5f | 52 4f 4d 6c 6f 5f 5f 2c |efine __|ROMlo__,|
|000001c0| 20 5f 5f 52 4f 4d 68 69 | 5f 5f 09 09 09 23 20 52 | __ROMhi|__...# R|
|000001d0| 4f 4d 20 62 6f 75 6e 64 | 61 72 69 65 73 0d 64 65 |OM bound|aries.de|
|000001e0| 66 69 6e 65 20 5f 5f 68 | 65 61 70 4c 6f 5f 5f 2c |fine __h|eapLo__,|
|000001f0| 20 5f 5f 68 65 61 70 48 | 69 5f 5f 09 09 23 20 68 | __heapH|i__..# h|
|00000200| 65 61 70 20 62 6f 75 6e | 64 61 72 69 65 73 0d 64 |eap boun|daries.d|
|00000210| 65 66 69 6e 65 20 5f 5f | 73 74 61 63 6b 4c 6f 5f |efine __|stackLo_|
|00000220| 5f 2c 20 5f 5f 73 74 61 | 63 6b 48 69 5f 5f 09 09 |_, __sta|ckHi__..|
|00000230| 23 20 73 74 61 63 6b 20 | 62 6f 75 6e 64 61 72 69 |# stack |boundari|
|00000240| 65 73 0d 0d 0d 23 20 49 | 6e 69 74 73 20 73 74 75 |es...# I|nits stu|
|00000250| 66 66 20 61 6e 64 20 6d | 61 6b 65 73 20 73 75 72 |ff and m|akes sur|
|00000260| 65 20 73 74 61 63 6b 20 | 69 73 20 4f 4b 20 62 65 |e stack |is OK be|
|00000270| 66 6f 72 65 20 77 65 20 | 74 72 79 20 74 6f 20 63 |fore we |try to c|
|00000280| 72 61 77 6c 20 69 74 2e | 0d 66 75 6e 63 20 49 6e |rawl it.|.func In|
|00000290| 69 74 53 43 37 28 29 0d | 09 5f 5f 73 74 61 63 6b |itSC7().|.__stack|
|000002a0| 4c 6f 5f 5f 20 3a 3d 20 | 41 37 0d 09 5f 5f 73 74 |Lo__ := |A7..__st|
|000002b0| 61 63 6b 48 69 5f 5f 20 | 3a 3d 20 43 75 72 53 74 |ackHi__ |:= CurSt|
|000002c0| 61 63 6b 42 61 73 65 0d | 09 5f 5f 68 65 61 70 4c |ackBase.|.__heapL|
|000002d0| 6f 5f 5f 20 3a 3d 20 41 | 70 70 6c 5a 6f 6e 65 0d |o__ := A|pplZone.|
|000002e0| 09 5f 5f 68 65 61 70 48 | 69 5f 5f 20 3a 3d 20 41 |.__heapH|i__ := A|
|000002f0| 70 70 6c 4c 69 6d 69 74 | 0d 09 5f 5f 52 4f 4d 6c |pplLimit|..__ROMl|
|00000300| 6f 5f 5f 20 3a 3d 20 52 | 6f 6d 42 61 73 65 20 26 |o__ := R|omBase &|
|00000310| 20 54 61 72 67 65 74 41 | 64 64 72 4d 61 73 6b 0d | TargetA|ddrMask.|
|00000320| 09 5f 5f 52 4f 4d 68 69 | 5f 5f 20 3a 3d 20 5f 5f |.__ROMhi|__ := __|
|00000330| 52 4f 4d 6c 6f 5f 5f 20 | 2b 20 24 34 30 30 30 30 |ROMlo__ |+ $40000|
|00000340| 09 23 20 61 73 73 75 6d | 65 20 32 35 36 4b 20 52 |.# assum|e 256K R|
|00000350| 4f 4d 2d 20 6e 65 65 64 | 20 61 20 62 65 74 74 65 |OM- need| a bette|
|00000360| 72 20 77 61 79 21 21 21 | 0d 09 69 66 20 28 5f 5f |r way!!!|..if (__|
|00000370| 73 74 61 63 6b 4c 6f 5f | 5f 20 26 20 31 29 20 6f |stackLo_|_ & 1) o|
|00000380| 72 20 28 5f 5f 73 74 61 | 63 6b 48 69 5f 5f 20 26 |r (__sta|ckHi__ &|
|00000390| 20 31 29 20 74 68 65 6e | 0d 09 09 72 65 74 75 72 | 1) then|...retur|
|000003a0| 6e 20 30 0d 09 65 6e 64 | 0d 09 69 66 20 28 41 37 |n 0..end|..if (A7|
|000003b0| 20 3e 20 5f 5f 73 74 61 | 63 6b 48 69 5f 5f 29 20 | > __sta|ckHi__) |
|000003c0| 74 68 65 6e 0d 09 09 72 | 65 74 75 72 6e 20 30 0d |then...r|eturn 0.|
|000003d0| 09 65 6e 64 0d 09 72 65 | 74 75 72 6e 20 31 0d 65 |.end..re|turn 1.e|
|000003e0| 6e 64 0d 0d 23 20 52 65 | 74 75 72 6e 73 20 31 20 |nd..# Re|turns 1 |
|000003f0| 69 66 20 61 64 64 72 20 | 69 73 20 69 6e 20 61 70 |if addr |is in ap|
|00000400| 70 6c 69 63 61 74 69 6f | 6e 20 68 65 61 70 20 6f |plicatio|n heap o|
|00000410| 72 20 52 4f 4d 2e 0d 66 | 75 6e 63 20 49 73 43 6f |r ROM..f|unc IsCo|
|00000420| 64 65 41 64 64 72 28 61 | 64 64 72 29 0d 09 61 64 |deAddr(a|ddr)..ad|
|00000430| 64 72 20 3a 3d 20 75 6e | 73 69 67 6e 65 64 6c 6f |dr := un|signedlo|
|00000440| 6e 67 28 61 64 64 72 20 | 26 20 54 61 72 67 65 74 |ng(addr |& Target|
|00000450| 41 64 64 72 4d 61 73 6b | 29 0d 09 69 66 20 28 61 |AddrMask|)..if (a|
|00000460| 64 64 72 20 3e 3d 20 5f | 5f 68 65 61 70 4c 6f 5f |ddr >= _|_heapLo_|
|00000470| 5f 29 20 61 6e 64 20 28 | 61 64 64 72 20 3c 3d 20 |_) and (|addr <= |
|00000480| 5f 5f 68 65 61 70 48 69 | 5f 5f 29 20 74 68 65 6e |__heapHi|__) then|
|00000490| 09 09 23 20 69 6e 20 68 | 65 61 70 0d 09 09 72 65 |..# in h|eap...re|
|000004a0| 74 75 72 6e 20 31 0d 09 | 65 6c 73 65 69 66 20 28 |turn 1..|elseif (|
|000004b0| 61 64 64 72 20 3e 3d 20 | 5f 5f 52 4f 4d 6c 6f 5f |addr >= |__ROMlo_|
|000004c0| 5f 29 20 61 6e 64 20 28 | 61 64 64 72 20 3c 3d 20 |_) and (|addr <= |
|000004d0| 5f 5f 52 4f 4d 68 69 5f | 5f 29 20 74 68 65 6e 09 |__ROMhi_|_) then.|
|000004e0| 09 23 20 69 6e 20 52 4f | 4d 0d 09 09 72 65 74 75 |.# in RO|M...retu|
|000004f0| 72 6e 20 31 0d 09 65 6e | 64 0d 09 72 65 74 75 72 |rn 1..en|d..retur|
|00000500| 6e 20 30 0d 65 6e 64 0d | 0d 23 20 49 73 20 61 64 |n 0.end.|.# Is ad|
|00000510| 64 72 20 74 68 65 20 72 | 65 74 75 72 6e 20 61 64 |dr the r|eturn ad|
|00000520| 64 72 65 73 73 20 74 6f | 20 73 6f 6d 65 77 68 65 |dress to| somewhe|
|00000530| 72 65 3f 0d 23 20 54 68 | 69 73 20 66 75 6e 63 74 |re?.# Th|is funct|
|00000540| 69 6f 6e 20 63 68 65 63 | 6b 73 20 77 68 65 74 68 |ion chec|ks wheth|
|00000550| 65 72 20 74 68 65 20 6c | 6f 63 61 74 69 6f 6e 20 |er the l|ocation |
|00000560| 69 6d 6d 65 64 69 61 74 | 65 6c 79 20 62 65 66 6f |immediat|ely befo|
|00000570| 72 65 0d 23 20 61 64 64 | 72 20 63 6f 6e 74 61 69 |re.# add|r contai|
|00000580| 6e 73 20 61 20 4a 53 52 | 2c 20 42 53 52 2c 20 6f |ns a JSR|, BSR, o|
|00000590| 72 20 41 2d 74 72 61 70 | 2c 20 61 6e 64 20 69 66 |r A-trap|, and if|
|000005a0| 20 73 6f 20 72 65 74 75 | 72 6e 73 20 74 68 65 0d | so retu|rns the.|
|000005b0| 23 20 61 64 64 72 65 73 | 73 20 6f 66 20 74 68 61 |# addres|s of tha|
|000005c0| 74 20 69 6e 73 74 72 75 | 63 74 69 6f 6e 2e 20 20 |t instru|ction. |
|000005d0| 4f 74 68 65 72 77 69 73 | 65 20 69 74 20 72 65 74 |Otherwis|e it ret|
|000005e0| 75 72 6e 73 20 30 2e 0d | 66 75 6e 63 20 52 65 74 |urns 0..|func Ret|
|000005f0| 75 72 6e 41 64 64 72 65 | 73 73 28 61 64 64 72 29 |urnAddre|ss(addr)|
|00000600| 0d 09 64 65 66 69 6e 65 | 20 69 6e 73 74 72 2c 20 |..define| instr, |
|00000610| 63 61 6c 6c 41 64 64 72 | 0d 09 61 64 64 72 20 3a |callAddr|..addr :|
|00000620| 3d 20 75 6e 73 69 67 6e | 65 64 6c 6f 6e 67 28 61 |= unsign|edlong(a|
|00000630| 64 64 72 20 26 20 54 61 | 72 67 65 74 41 64 64 72 |ddr & Ta|rgetAddr|
|00000640| 4d 61 73 6b 29 0d 09 23 | 20 63 68 65 63 6b 20 69 |Mask)..#| check i|
|00000650| 66 20 61 64 64 72 20 69 | 73 20 69 6e 20 61 6e 20 |f addr i|s in an |
|00000660| 65 78 65 63 75 74 61 62 | 6c 65 20 72 65 67 69 6f |executab|le regio|
|00000670| 6e 0d 09 69 66 20 6e 6f | 74 20 49 73 43 6f 64 65 |n..if no|t IsCode|
|00000680| 41 64 64 72 28 61 64 64 | 72 29 20 74 68 65 6e 0d |Addr(add|r) then.|
|00000690| 09 09 72 65 74 75 72 6e | 20 30 09 09 09 23 20 6e |..return| 0...# n|
|000006a0| 6f 74 20 69 6e 20 68 65 | 61 70 20 28 6f 72 20 52 |ot in he|ap (or R|
|000006b0| 4f 4d 29 0d 09 65 6e 64 | 0d 09 63 61 6c 6c 41 64 |OM)..end|..callAd|
|000006c0| 64 72 20 3a 3d 20 75 6e | 73 69 67 6e 65 64 6c 6f |dr := un|signedlo|
|000006d0| 6e 67 28 61 64 64 72 20 | 2d 20 32 29 0d 09 69 66 |ng(addr |- 2)..if|
|000006e0| 20 6e 6f 74 20 49 73 43 | 6f 64 65 41 64 64 72 28 | not IsC|odeAddr(|
|000006f0| 63 61 6c 6c 41 64 64 72 | 29 20 74 68 65 6e 0d 09 |callAddr|) then..|
|00000700| 09 72 65 74 75 72 6e 20 | 30 0d 09 65 6e 64 0d 09 |.return |0..end..|
|00000710| 69 6e 73 74 72 20 3a 3d | 20 5e 75 6e 73 69 67 6e |instr :=| ^unsign|
|00000720| 65 64 77 6f 72 64 28 63 | 61 6c 6c 41 64 64 72 29 |edword(c|allAddr)|
|00000730| 5e 0d 09 69 66 20 69 6e | 73 74 72 20 3d 20 24 36 |^..if in|str = $6|
|00000740| 31 30 30 20 74 68 65 6e | 0d 09 09 72 65 74 75 72 |100 then|...retur|
|00000750| 6e 20 63 61 6c 6c 41 64 | 64 72 09 09 23 20 42 53 |n callAd|dr..# BS|
|00000760| 52 20 77 69 74 68 20 62 | 79 74 65 20 64 69 73 70 |R with b|yte disp|
|00000770| 6c 61 63 65 6d 65 6e 74 | 0d 09 65 6c 73 65 69 66 |lacement|..elseif|
|00000780| 20 28 69 6e 73 74 72 20 | 26 20 24 46 46 46 38 29 | (instr |& $FFF8)|
|00000790| 20 3d 20 24 34 45 39 30 | 20 74 68 65 6e 0d 09 09 | = $4E90| then...|
|000007a0| 72 65 74 75 72 6e 20 63 | 61 6c 6c 41 64 64 72 09 |return c|allAddr.|
|000007b0| 09 23 20 4a 53 52 20 28 | 41 6e 29 0d 09 65 6c 73 |.# JSR (|An)..els|
|000007c0| 65 69 66 20 28 69 6e 73 | 74 72 20 26 20 24 46 30 |eif (ins|tr & $F0|
|000007d0| 30 30 29 20 3d 20 24 41 | 30 30 30 20 74 68 65 6e |00) = $A|000 then|
|000007e0| 0d 09 09 72 65 74 75 72 | 6e 20 63 61 6c 6c 41 64 |...retur|n callAd|
|000007f0| 64 72 09 09 23 20 41 2d | 74 72 61 70 0d 09 65 6e |dr..# A-|trap..en|
|00000800| 64 0d 09 63 61 6c 6c 41 | 64 64 72 20 3a 3d 20 75 |d..callA|ddr := u|
|00000810| 6e 73 69 67 6e 65 64 6c | 6f 6e 67 28 61 64 64 72 |nsignedl|ong(addr|
|00000820| 20 2d 20 34 29 0d 09 69 | 66 20 6e 6f 74 20 49 73 | - 4)..i|f not Is|
|00000830| 43 6f 64 65 41 64 64 72 | 28 63 61 6c 6c 41 64 64 |CodeAddr|(callAdd|
|00000840| 72 29 20 74 68 65 6e 0d | 09 09 72 65 74 75 72 6e |r) then.|..return|
|00000850| 20 30 0d 09 65 6e 64 0d | 09 69 6e 73 74 72 20 3a | 0..end.|.instr :|
|00000860| 3d 20 5e 75 6e 73 69 67 | 6e 65 64 77 6f 72 64 28 |= ^unsig|nedword(|
|00000870| 63 61 6c 6c 41 64 64 72 | 29 5e 0d 09 69 66 20 69 |callAddr|)^..if i|
|00000880| 6e 73 74 72 20 3d 20 24 | 36 31 30 30 20 74 68 65 |nstr = $|6100 the|
|00000890| 6e 0d 09 09 72 65 74 75 | 72 6e 20 63 61 6c 6c 41 |n...retu|rn callA|
|000008a0| 64 64 72 09 09 23 20 42 | 53 52 20 77 69 74 68 20 |ddr..# B|SR with |
|000008b0| 77 6f 72 64 20 64 69 73 | 70 6c 61 63 65 6d 65 6e |word dis|placemen|
|000008c0| 74 0d 09 65 6c 73 65 69 | 66 20 28 69 6e 73 74 72 |t..elsei|f (instr|
|000008d0| 20 26 20 24 46 46 46 38 | 29 20 3d 20 24 34 45 41 | & $FFF8|) = $4EA|
|000008e0| 38 20 74 68 65 6e 0d 09 | 09 72 65 74 75 72 6e 20 |8 then..|.return |
|000008f0| 63 61 6c 6c 41 64 64 72 | 09 09 23 20 4a 53 52 20 |callAddr|..# JSR |
|00000900| 28 64 69 73 70 2c 20 41 | 6e 29 0d 09 65 6c 73 65 |(disp, A|n)..else|
|00000910| 69 66 20 28 69 6e 73 74 | 72 20 26 20 24 46 46 46 |if (inst|r & $FFF|
|00000920| 38 29 20 3d 20 24 34 45 | 42 30 20 74 68 65 6e 0d |8) = $4E|B0 then.|
|00000930| 09 09 72 65 74 75 72 6e | 20 63 61 6c 6c 41 64 64 |..return| callAdd|
|00000940| 72 09 09 23 20 4a 53 52 | 20 28 64 69 73 70 2c 20 |r..# JSR| (disp, |
|00000950| 41 6e 2c 20 44 6e 29 0d | 09 65 6c 73 65 69 66 20 |An, Dn).|.elseif |
|00000960| 69 6e 73 74 72 20 3d 20 | 24 34 45 42 41 20 74 68 |instr = |$4EBA th|
|00000970| 65 6e 0d 09 09 72 65 74 | 75 72 6e 20 63 61 6c 6c |en...ret|urn call|
|00000980| 41 64 64 72 09 09 23 20 | 4a 53 52 20 28 64 69 73 |Addr..# |JSR (dis|
|00000990| 70 2c 20 50 43 29 0d 09 | 65 6c 73 65 69 66 20 69 |p, PC)..|elseif i|
|000009a0| 6e 73 74 72 20 3d 20 24 | 34 45 42 42 20 74 68 65 |nstr = $|4EBB the|
|000009b0| 6e 0d 09 09 72 65 74 75 | 72 6e 20 63 61 6c 6c 41 |n...retu|rn callA|
|000009c0| 64 64 72 09 09 23 20 4a | 53 52 20 28 64 69 73 70 |ddr..# J|SR (disp|
|000009d0| 2c 20 50 43 2c 20 44 6e | 29 0d 09 65 6c 73 65 69 |, PC, Dn|)..elsei|
|000009e0| 66 20 69 6e 73 74 72 20 | 3d 20 24 34 45 42 38 20 |f instr |= $4EB8 |
|000009f0| 74 68 65 6e 0d 09 09 72 | 65 74 75 72 6e 20 63 61 |then...r|eturn ca|
|00000a00| 6c 6c 41 64 64 72 09 09 | 23 20 4a 53 52 20 28 78 |llAddr..|# JSR (x|
|00000a10| 78 78 78 29 2e 57 0d 09 | 65 6e 64 0d 09 63 61 6c |xxx).W..|end..cal|
|00000a20| 6c 41 64 64 72 20 3a 3d | 20 75 6e 73 69 67 6e 65 |lAddr :=| unsigne|
|00000a30| 64 6c 6f 6e 67 28 61 64 | 64 72 20 2d 20 36 29 0d |dlong(ad|dr - 6).|
|00000a40| 09 69 66 20 6e 6f 74 20 | 49 73 43 6f 64 65 41 64 |.if not |IsCodeAd|
|00000a50| 64 72 28 63 61 6c 6c 41 | 64 64 72 29 20 74 68 65 |dr(callA|ddr) the|
|00000a60| 6e 0d 09 09 72 65 74 75 | 72 6e 20 30 0d 09 65 6e |n...retu|rn 0..en|
|00000a70| 64 0d 09 69 6e 73 74 72 | 20 3a 3d 20 5e 75 6e 73 |d..instr| := ^uns|
|00000a80| 69 67 6e 65 64 77 6f 72 | 64 28 63 61 6c 6c 41 64 |ignedwor|d(callAd|
|00000a90| 64 72 29 5e 0d 09 69 66 | 20 69 6e 73 74 72 20 3d |dr)^..if| instr =|
|00000aa0| 20 24 34 45 42 39 20 74 | 68 65 6e 0d 09 09 72 65 | $4EB9 t|hen...re|
|00000ab0| 74 75 72 6e 20 63 61 6c | 6c 41 64 64 72 09 09 23 |turn cal|lAddr..#|
|00000ac0| 20 4a 53 54 20 28 78 78 | 78 78 29 2e 4c 0d 09 65 | JST (xx|xx).L..e|
|00000ad0| 6e 64 0d 09 72 65 74 75 | 72 6e 20 30 09 09 09 09 |nd..retu|rn 0....|
|00000ae0| 23 20 6e 6f 74 20 61 20 | 72 65 74 75 72 6e 20 61 |# not a |return a|
|00000af0| 64 64 72 0d 65 6e 64 0d | 0d 23 20 44 6f 65 73 20 |ddr.end.|.# Does |
|00000b00| 61 64 64 72 20 73 65 65 | 6d 20 74 6f 20 70 6f 69 |addr see|m to poi|
|00000b10| 6e 74 20 74 6f 20 61 6e | 20 41 36 20 6c 69 6e 6b |nt to an| A6 link|
|00000b20| 20 76 61 6c 75 65 3f 0d | 23 20 57 65 20 63 68 65 | value?.|# We che|
|00000b30| 63 6b 20 74 68 61 74 20 | 61 64 64 72 20 69 73 20 |ck that |addr is |
|00000b40| 65 76 65 6e 2c 20 77 69 | 74 68 69 6e 20 74 68 65 |even, wi|thin the|
|00000b50| 20 73 74 61 63 6b 20 62 | 6f 75 6e 64 61 72 69 65 | stack b|oundarie|
|00000b60| 73 2c 20 61 6e 64 20 62 | 65 74 77 65 65 6e 0d 23 |s, and b|etween.#|
|00000b70| 20 74 68 65 20 61 63 74 | 75 61 6c 20 41 36 20 61 | the act|ual A6 a|
|00000b80| 6e 64 20 70 72 65 76 69 | 6f 75 73 20 41 36 20 76 |nd previ|ous A6 v|
|00000b90| 61 6c 75 65 73 20 28 6f | 72 2c 20 6f 66 20 63 6f |alues (o|r, of co|
|00000ba0| 75 72 73 65 2c 20 74 68 | 61 74 20 69 74 20 61 63 |urse, th|at it ac|
|00000bb0| 74 75 61 6c 6c 79 0d 23 | 20 70 6f 69 6e 74 73 20 |tually.#| points |
|00000bc0| 74 6f 20 74 68 65 20 70 | 72 65 76 69 6f 75 73 20 |to the p|revious |
|00000bd0| 41 36 21 29 2e 0d 66 75 | 6e 63 20 41 36 4c 69 6e |A6!)..fu|nc A6Lin|
|00000be0| 6b 28 61 64 64 72 2c 20 | 70 72 65 76 41 36 29 0d |k(addr, |prevA6).|
|00000bf0| 09 69 66 20 28 61 64 64 | 72 20 26 20 31 29 20 6f |.if (add|r & 1) o|
|00000c00| 72 20 28 61 64 64 72 20 | 3c 20 5f 5f 73 74 61 63 |r (addr |< __stac|
|00000c10| 6b 4c 6f 5f 5f 29 20 6f | 72 20 28 61 64 64 72 20 |kLo__) o|r (addr |
|00000c20| 3e 20 5f 5f 73 74 61 63 | 6b 48 69 5f 5f 29 20 74 |> __stac|kHi__) t|
|00000c30| 68 65 6e 0d 09 09 72 65 | 74 75 72 6e 20 30 0d 09 |hen...re|turn 0..|
|00000c40| 65 6e 64 0d 09 69 66 20 | 28 5e 75 6e 73 69 67 6e |end..if |(^unsign|
|00000c50| 65 64 6c 6f 6e 67 28 61 | 64 64 72 29 5e 20 3d 20 |edlong(a|ddr)^ = |
|00000c60| 70 72 65 76 41 36 29 20 | 74 68 65 6e 0d 09 09 72 |prevA6) |then...r|
|00000c70| 65 74 75 72 6e 20 31 0d | 09 65 6e 64 0d 09 69 66 |eturn 1.|.end..if|
|00000c80| 20 28 61 64 64 72 20 3c | 20 41 36 29 20 6f 72 20 | (addr <| A6) or |
|00000c90| 28 61 64 64 72 20 3c 20 | 70 72 65 76 41 36 29 20 |(addr < |prevA6) |
|00000ca0| 74 68 65 6e 0d 09 09 72 | 65 74 75 72 6e 20 30 0d |then...r|eturn 0.|
|00000cb0| 09 65 6e 64 0d 09 72 65 | 74 75 72 6e 20 31 0d 65 |.end..re|turn 1.e|
|00000cc0| 6e 64 0d 0d 23 20 54 72 | 79 20 73 74 61 63 6b 20 |nd..# Tr|y stack |
|00000cd0| 61 64 64 72 65 73 73 65 | 73 20 66 72 6f 6d 20 43 |addresse|s from C|
|00000ce0| 75 72 53 74 61 63 6b 42 | 61 73 65 20 64 6f 77 6e |urStackB|ase down|
|00000cf0| 20 74 6f 20 63 75 72 72 | 65 6e 74 20 41 37 2e 0d | to curr|ent A7..|
|00000d00| 23 20 46 6f 72 20 65 61 | 63 68 20 74 68 61 74 20 |# For ea|ch that |
|00000d10| 6c 6f 6f 6b 73 20 6c 69 | 6b 65 20 61 20 72 65 74 |looks li|ke a ret|
|00000d20| 75 72 6e 20 61 64 64 72 | 65 73 73 2c 20 64 69 73 |urn addr|ess, dis|
|00000d30| 70 6c 61 79 20 69 74 20 | 61 6e 64 0d 23 20 63 68 |play it |and.# ch|
|00000d40| 65 63 6b 20 74 68 65 20 | 70 72 65 63 65 64 69 6e |eck the |precedin|
|00000d50| 67 20 76 61 6c 75 65 20 | 74 6f 20 73 65 65 20 69 |g value |to see i|
|00000d60| 66 20 69 74 20 6c 6f 6f | 6b 73 20 6c 69 6b 65 20 |f it loo|ks like |
|00000d70| 61 6e 20 41 36 20 6c 69 | 6e 6b 2e 0d 70 72 6f 63 |an A6 li|nk..proc|
|00000d80| 20 53 68 6f 77 46 72 61 | 6d 65 28 70 72 65 76 41 | ShowFra|me(prevA|
|00000d90| 36 2c 20 74 68 69 73 41 | 37 29 0d 09 64 65 66 69 |6, thisA|7)..defi|
|00000da0| 6e 65 20 6e 61 6d 65 0d | 09 64 65 66 69 6e 65 20 |ne name.|.define |
|00000db0| 6d 61 79 62 65 41 36 6c | 6f 63 20 3a 3d 20 74 68 |maybeA6l|oc := th|
|00000dc0| 69 73 41 37 20 2d 20 34 | 09 23 20 6d 69 67 68 74 |isA7 - 4|.# might|
|00000dd0| 20 62 65 20 61 6e 20 41 | 36 20 6c 69 6e 6b 20 76 | be an A|6 link v|
|00000de0| 61 6c 75 65 20 68 65 72 | 65 0d 09 64 65 66 69 6e |alue her|e..defin|
|00000df0| 65 20 6e 65 78 74 41 37 | 20 3a 3d 20 74 68 69 73 |e nextA7| := this|
|00000e00| 41 37 20 2d 20 32 09 09 | 23 20 63 68 65 63 6b 20 |A7 - 2..|# check |
|00000e10| 6f 6e 20 77 6f 72 64 20 | 62 6f 75 6e 64 61 72 69 |on word |boundari|
|00000e20| 65 73 0d 09 64 65 66 69 | 6e 65 20 63 61 6c 6c 41 |es..defi|ne callA|
|00000e30| 64 64 72 20 3a 3d 20 52 | 65 74 75 72 6e 41 64 64 |ddr := R|eturnAdd|
|00000e40| 72 65 73 73 28 5e 75 6e | 73 69 67 6e 65 64 6c 6f |ress(^un|signedlo|
|00000e50| 6e 67 28 74 68 69 73 41 | 37 29 5e 29 0d 09 69 66 |ng(thisA|7)^)..if|
|00000e60| 20 63 61 6c 6c 41 64 64 | 72 20 3c 3e 20 30 20 74 | callAdd|r <> 0 t|
|00000e70| 68 65 6e 0d 09 09 70 72 | 69 6e 74 66 20 22 24 25 |hen...pr|intf "$%|
|00000e80| 2e 38 58 20 20 20 20 20 | 22 2c 20 6c 6f 6e 67 28 |.8X |", long(|
|00000e90| 74 68 69 73 41 37 29 0d | 09 09 69 66 20 41 36 4c |thisA7).|..if A6L|
|00000ea0| 69 6e 6b 28 6d 61 79 62 | 65 41 36 6c 6f 63 2c 20 |ink(mayb|eA6loc, |
|00000eb0| 70 72 65 76 41 36 29 20 | 74 68 65 6e 0d 09 09 09 |prevA6) |then....|
|00000ec0| 70 72 69 6e 74 66 20 22 | 24 25 2e 38 58 20 20 20 |printf "|$%.8X |
|00000ed0| 20 20 22 2c 20 6c 6f 6e | 67 28 6d 61 79 62 65 41 | ", lon|g(maybeA|
|00000ee0| 36 6c 6f 63 29 0d 09 09 | 09 70 72 65 76 41 36 20 |6loc)...|.prevA6 |
|00000ef0| 3a 3d 20 6d 61 79 62 65 | 41 36 6c 6f 63 0d 09 09 |:= maybe|A6loc...|
|00000f00| 65 6c 73 65 0d 09 09 09 | 70 72 69 6e 74 66 20 22 |else....|printf "|
|00000f10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 22 0d | | ".|
|00000f20| 09 09 65 6e 64 0d 09 09 | 6e 61 6d 65 20 3a 3d 20 |..end...|name := |
|00000f30| 77 68 65 72 65 28 63 61 | 6c 6c 41 64 64 72 29 0d |where(ca|llAddr).|
|00000f40| 09 09 69 66 20 63 6f 70 | 79 28 6e 61 6d 65 2c 20 |..if cop|y(name, |
|00000f50| 31 2c 20 31 29 20 3d 20 | 27 24 27 20 74 68 65 6e |1, 1) = |'$' then|
|00000f60| 0d 09 09 09 6e 61 6d 65 | 20 3a 3d 20 27 27 0d 09 |....name| := ''..|
|00000f70| 09 65 6e 64 0d 09 09 70 | 72 69 6e 74 66 20 22 24 |.end...p|rintf "$|
|00000f80| 25 2e 38 58 20 20 25 73 | 5c 6e 22 2c 20 6c 6f 6e |%.8X %s|\n", lon|
|00000f90| 67 28 63 61 6c 6c 41 64 | 64 72 29 2c 20 6e 61 6d |g(callAd|dr), nam|
|00000fa0| 65 0d 09 65 6e 64 0d 09 | 69 66 20 6e 65 78 74 41 |e..end..|if nextA|
|00000fb0| 37 20 3e 3d 20 41 37 20 | 74 68 65 6e 0d 09 09 53 |7 >= A7 |then...S|
|00000fc0| 68 6f 77 46 72 61 6d 65 | 28 70 72 65 76 41 36 2c |howFrame|(prevA6,|
|00000fd0| 20 6e 65 78 74 41 37 29 | 0d 09 65 6e 64 0d 65 6e | nextA7)|..end.en|
|00000fe0| 64 0d 0d 23 20 54 68 65 | 20 6d 61 69 6e 20 65 6e |d..# The| main en|
|00000ff0| 74 72 79 20 70 6f 69 6e | 74 2e 0d 70 72 6f 63 20 |try poin|t..proc |
|00001000| 53 74 61 63 6b 43 72 61 | 77 6c 37 0d 09 43 68 65 |StackCra|wl7..Che|
|00001010| 63 6b 4e 75 6c 6c 54 61 | 72 67 65 74 0d 09 69 66 |ckNullTa|rget..if|
|00001020| 20 6e 6f 74 20 49 6e 69 | 74 53 43 37 28 29 20 74 | not Ini|tSC7() t|
|00001030| 68 65 6e 0d 09 09 61 6c | 65 72 74 20 22 44 61 6d |hen...al|ert "Dam|
|00001040| 61 67 65 64 20 73 74 61 | 63 6b 3a 5c 6e 41 37 20 |aged sta|ck:\nA7 |
|00001050| 6d 75 73 74 20 62 65 20 | 65 76 65 6e 20 61 6e 64 |must be |even and|
|00001060| 20 3c 3d 20 43 75 72 53 | 74 61 63 6b 42 61 73 65 | <= CurS|tackBase|
|00001070| 2e 22 0d 09 09 61 62 6f | 72 74 0d 09 65 6e 64 0d |."...abo|rt..end.|
|00001080| 09 70 72 69 6e 74 66 20 | 22 52 65 74 75 72 6e 20 |.printf |"Return |
|00001090| 61 64 64 72 65 73 73 65 | 73 20 6f 6e 20 74 68 65 |addresse|s on the|
|000010a0| 20 73 74 61 63 6b 5c 6e | 22 0d 09 70 72 69 6e 74 | stack\n|"..print|
|000010b0| 66 20 22 53 74 61 63 6b | 20 41 64 64 72 20 20 20 |f "Stack| Addr |
|000010c0| 20 46 72 61 6d 65 20 41 | 64 64 72 20 20 20 20 43 | Frame A|ddr C|
|000010d0| 61 6c 6c 65 72 5c 6e 22 | 0d 09 53 68 6f 77 46 72 |aller\n"|..ShowFr|
|000010e0| 61 6d 65 28 30 2c 20 43 | 75 72 53 74 61 63 6b 42 |ame(0, C|urStackB|
|000010f0| 61 73 65 20 2d 20 34 29 | 0d 65 6e 64 0d 0d 6d 61 |ase - 4)|.end..ma|
|00001100| 63 72 6f 20 73 63 37 09 | 27 53 74 61 63 6b 43 72 |cro sc7.|'StackCr|
|00001110| 61 77 6c 37 27 0d 00 00 | 00 00 00 00 00 00 00 00 |awl7'...|........|
|00001120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001180| 00 00 01 00 00 00 01 89 | 00 00 00 89 00 00 00 52 |........|.......R|
|00001190| ff ff ff ff ff ff ff ff | ff ff ff ff ff ff ff ff |........|........|
|000011a0| ff ff ff ff ff ff ff ff | ff ff ff ff ff ff ff ff |........|........|
|000011b0| 03 73 63 37 02 00 00 00 | 54 45 58 54 73 61 64 65 |.sc7....|TEXTsade|
|000011c0| 01 00 00 00 00 43 00 00 | 00 00 40 41 00 00 00 00 |.....C..|..@A....|
|000011d0| 00 00 54 45 58 54 73 61 | 64 65 01 00 00 00 00 43 |..TEXTsa|de.....C|
|000011e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011f0| 00 00 a6 83 2c 40 00 00 | 10 96 00 00 01 db 00 02 |....,@..|........|
|00001200| 80 08 00 02 40 08 00 02 | 20 08 00 02 10 08 00 03 |....@...| .......|
|00001210| f8 08 3f f0 08 08 00 00 | 08 08 3f f0 08 08 00 00 |..?.....|..?.....|
|00001220| 08 08 0f f8 08 08 00 00 | 08 08 1f f8 08 08 00 00 |........|........|
|00001230| 08 08 3f f0 08 08 00 00 | 08 08 0f f8 08 08 00 00 |..?.....|........|
|00001240| 08 08 1f f8 08 08 00 00 | 08 08 3f f0 08 08 00 00 |........|..?.....|
|00001250| 08 08 1f f8 08 08 00 00 | 08 08 3f 80 08 08 00 00 |........|..?.....|
|00001260| 08 08 00 00 08 08 00 00 | 08 08 00 00 08 08 00 00 |........|........|
|00001270| 08 0f ff ff f8 0f ff fe | 00 0f ff ff 00 0f ff ff |........|........|
|00001280| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 09 09 09 |...H..Mo|naco....|
|00001290| 00 18 fc 19 7f ff fc 19 | fc 18 fc 19 7f ff 00 03 |........|........|
|000012a0| 00 09 01 a8 7f ff 00 06 | 00 04 00 2a 00 03 01 42 |........|...*...B|
|000012b0| 01 e3 00 2a 00 03 01 42 | 01 e3 a6 83 2c 40 00 00 |...*...B|....,@..|
|000012c0| 00 00 00 00 00 00 00 00 | 00 00 01 00 00 00 00 1e |........|........|
|000012d0| 00 2a 00 03 01 42 01 e3 | 00 2a 00 03 01 42 01 e3 |.*...B..|.*...B..|
|000012e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012f0| 00 17 01 04 40 03 00 00 | 05 31 2e 34 61 33 0a 53 |....@...|.1.4a3.S|
|00001300| 41 44 45 20 31 2e 34 61 | 33 00 00 01 00 00 00 01 |ADE 1.4a|3.......|
|00001310| 89 00 00 00 89 00 00 00 | 52 00 56 a8 e0 19 b6 00 |........|R.V.....|
|00001320| 00 00 1c 00 52 00 01 4d | 50 53 52 00 01 00 12 76 |....R..M|PSR....v|
|00001330| 65 72 73 00 00 00 2a 03 | ed ff ff 00 00 00 00 00 |ers...*.|........|
|00001340| 00 00 00 03 f0 ff ff 00 | 00 00 4c 00 00 00 00 00 |........|..L.....|
|00001350| 02 ff ff 20 00 00 6e 00 | 56 a6 c4 00 00 00 00 00 |... ..n.|V.......|
|00001360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+