home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / progrmng / thinkc30.sit / profile.c.bin < prev    next >
MacBinary  |  1989-09-14  |  10.5 KB  |  [TEXT/KAHL]

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
66% dexvert AMOS Picture Packer (image/amosPicturePacker) ext Supported
1% dexvert Debian floppy split (archive/debianFloppySplit) ext Unsupported
1% dexvert Sound Images sound sample (audio/soundImagesSoundSample) ext Unsupported
1% dexvert DESI-III drawing (image/desiIIIDrawing) ext Unsupported
1% dexvert MS-DOS PMODE extender executable (executable/msdosPMODEExtenderExecutable) ext Unsupported
1% dexvert Alien Trilogytextures (other/alienTrilogyTextures) ext Unsupported
1% dexvert APT cache data (other/aptCacheData) ext Unsupported
1% dexvert CorelTRACE configuration (other/corelTRACEConfiguration) ext Unsupported
1% dexvert Dreamcast Disc (other/dreamcastDisc) ext Unsupported
1% dexvert EST flat binary (other/estFlatBinary) ext Unsupported
1% dexvert Finale Enigma Binary Format (other/finaleEnigmaBinaryFormat) ext Unsupported
1% dexvert Sega Genesis/Megadrive/32x ROM (other/genesisROM) ext Unsupported
1% dexvert Myth: The Fallen Lords game archive (other/mythTheFallenLordsGameArchive) ext Unsupported
1% dexvert Sound Images Sound Driver (other/soundImagesSoundDriver) ext Unsupported
1% dexvert Symantec/Norton Config (other/symantecNortonConfig) ext Unsupported
1% dexvert Vectrex ROM (other/vectrexROM) ext Unsupported
1% dexvert BIS raP encoded format (other/bisraPEncoded) ext Unsupported
1% dexvert Pascal Script binary (other/pascalScriptBinary) ext Unsupported
1% dexvert 7th Level game data archive (other/seventhLevelGameDataArchive) ext Unsupported
1% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Binary Text (image/binaryText) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary, Tue Feb 25 09:55:48 1986, modified Sun Jan 15 05:24:48 1989, creator Think C, type ASCII, 10567 bytes "profile.c" default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 1 default (weak)
100% lsar MacBinary default
100% gt2 MAC Bilddatei default (weak)


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 70 72 6f 66 69 6c | 65 2e 63 00 00 00 00 00 |..profil|e.c.....|
|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 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 29 47 00 | 00 00 00 9a 87 82 f4 9f |.....)G.|........|
|00000060| f6 21 f0 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.!......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000080| 2f 2a 0d 20 0d 20 20 50 | 72 6f 66 69 6c 65 20 61 |/*. . P|rofile a|
|00000090| 6e 64 20 74 72 61 63 69 | 6e 67 20 70 61 63 6b 61 |nd traci|ng packa|
|000000a0| 67 65 20 66 6f 72 20 4c | 69 67 68 74 73 70 65 65 |ge for L|ightspee|
|000000b0| 64 43 aa 2e 0d 20 20 0d | 20 20 28 43 29 20 43 6f |dC... .| (C) Co|
|000000c0| 70 79 72 69 67 68 74 20 | 31 39 38 36 20 54 48 49 |pyright |1986 THI|
|000000d0| 4e 4b 20 54 65 63 68 6e | 6f 6c 6f 67 69 65 73 2c |NK Techn|ologies,|
|000000e0| 20 49 6e 63 2e 20 20 41 | 6c 6c 20 72 69 67 68 74 | Inc. A|ll right|
|000000f0| 73 20 72 65 73 65 72 76 | 65 64 2e 0d 20 0d 20 2a |s reserv|ed.. . *|
|00000100| 2f 0d 20 0d 0d 23 69 6e | 63 6c 75 64 65 20 20 20 |/. ..#in|clude |
|00000110| 20 20 20 20 20 22 73 74 | 64 69 6f 2e 68 22 0d 23 | "st|dio.h".#|
|00000120| 69 6e 63 6c 75 64 65 20 | 09 09 22 44 65 76 69 63 |include |.."Devic|
|00000130| 65 4d 67 72 2e 68 22 0d | 20 0d 20 0d 74 79 70 65 |eMgr.h".| . .type|
|00000140| 64 65 66 20 75 6e 73 69 | 67 6e 65 64 20 63 68 61 |def unsi|gned cha|
|00000150| 72 20 20 20 42 6f 6f 6c | 3b 20 20 20 20 20 20 20 |r Bool|; |
|00000160| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 66 | | /* f|
|00000170| 6f 72 20 73 69 7a 65 20 | 20 20 20 20 20 20 20 20 |or size | |
|00000180| 20 20 20 20 20 20 20 20 | 20 2a 2f 0d 20 0d 74 79 | | */. .ty|
|00000190| 70 65 64 65 66 20 76 6f | 69 64 20 28 2a 61 64 64 |pedef vo|id (*add|
|000001a0| 72 65 73 73 29 28 29 3b | 09 09 09 09 09 09 2f 2a |ress)();|....../*|
|000001b0| 20 61 64 64 72 65 73 73 | 20 74 79 70 65 09 09 09 | address| type...|
|000001c0| 20 09 20 2a 2f 0d 74 79 | 70 65 64 65 66 20 75 6e | . */.ty|pedef un|
|000001d0| 73 69 67 6e 65 64 20 63 | 68 61 72 20 20 20 62 79 |signed c|har by|
|000001e0| 74 65 3b 0d 74 79 70 65 | 64 65 66 20 75 6e 73 69 |te;.type|def unsi|
|000001f0| 67 6e 65 64 20 6c 6f 6e | 67 20 20 20 74 69 6d 65 |gned lon|g time|
|00000200| 3b 0d 20 0d 74 79 70 65 | 64 65 66 20 73 74 72 75 |;. .type|def stru|
|00000210| 63 74 20 7b 0d 20 20 20 | 20 20 20 20 20 63 68 61 |ct {. | cha|
|00000220| 72 20 20 20 20 20 20 20 | 20 20 09 2a 6e 61 6d 65 |r | .*name|
|00000230| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|00000240| 20 20 20 2f 2a 20 66 75 | 6e 63 74 69 6f 6e 20 6e | /* fu|nction n|
|00000250| 61 6d 65 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ame | |
|00000260| 2a 2f 0d 20 20 20 20 20 | 20 20 20 74 69 6d 65 20 |*/. | time |
|00000270| 20 20 20 20 20 20 20 20 | 20 20 20 61 76 65 72 61 | | avera|
|00000280| 67 65 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ge; | |
|00000290| 20 20 20 2f 2a 20 61 76 | 65 72 61 67 65 20 74 69 | /* av|erage ti|
|000002a0| 6d 65 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |me | |
|000002b0| 2a 2f 0d 20 20 20 20 20 | 20 20 20 74 69 6d 65 20 |*/. | time |
|000002c0| 20 20 20 20 20 20 20 20 | 20 20 20 6d 61 78 69 6d | | maxim|
|000002d0| 75 6d 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |um; | |
|000002e0| 20 20 20 2f 2a 20 6c 61 | 72 67 65 73 74 20 74 69 | /* la|rgest ti|
|000002f0| 6d 65 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |me | |
|00000300| 2a 2f 0d 20 20 20 20 20 | 20 20 20 74 69 6d 65 20 |*/. | time |
|00000310| 20 20 20 20 20 20 20 20 | 20 20 20 6d 69 6e 69 6d | | minim|
|00000320| 75 6d 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |um; | |
|00000330| 20 20 20 2f 2a 20 73 6d | 61 6c 6c 65 73 74 20 74 | /* sm|allest t|
|00000340| 69 6d 65 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ime | |
|00000350| 2a 2f 0d 20 20 20 20 20 | 20 20 20 74 69 6d 65 20 |*/. | time |
|00000360| 20 20 20 20 20 20 20 20 | 20 20 20 74 6f 74 61 6c | | total|
|00000370| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|00000380| 20 20 20 2f 2a 20 74 6f | 74 61 6c 20 74 69 6d 65 | /* to|tal time|
|00000390| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000003a0| 2a 2f 0d 20 20 20 20 20 | 20 20 20 75 6e 73 69 67 |*/. | unsig|
|000003b0| 6e 65 64 20 69 6e 74 20 | 20 20 20 65 6e 74 72 69 |ned int | entri|
|000003c0| 65 73 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |es; | |
|000003d0| 20 20 20 2f 2a 20 74 69 | 6d 65 73 20 65 6e 74 65 | /* ti|mes ente|
|000003e0| 72 65 64 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |red | |
|000003f0| 2a 2f 0d 20 20 20 20 20 | 20 20 20 7d 20 50 52 4f |*/. | } PRO|
|00000400| 46 49 4c 45 3b 0d 20 0d | 74 79 70 65 64 65 66 20 |FILE;. .|typedef |
|00000410| 73 74 72 75 63 74 20 7b | 0d 20 20 20 20 20 20 20 |struct {|. |
|00000420| 20 61 64 64 72 65 73 73 | 20 20 20 20 20 20 20 20 | address| |
|00000430| 20 75 73 65 72 3b 20 20 | 20 20 20 20 20 20 20 20 | user; | |
|00000440| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 75 73 65 72 | | /* user|
|00000450| 20 72 65 74 75 72 6e 20 | 61 64 64 72 65 73 73 20 | return |address |
|00000460| 20 20 20 20 20 20 2a 2f | 0d 20 20 20 20 20 20 20 | */|. |
|00000470| 20 69 6e 74 20 20 20 20 | 20 20 20 20 20 20 20 20 | int | |
|00000480| 20 66 75 6e 63 74 69 6f | 6e 3b 20 20 20 20 20 20 | functio|n; |
|00000490| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 69 6e 64 65 | | /* inde|
|000004a0| 78 20 69 6e 74 6f 20 70 | 72 6f 66 69 6c 65 73 20 |x into p|rofiles |
|000004b0| 20 20 20 20 20 20 2a 2f | 0d 20 20 20 20 20 20 20 | */|. |
|000004c0| 20 74 69 6d 65 20 20 20 | 20 20 20 20 20 20 20 20 | time | |
|000004d0| 20 63 6f 72 72 65 63 74 | 69 6f 6e 3b 20 20 20 20 | correct|ion; |
|000004e0| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 6e 65 73 74 | | /* nest|
|000004f0| 65 64 20 63 61 6c 6c 20 | 74 69 6d 65 20 20 20 20 |ed call |time |
|00000500| 20 20 20 20 20 20 2a 2f | 0d 20 20 20 20 20 20 20 | */|. |
|00000510| 20 74 69 6d 65 20 20 20 | 20 20 20 20 20 20 20 20 | time | |
|00000520| 20 73 74 61 72 74 3b 20 | 20 20 20 20 20 20 20 20 | start; | |
|00000530| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 65 6e 74 72 | | /* entr|
|00000540| 79 20 74 69 6d 65 20 20 | 20 20 20 20 20 20 20 20 |y time | |
|00000550| 20 20 20 20 20 20 2a 2f | 0d 20 20 20 20 20 20 20 | */|. |
|00000560| 20 7d 20 53 54 41 43 4b | 3b 0d 20 0d 23 64 65 66 | } STACK|;. .#def|
|00000570| 69 6e 65 20 4c 4f 43 41 | 4c 20 20 20 20 20 20 20 |ine LOCA|L |
|00000580| 20 20 20 20 73 74 61 74 | 69 63 20 20 20 20 20 20 | stat|ic |
|00000590| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 6c | | /* l|
|000005a0| 6f 63 61 6c 20 74 6f 20 | 70 72 6f 66 69 6c 65 72 |ocal to |profiler|
|000005b0| 20 20 20 20 20 20 20 20 | 20 2a 2f 0d 23 64 65 66 | | */.#def|
|000005c0| 69 6e 65 20 4d 41 58 5f | 50 52 4f 46 49 4c 45 53 |ine MAX_|PROFILES|
|000005d0| 20 20 20 20 20 20 20 32 | 30 30 20 20 20 20 20 20 | 2|00 |
|000005e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 72 | | /* r|
|000005f0| 6f 75 74 69 6e 65 73 20 | 74 6f 20 66 6f 6c 6c 6f |outines |to follo|
|00000600| 77 20 20 20 20 20 20 20 | 20 2a 2f 0d 23 64 65 66 |w | */.#def|
|00000610| 69 6e 65 20 4d 41 58 5f | 53 54 41 43 4b 20 20 20 |ine MAX_|STACK |
|00000620| 20 20 20 20 20 20 20 32 | 30 30 20 20 20 20 20 20 | 2|00 |
|00000630| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 6d | | /* m|
|00000640| 61 78 20 6e 65 73 74 65 | 64 20 63 61 6c 6c 73 20 |ax neste|d calls |
|00000650| 20 20 20 20 20 20 20 20 | 20 2a 2f 0d 23 64 65 66 | | */.#def|
|00000660| 69 6e 65 20 4d 41 58 5f | 54 49 4d 45 20 20 20 20 |ine MAX_|TIME |
|00000670| 20 20 20 20 35 30 30 30 | 30 30 4c 20 20 20 20 20 | 5000|00L |
|00000680| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 6d | | /* m|
|00000690| 61 78 20 74 69 6d 65 20 | 20 20 20 20 20 20 20 20 |ax time | |
|000006a0| 20 20 20 20 20 20 20 20 | 20 2a 2f 0d 20 0d 2f 2a | | */. ./*|
|000006b0| 0d 20 0d 20 20 20 20 20 | 20 20 20 53 65 6c 65 63 |. . | Selec|
|000006c0| 74 20 65 78 65 63 75 74 | 69 6f 6e 2f 63 6f 6d 70 |t execut|ion/comp|
|000006d0| 69 6c 61 74 69 6f 6e 20 | 6f 70 74 69 6f 6e 73 2e |ilation |options.|
|000006e0| 0d 20 0d 20 20 20 20 20 | 20 20 20 53 49 4e 47 4c |. . | SINGL|
|000006f0| 45 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |E | |
|00000700| 20 20 20 2d 20 65 61 63 | 68 20 72 6f 75 74 69 6e | - eac|h routin|
|00000710| 65 20 63 6f 6e 74 61 69 | 6e 73 20 6f 6e 6c 79 20 |e contai|ns only |
|00000720| 69 74 73 20 74 69 6d 65 | 0d 20 20 20 20 20 20 20 |its time|. |
|00000730| 20 54 45 53 54 49 4e 47 | 20 20 20 20 20 20 20 20 | TESTING| |
|00000740| 20 20 20 20 20 20 20 20 | 20 2d 20 74 65 73 74 20 | | - test |
|00000750| 70 72 6f 66 69 6c 65 20 | 70 61 63 6b 61 67 65 20 |profile |package |
|00000760| 77 69 74 68 6f 75 74 20 | 4c 69 67 68 74 73 70 65 |without |Lightspe|
|00000770| 65 64 43 20 50 52 4f 46 | 49 4c 45 20 6f 70 74 69 |edC PROF|ILE opti|
|00000780| 6f 6e 0d 20 0d 20 2a 2f | 0d 20 0d 23 64 65 66 69 |on. . */|. .#defi|
|00000790| 6e 65 20 53 49 4e 47 4c | 45 20 20 20 20 20 20 20 |ne SINGL|E |
|000007a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000007b0| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 73 69 | | /* si|
|000007c0| 6e 67 6c 65 20 72 6f 75 | 74 69 6e 65 20 6f 6e 6c |ngle rou|tine onl|
|000007d0| 79 20 20 20 20 20 20 20 | 2a 2f 0d 2f 2a 20 23 64 |y |*/./* #d|
|000007e0| 65 66 69 6e 65 20 54 45 | 53 54 49 4e 47 20 20 20 |efine TE|STING |
|000007f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000800| 20 20 20 20 20 20 20 20 | 20 20 20 73 74 61 6e 64 | | stand|
|00000810| 61 6c 6f 6e 65 20 74 65 | 73 74 69 6e 67 20 20 20 |alone te|sting |
|00000820| 2a 2f 0d 20 0d 20 0d 23 | 69 66 64 65 66 20 20 54 |*/. . .#|ifdef T|
|00000830| 45 53 54 49 4e 47 0d 23 | 75 6e 64 65 66 20 20 4c |ESTING.#|undef L|
|00000840| 4f 43 41 4c 20 20 20 20 | 20 20 20 20 20 20 20 20 |OCAL | |
|00000850| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000860| 20 20 20 20 20 20 20 2f | 2a 20 6d 61 6b 65 20 69 | /|* make i|
|00000870| 74 65 6d 73 20 76 69 73 | 69 62 6c 65 20 20 20 20 |tems vis|ible |
|00000880| 20 20 20 20 2a 2f 0d 23 | 64 65 66 69 6e 65 20 4c | */.#|define L|
|00000890| 4f 43 41 4c 0d 23 65 6e | 64 69 66 0d 20 0d 20 0d |OCAL.#en|dif. . .|
|000008a0| 20 0d 4c 4f 43 41 4c 20 | 69 6e 74 20 20 20 20 20 | .LOCAL |int |
|000008b0| 20 20 20 20 20 20 20 20 | 20 20 64 65 70 74 68 20 | | depth |
|000008c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000008d0| 20 20 3d 20 2d 31 3b 0d | 4c 4f 43 41 4c 20 50 52 | = -1;.|LOCAL PR|
|000008e0| 4f 46 49 4c 45 20 20 20 | 20 20 20 20 20 20 20 20 |OFILE | |
|000008f0| 70 72 6f 66 69 6c 65 73 | 5b 4d 41 58 5f 50 52 4f |profiles|[MAX_PRO|
|00000900| 46 49 4c 45 53 5d 3b 0d | 4c 4f 43 41 4c 20 69 6e |FILES];.|LOCAL in|
|00000910| 74 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |t | |
|00000920| 70 72 6f 66 69 6c 65 5f | 63 6f 75 6e 74 20 20 20 |profile_|count |
|00000930| 20 20 20 20 20 20 20 20 | 3d 20 20 30 3b 0d 4c 4f | |= 0;.LO|
|00000940| 43 41 4c 20 53 54 41 43 | 4b 20 20 20 20 20 20 20 |CAL STAC|K |
|00000950| 20 20 20 20 20 20 73 74 | 61 63 6b 5b 4d 41 58 5f | st|ack[MAX_|
|00000960| 53 54 41 43 4b 5d 3b 0d | 4c 4f 43 41 4c 20 69 6e |STACK];.|LOCAL in|
|00000970| 74 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |t | |
|00000980| 73 74 61 63 6b 5f 70 6f | 69 6e 74 65 72 20 20 20 |stack_po|inter |
|00000990| 20 20 20 20 20 20 20 20 | 3d 20 2d 31 3b 0d 4c 4f | |= -1;.LO|
|000009a0| 43 41 4c 20 74 69 6d 65 | 20 20 20 20 20 20 20 20 |CAL time| |
|000009b0| 20 20 20 20 20 20 73 74 | 61 72 74 5f 74 69 6d 65 | st|art_time|
|000009c0| 3b 0d 20 0d 69 6e 74 20 | 20 20 20 20 20 20 20 20 |;. .int | |
|000009d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 5f 70 72 6f | | _pro|
|000009e0| 66 69 6c 65 20 20 20 20 | 20 20 20 20 20 20 20 20 |file | |
|000009f0| 20 20 20 20 3d 20 20 31 | 3b 20 0d 69 6e 74 20 20 | = 1|; .int |
|00000a00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000a10| 20 20 20 5f 74 72 61 63 | 65 20 20 20 20 20 20 20 | _trac|e |
|00000a20| 20 20 20 20 20 20 20 20 | 20 20 20 3d 20 20 30 3b | | = 0;|
|00000a30| 0d 20 0d 76 6f 69 64 09 | 44 75 6d 70 50 72 6f 66 |. .void.|DumpProf|
|00000a40| 69 6c 65 28 29 3b 0d 65 | 78 74 65 72 6e 09 5f 70 |ile();.e|xtern._p|
|00000a50| 72 6f 66 69 6c 65 5f 65 | 78 69 74 5f 28 29 3b 0d |rofile_e|xit_();.|
|00000a60| 65 78 74 65 72 6e 20 20 | 63 68 61 72 20 2a 43 74 |extern |char *Ct|
|00000a70| 6f 50 73 74 72 28 29 3b | 0d 65 78 74 65 72 6e 20 |oPstr();|.extern |
|00000a80| 20 63 68 61 72 20 2a 50 | 74 6f 43 73 74 72 28 29 | char *P|toCstr()|
|00000a90| 3b 0d 0d 23 64 65 66 69 | 6e 65 20 5f 56 49 41 54 |;..#defi|ne _VIAT|
|00000aa0| 49 4d 45 52 5f 09 2f 2a | 20 69 66 20 74 68 69 73 |IMER_./*| if this|
|00000ab0| 20 73 79 6d 62 6f 6c 20 | 69 73 20 64 65 66 69 6e | symbol |is defin|
|00000ac0| 65 64 2c 20 74 68 65 20 | 56 49 41 20 74 69 6d 65 |ed, the |VIA time|
|00000ad0| 72 20 6e 6f 77 20 69 73 | 20 75 73 65 64 0d 09 09 |r now is| used...|
|00000ae0| 09 09 09 09 69 6e 73 74 | 65 61 64 20 6f 66 20 54 |....inst|ead of T|
|00000af0| 69 63 6b 43 6f 75 6e 74 | 20 2d 2d 20 69 74 20 70 |ickCount| -- it p|
|00000b00| 72 6f 76 69 64 65 73 20 | 66 61 73 74 65 72 20 74 |rovides |faster t|
|00000b10| 69 63 6b 73 2c 0d 09 09 | 09 09 09 09 68 6f 77 65 |icks,...|....howe|
|00000b20| 76 65 72 20 74 68 65 72 | 65 20 69 73 20 61 20 66 |ver ther|e is a f|
|00000b30| 61 6c 73 65 20 70 72 65 | 63 69 73 69 6f 6e 20 74 |alse pre|cision t|
|00000b40| 6f 20 74 68 65 20 6e 75 | 6d 62 65 72 73 0d 09 09 |o the nu|mbers...|
|00000b50| 09 09 09 09 61 6e 64 20 | 74 68 65 72 65 20 69 73 |....and |there is|
|00000b60| 20 61 20 72 61 6e 67 65 | 20 6f 66 20 2b 20 6f 72 | a range| of + or|
|00000b70| 20 2d 20 35 30 30 20 74 | 69 63 6b 73 20 73 69 6e | - 500 t|icks sin|
|00000b80| 63 65 0d 09 09 09 09 09 | 09 74 68 65 20 56 49 41 |ce......|.the VIA|
|00000b90| 74 69 6d 65 72 20 69 73 | 20 73 6f 20 66 61 73 74 |timer is| so fast|
|00000ba0| 20 74 68 61 74 20 69 6e | 74 65 72 72 75 70 74 73 | that in|terrupts|
|00000bb0| 20 61 6e 64 20 73 75 63 | 68 0d 09 09 09 09 09 09 | and suc|h.......|
|00000bc0| 70 6c 61 79 20 61 20 6d | 6f 72 65 20 73 69 67 6e |play a m|ore sign|
|00000bd0| 69 66 69 63 61 6e 74 20 | 74 69 6d 65 20 72 6f 6c |ificant |time rol|
|00000be0| 65 2e 0d 09 09 09 09 09 | 09 0d 09 09 09 09 09 09 |e.......|........|
|00000bf0| 4e 4f 54 45 20 54 48 41 | 54 20 54 48 49 53 20 50 |NOTE THA|T THIS P|
|00000c00| 52 4f 46 49 4c 45 20 4f | 50 54 49 4f 4e 20 43 41 |ROFILE O|PTION CA|
|00000c10| 4e 4e 4f 54 20 42 45 20 | 55 53 45 44 20 57 49 54 |NNOT BE |USED WIT|
|00000c20| 48 0d 09 09 09 09 09 09 | 41 4e 59 20 50 52 4f 47 |H.......|ANY PROG|
|00000c30| 52 41 4d 20 54 48 41 54 | 20 4d 41 4e 49 50 55 4c |RAM THAT| MANIPUL|
|00000c40| 41 54 45 53 20 54 48 45 | 20 23 31 20 56 49 41 20 |ATES THE| #1 VIA |
|00000c50| 74 69 6d 65 72 20 2a 2f | 0d 09 09 09 09 09 09 0d |timer */|........|
|00000c60| 0d 23 69 66 64 65 66 09 | 5f 56 49 41 54 49 4d 45 |.#ifdef.|_VIATIME|
|00000c70| 52 5f 0d 0d 2f 2a 20 54 | 69 63 6b 43 6f 75 6e 74 |R_../* T|ickCount|
|00000c80| 28 29 20 2d 20 72 65 64 | 65 66 69 6e 65 20 54 69 |() - red|efine Ti|
|00000c90| 63 6b 43 6f 75 6e 74 20 | 74 72 61 70 20 74 6f 20 |ckCount |trap to |
|00000ca0| 62 65 20 61 20 70 72 6f | 63 65 64 75 72 65 20 66 |be a pro|cedure f|
|00000cb0| 6f 72 20 64 65 74 65 72 | 6d 69 6e 69 6e 67 0d 09 |or deter|mining..|
|00000cc0| 09 09 09 20 74 68 65 20 | 74 69 6d 69 6e 67 20 61 |... the |timing a|
|00000cd0| 63 63 6f 72 64 69 6e 67 | 20 74 6f 20 74 68 65 20 |ccording| to the |
|00000ce0| 56 49 41 20 74 69 6d 65 | 72 20 2a 2f 0d 0d 23 64 |VIA time|r */..#d|
|00000cf0| 65 66 69 6e 65 09 56 49 | 41 62 61 73 65 09 28 2a |efine.VI|Abase.(*|
|00000d00| 28 28 75 6e 73 69 67 6e | 65 64 20 63 68 61 72 2a |((unsign|ed char*|
|00000d10| 2a 29 30 78 30 31 44 34 | 29 29 0d 23 64 65 66 69 |*)0x01D4|)).#defi|
|00000d20| 6e 65 09 56 49 41 74 31 | 6c 6f 09 28 2a 28 56 49 |ne.VIAt1|lo.(*(VI|
|00000d30| 41 62 61 73 65 2b 35 31 | 32 2a 34 29 29 0d 23 64 |Abase+51|2*4)).#d|
|00000d40| 65 66 69 6e 65 09 56 49 | 41 74 31 68 69 09 28 2a |efine.VI|At1hi.(*|
|00000d50| 28 56 49 41 62 61 73 65 | 2b 35 31 32 2a 35 29 29 |(VIAbase|+512*5))|
|00000d60| 0d 23 64 65 66 69 6e 65 | 09 56 49 41 45 6e 61 62 |.#define|.VIAEnab|
|00000d70| 6c 65 20 28 2a 28 28 75 | 6e 73 69 67 6e 65 64 20 |le (*((u|nsigned |
|00000d80| 63 68 61 72 20 2a 29 20 | 28 28 6c 6f 6e 67 29 56 |char *) |((long)V|
|00000d90| 49 41 20 2b 20 30 78 31 | 43 30 30 29 29 29 0d 23 |IA + 0x1|C00))).#|
|00000da0| 64 65 66 69 6e 65 09 56 | 49 41 6d 61 78 74 69 6d |define.V|IAmaxtim|
|00000db0| 65 09 7e 30 0d 23 64 65 | 66 69 6e 65 20 50 72 6f |e.~0.#de|fine Pro|
|00000dc0| 63 41 64 64 72 28 78 29 | 20 28 2a 28 50 72 6f 63 |cAddr(x)| (*(Proc|
|00000dd0| 50 74 72 20 2a 29 26 28 | 28 73 68 6f 72 74 20 2a |Ptr *)&(|(short *|
|00000de0| 29 28 78 29 29 5b 31 5d | 29 0d 0d 74 69 6d 65 20 |)(x))[1]|)..time |
|00000df0| 74 69 6d 65 72 3d 30 3b | 0d 50 72 6f 63 50 74 72 |timer=0;|.ProcPtr|
|00000e00| 20 73 61 76 65 50 74 72 | 3b 0d 75 6e 73 69 67 6e | savePtr|;.unsign|
|00000e10| 65 64 20 63 68 61 72 20 | 73 61 76 65 45 6e 61 62 |ed char |saveEnab|
|00000e20| 6c 65 3b 0d 0d 70 61 73 | 63 61 6c 20 76 6f 69 64 |le;..pas|cal void|
|00000e30| 20 52 6f 6c 6c 6f 76 65 | 72 28 29 0d 7b 0d 09 53 | Rollove|r().{..S|
|00000e40| 65 74 55 70 41 35 28 29 | 3b 0d 09 74 69 6d 65 72 |etUpA5()|;..timer|
|00000e50| 20 2b 3d 20 36 35 35 33 | 36 3b 0d 09 56 49 41 74 | += 6553|6;..VIAt|
|00000e60| 31 68 69 20 3d 20 56 49 | 41 6d 61 78 74 69 6d 65 |1hi = VI|Amaxtime|
|00000e70| 3b 0d 09 56 49 41 74 31 | 6c 6f 20 3d 20 56 49 41 |;..VIAt1|lo = VIA|
|00000e80| 6d 61 78 74 69 6d 65 3b | 0d 09 52 65 73 74 6f 72 |maxtime;|..Restor|
|00000e90| 65 41 35 28 29 3b 0d 7d | 0d 0d 76 6f 69 64 20 52 |eA5();.}|..void R|
|00000ea0| 65 6d 6f 76 65 5f 52 6f | 6c 6c 6f 76 65 72 28 29 |emove_Ro|llover()|
|00000eb0| 0d 7b 0d 09 69 66 20 28 | 28 73 61 76 65 45 6e 61 |.{..if (|(saveEna|
|00000ec0| 62 6c 65 26 30 78 34 30 | 29 3d 3d 30 29 20 56 49 |ble&0x40|)==0) VI|
|00000ed0| 41 45 6e 61 62 6c 65 20 | 3d 20 30 78 34 30 3b 0d |AEnable |= 0x40;.|
|00000ee0| 09 4c 76 6c 31 44 54 5b | 36 5d 20 3d 20 73 61 76 |.Lvl1DT[|6] = sav|
|00000ef0| 65 50 74 72 3b 0d 7d 0d | 0d 74 69 6d 65 20 54 69 |ePtr;.}.|.time Ti|
|00000f00| 63 6b 43 6f 75 6e 74 28 | 29 0d 7b 0d 0d 09 69 66 |ckCount(|).{...if|
|00000f10| 20 28 74 69 6d 65 72 20 | 3e 20 30 29 0d 09 7b 0d | (timer |> 0)..{.|
|00000f20| 09 09 2f 2a 20 55 73 65 | 20 56 49 41 20 74 69 6d |../* Use| VIA tim|
|00000f30| 65 72 20 23 31 20 28 73 | 6f 75 6e 64 20 64 72 69 |er #1 (s|ound dri|
|00000f40| 76 65 72 29 20 61 6e 64 | 20 74 6f 20 69 6d 70 6c |ver) and| to impl|
|00000f50| 65 6d 65 6e 74 20 61 20 | 66 69 6e 65 0d 09 09 09 |ement a |fine....|
|00000f60| 72 65 73 6f 6c 75 74 69 | 6f 6e 20 63 6f 75 6e 74 |resoluti|on count|
|00000f70| 65 72 20 2a 2f 0d 09 09 | 0d 09 09 2f 2a 20 46 69 |er */...|.../* Fi|
|00000f80| 6e 64 20 64 65 6c 74 61 | 20 6f 66 20 56 49 41 20 |nd delta| of VIA |
|00000f90| 23 31 20 2a 2f 0d 09 09 | 0d 09 09 74 69 6d 65 72 |#1 */...|...timer|
|00000fa0| 20 2b 3d 20 56 49 41 6d | 61 78 74 69 6d 65 20 2d | += VIAm|axtime -|
|00000fb0| 20 28 28 28 75 6e 73 69 | 67 6e 65 64 20 73 68 6f | (((unsi|gned sho|
|00000fc0| 72 74 29 56 49 41 74 31 | 68 69 3c 3c 38 29 2b 56 |rt)VIAt1|hi<<8)+V|
|00000fd0| 49 41 74 31 6c 6f 29 3b | 0d 09 7d 0d 09 65 6c 73 |IAt1lo);|..}..els|
|00000fe0| 65 20 7b 0d 09 09 2f 2a | 20 69 6e 69 74 69 61 6c |e {.../*| initial|
|00000ff0| 69 7a 65 20 70 72 6f 66 | 69 6c 69 6e 67 20 69 6e |ize prof|iling in|
|00001000| 74 65 72 72 75 70 74 3a | 20 2a 2f 0d 09 09 73 61 |terrupt:| */...sa|
|00001010| 76 65 50 74 72 20 3d 20 | 4c 76 6c 31 44 54 5b 36 |vePtr = |Lvl1DT[6|
|00001020| 5d 3b 0d 09 09 4c 76 6c | 31 44 54 5b 36 5d 20 3d |];...Lvl|1DT[6] =|
|00001030| 20 50 72 6f 63 41 64 64 | 72 28 52 6f 6c 6c 6f 76 | ProcAdd|r(Rollov|
|00001040| 65 72 29 3b 0d 09 09 73 | 61 76 65 45 6e 61 62 6c |er);...s|aveEnabl|
|00001050| 65 20 3d 20 56 49 41 45 | 6e 61 62 6c 65 3b 0d 09 |e = VIAE|nable;..|
|00001060| 09 56 49 41 45 6e 61 62 | 6c 65 20 7c 3d 20 30 78 |.VIAEnab|le |= 0x|
|00001070| 34 30 3b 0d 0d 09 09 5f | 6f 6e 65 78 69 74 28 20 |40;...._|onexit( |
|00001080| 52 65 6d 6f 76 65 5f 52 | 6f 6c 6c 6f 76 65 72 20 |Remove_R|ollover |
|00001090| 29 3b 0d 09 09 74 69 6d | 65 72 20 3d 20 31 3b 0d |);...tim|er = 1;.|
|000010a0| 09 7d 0d 09 0d 09 2f 2a | 20 52 65 73 65 74 20 56 |.}..../*| Reset V|
|000010b0| 49 41 20 63 6f 75 6e 74 | 65 72 20 2a 2f 0d 09 0d |IA count|er */...|
|000010c0| 09 56 49 41 74 31 68 69 | 20 3d 20 56 49 41 6d 61 |.VIAt1hi| = VIAma|
|000010d0| 78 74 69 6d 65 3b 0d 09 | 56 49 41 74 31 6c 6f 20 |xtime;..|VIAt1lo |
|000010e0| 3d 20 56 49 41 6d 61 78 | 74 69 6d 65 3b 0d 09 0d |= VIAmax|time;...|
|000010f0| 09 72 65 74 75 72 6e 20 | 28 74 69 6d 65 72 29 3b |.return |(timer);|
|00001100| 0d 7d 0d 0d 23 65 6e 64 | 69 66 20 5f 56 49 41 54 |.}..#end|if _VIAT|
|00001110| 49 4d 45 52 5f 0d 0d 0d | 2f 2a 0d 20 0d 20 20 43 |IMER_...|/*. . C|
|00001120| 6f 6d 70 61 72 65 20 74 | 77 6f 20 50 61 73 63 61 |ompare t|wo Pasca|
|00001130| 6c 20 73 74 72 69 6e 67 | 73 20 66 6f 72 20 65 71 |l string|s for eq|
|00001140| 75 61 6c 69 74 79 2e 0d | 20 0d 20 2a 2f 0d 0d 4c |uality..| . */..L|
|00001150| 4f 43 41 4c 20 42 6f 6f | 6c 20 70 73 74 72 65 71 |OCAL Boo|l pstreq|
|00001160| 28 20 73 31 2c 20 73 32 | 20 29 0d 72 65 67 69 73 |( s1, s2| ).regis|
|00001170| 74 65 72 20 75 6e 73 69 | 67 6e 65 64 20 63 68 61 |ter unsi|gned cha|
|00001180| 72 09 2a 73 31 2c 20 2a | 73 32 3b 0d 7b 0d 20 20 |r.*s1, *|s2;.{. |
|00001190| 72 65 67 69 73 74 65 72 | 20 69 6e 74 09 09 09 6e |register| int...n|
|000011a0| 20 3d 20 2a 73 31 3b 0d | 20 20 0d 20 20 69 66 20 | = *s1;.| . if |
|000011b0| 28 28 6e 20 3d 20 2a 73 | 31 2b 2b 29 20 21 3d 20 |((n = *s|1++) != |
|000011c0| 2a 73 32 2b 2b 29 0d 20 | 20 20 20 72 65 74 75 72 |*s2++). | retur|
|000011d0| 6e 28 20 66 61 6c 73 65 | 20 29 3b 0d 20 20 77 68 |n( false| );. wh|
|000011e0| 69 6c 65 20 28 6e 2d 2d | 20 3e 20 30 29 0d 20 20 |ile (n--| > 0). |
|000011f0| 20 20 69 66 20 28 2a 73 | 31 2b 2b 20 21 3d 20 2a | if (*s|1++ != *|
|00001200| 73 32 2b 2b 29 0d 20 20 | 20 20 20 20 72 65 74 75 |s2++). | retu|
|00001210| 72 6e 28 20 66 61 6c 73 | 65 20 29 3b 0d 20 20 72 |rn( fals|e );. r|
|00001220| 65 74 75 72 6e 28 20 74 | 72 75 65 20 29 3b 0d 7d |eturn( t|rue );.}|
|00001230| 0d 0d 0d 2f 2a 0d 20 0d | 20 20 52 65 74 75 72 6e |.../*. .| Return|
|00001240| 20 74 68 65 20 74 69 6d | 65 20 64 69 66 66 65 72 | the tim|e differ|
|00001250| 65 6e 63 65 20 63 61 75 | 73 65 64 20 62 79 20 74 |ence cau|sed by t|
|00001260| 68 65 20 6f 76 65 72 68 | 65 61 64 20 6f 66 20 66 |he overh|ead of f|
|00001270| 75 6e 63 74 69 6f 6e 20 | 65 6e 74 72 79 20 61 6e |unction |entry an|
|00001280| 64 0d 20 20 74 69 6d 65 | 72 20 63 61 6c 6c 2e 0d |d. time|r call..|
|00001290| 20 0d 20 2a 2f 0d 20 0d | 4c 4f 43 41 4c 20 74 69 | . */. .|LOCAL ti|
|000012a0| 6d 65 20 64 65 6c 74 61 | 28 20 6f 72 69 67 69 6e |me delta|( origin|
|000012b0| 61 6c 20 29 0d 74 69 6d | 65 20 20 20 20 20 20 20 |al ).tim|e |
|000012c0| 20 20 20 20 20 6f 72 69 | 67 69 6e 61 6c 3b 0d 7b | ori|ginal;.{|
|000012d0| 0d 2f 2a 09 72 65 74 75 | 72 6e 28 20 28 74 69 6d |./*.retu|rn( (tim|
|000012e0| 65 29 20 54 69 63 6b 43 | 6f 75 6e 74 28 29 20 2d |e) TickC|ount() -|
|000012f0| 20 6f 72 69 67 69 6e 61 | 6c 20 29 3b 20 2a 2f 0d | origina|l ); */.|
|00001300| 09 72 65 74 75 72 6e 28 | 30 4c 29 3b 0d 7d 0d 20 |.return(|0L);.}. |
|00001310| 0d 20 0d 2f 2a 0d 20 0d | 20 20 4c 6f 6f 6b 75 70 |. ./*. .| Lookup|
|00001320| 20 61 20 6e 61 6d 65 20 | 69 6e 20 74 68 65 20 61 | a name |in the a|
|00001330| 63 74 69 76 65 20 70 72 | 6f 66 69 6c 65 20 74 61 |ctive pr|ofile ta|
|00001340| 62 6c 65 2e 20 20 46 6f | 72 20 74 68 69 73 20 73 |ble. Fo|r this s|
|00001350| 79 73 74 65 6d 2c 20 22 | 6e 61 6d 65 73 22 20 61 |ystem, "|names" a|
|00001360| 72 65 0d 20 20 74 68 65 | 20 61 64 64 72 65 73 73 |re. the| address|
|00001370| 20 6f 66 20 74 68 65 20 | 72 6f 75 74 69 6e 65 2e | of the |routine.|
|00001380| 20 20 49 66 20 74 68 65 | 20 6e 61 6d 65 20 69 73 | If the| name is|
|00001390| 20 66 6f 75 6e 64 20 69 | 6e 20 74 68 65 20 74 61 | found i|n the ta|
|000013a0| 62 6c 65 2c 20 74 68 65 | 6e 20 74 68 65 0d 20 20 |ble, the|n the. |
|000013b0| 69 6e 64 65 78 20 74 6f | 20 74 68 65 20 74 61 62 |index to| the tab|
|000013c0| 6c 65 20 65 6e 74 72 79 | 20 69 73 20 72 65 74 75 |le entry| is retu|
|000013d0| 72 6e 65 64 2e 20 20 49 | 66 20 74 68 65 20 6e 61 |rned. I|f the na|
|000013e0| 6d 65 20 69 73 20 6e 6f | 74 20 66 6f 75 6e 64 20 |me is no|t found |
|000013f0| 61 6e 64 20 74 68 65 0d | 20 20 69 6e 73 65 72 74 |and the.| insert|
|00001400| 20 66 6c 61 67 20 69 73 | 20 6f 6e 2c 20 74 68 65 | flag is| on, the|
|00001410| 6e 20 74 68 65 20 69 74 | 65 6d 20 69 73 20 69 6e |n the it|em is in|
|00001420| 73 65 72 74 65 64 2c 20 | 61 6e 64 20 74 68 65 20 |serted, |and the |
|00001430| 6e 65 77 20 74 61 62 6c | 65 20 69 6e 64 65 78 0d |new tabl|e index.|
|00001440| 20 20 69 73 20 72 65 74 | 75 72 6e 65 64 20 28 69 | is ret|urned (i|
|00001450| 66 20 69 6e 73 65 72 74 | 20 69 73 20 66 61 6c 73 |f insert| is fals|
|00001460| 65 2c 20 74 68 65 6e 20 | 2d 31 20 69 73 20 72 65 |e, then |-1 is re|
|00001470| 74 75 72 6e 65 64 29 2e | 20 20 49 66 20 74 68 65 |turned).| If the|
|00001480| 20 70 72 6f 66 69 6c 65 | 0d 20 20 74 61 62 6c 65 | profile|. table|
|00001490| 20 69 73 20 66 75 6c 6c | 2c 20 74 68 65 6e 20 2d | is full|, then -|
|000014a0| 31 20 69 73 20 72 65 74 | 75 72 6e 65 64 2e 0d 20 |1 is ret|urned.. |
|000014b0| 0d 20 2a 2f 0d 20 0d 4c | 4f 43 41 4c 20 69 6e 74 |. */. .L|OCAL int|
|000014c0| 20 6c 6f 6f 6b 75 70 28 | 20 6e 61 6d 65 2c 20 69 | lookup(| name, i|
|000014d0| 6e 73 65 72 74 20 29 0d | 63 68 61 72 20 20 20 20 |nsert ).|char |
|000014e0| 20 20 20 20 20 09 2a 6e | 61 6d 65 3b 0d 42 6f 6f | .*n|ame;.Boo|
|000014f0| 6c 20 20 20 20 20 20 20 | 20 20 20 20 20 69 6e 73 |l | ins|
|00001500| 65 72 74 3b 0d 7b 0d 20 | 20 72 65 67 69 73 74 65 |ert;.{. | registe|
|00001510| 72 20 69 6e 74 20 20 69 | 3b 0d 20 20 0d 20 09 69 |r int i|;. . .i|
|00001520| 6e 73 65 72 74 20 3d 20 | 5f 70 72 6f 66 69 6c 65 |nsert = |_profile|
|00001530| 3b 09 09 09 09 2f 2a 20 | 6f 6e 6c 79 20 69 6e 73 |;..../* |only ins|
|00001540| 65 72 74 20 69 66 20 70 | 72 6f 66 69 6c 69 6e 67 |ert if p|rofiling|
|00001550| 20 69 73 20 6f 6e 20 2a | 2f 0d 20 09 09 0d 20 20 | is on *|/. ... |
|00001560| 66 6f 72 20 28 69 20 3d | 20 30 3b 20 69 20 3c 20 |for (i =| 0; i < |
|00001570| 70 72 6f 66 69 6c 65 5f | 63 6f 75 6e 74 3b 20 69 |profile_|count; i|
|00001580| 2b 2b 29 0d 20 20 20 20 | 69 66 20 28 70 73 74 72 |++). |if (pstr|
|00001590| 65 71 28 20 70 72 6f 66 | 69 6c 65 73 5b 69 5d 2e |eq( prof|iles[i].|
|000015a0| 6e 61 6d 65 2c 20 6e 61 | 6d 65 20 29 29 0d 20 20 |name, na|me )). |
|000015b0| 20 20 20 20 72 65 74 75 | 72 6e 28 20 69 20 29 3b | retu|rn( i );|
|000015c0| 0d 20 20 20 20 20 20 0d | 20 20 69 66 20 28 20 69 |. .| if ( i|
|000015d0| 6e 73 65 72 74 20 26 26 | 20 28 70 72 6f 66 69 6c |nsert &&| (profil|
|000015e0| 65 5f 63 6f 75 6e 74 20 | 3c 20 4d 41 58 5f 50 52 |e_count |< MAX_PR|
|000015f0| 4f 46 49 4c 45 53 29 29 | 0d 20 20 20 20 7b 20 2f |OFILES))|. { /|
|00001600| 2a 20 70 6c 61 63 65 20 | 69 6e 20 74 61 62 6c 65 |* place |in table|
|00001610| 20 20 2d 20 69 20 70 6f | 69 6e 74 73 20 74 6f 20 | - i po|ints to |
|00001620| 63 6f 72 72 65 63 74 20 | 65 6e 74 72 79 20 2a 2f |correct |entry */|
|00001630| 0d 20 20 20 20 69 66 20 | 28 2b 2b 70 72 6f 66 69 |. if |(++profi|
|00001640| 6c 65 5f 63 6f 75 6e 74 | 20 3d 3d 20 31 29 0d 20 |le_count| == 1). |
|00001650| 20 20 20 20 20 7b 20 2f | 2a 20 66 69 72 73 74 20 | { /|* first |
|00001660| 74 69 6d 65 20 69 6e 20 | 2a 2f 0d 20 20 20 20 20 |time in |*/. |
|00001670| 20 73 74 61 72 74 5f 74 | 69 6d 65 20 3d 20 28 74 | start_t|ime = (t|
|00001680| 69 6d 65 29 20 54 69 63 | 6b 43 6f 75 6e 74 28 29 |ime) Tic|kCount()|
|00001690| 3b 0d 20 20 20 20 20 20 | 6f 6e 65 78 69 74 28 20 |;. |onexit( |
|000016a0| 44 75 6d 70 50 72 6f 66 | 69 6c 65 20 29 3b 0d 20 |DumpProf|ile );. |
|000016b0| 20 20 20 20 20 7d 0d 20 | 20 20 20 70 72 6f 66 69 | }. | profi|
|000016c0| 6c 65 73 5b 69 5d 2e 6e | 61 6d 65 20 20 20 20 20 |les[i].n|ame |
|000016d0| 20 20 20 20 20 20 20 3d | 20 6e 61 6d 65 3b 0d 20 | =| name;. |
|000016e0| 20 20 20 70 72 6f 66 69 | 6c 65 73 5b 69 5d 2e 6d | profi|les[i].m|
|000016f0| 69 6e 69 6d 75 6d 20 20 | 20 20 20 20 20 20 20 3d |inimum | =|
|00001700| 20 4d 41 58 5f 54 49 4d | 45 3b 0d 20 20 20 20 70 | MAX_TIM|E;. p|
|00001710| 72 6f 66 69 6c 65 73 5b | 69 5d 2e 6d 61 78 69 6d |rofiles[|i].maxim|
|00001720| 75 6d 20 20 20 20 20 20 | 20 20 20 3d 0d 20 20 20 |um | =. |
|00001730| 20 70 72 6f 66 69 6c 65 | 73 5b 69 5d 2e 74 6f 74 | profile|s[i].tot|
|00001740| 61 6c 20 20 20 20 20 20 | 20 20 20 20 20 3d 20 4e |al | = N|
|00001750| 55 4c 4c 3b 0d 20 20 20 | 20 70 72 6f 66 69 6c 65 |ULL;. | profile|
|00001760| 73 5b 69 5d 2e 65 6e 74 | 72 69 65 73 20 20 20 20 |s[i].ent|ries |
|00001770| 20 20 20 20 20 3d 20 30 | 3b 0d 20 20 20 20 72 65 | = 0|;. re|
|00001780| 74 75 72 6e 28 20 69 20 | 29 3b 0d 20 20 20 20 7d |turn( i |);. }|
|00001790| 0d 20 20 72 65 74 75 72 | 6e 28 20 2d 31 20 29 3b |. retur|n( -1 );|
|000017a0| 0d 7d 0d 20 0d 20 0d 2f | 2a 0d 20 0d 20 20 53 6b |.}. . ./|*. . Sk|
|000017b0| 69 70 20 6f 76 65 72 20 | 74 6f 20 63 6f 6c 75 6d |ip over |to colum|
|000017c0| 6e 20 33 32 20 66 72 6f | 6d 20 70 6f 73 69 74 69 |n 32 fro|m positi|
|000017d0| 6f 6e 20 27 6e 27 2e 0d | 20 0d 20 2a 2f 0d 20 0d |on 'n'..| . */. .|
|000017e0| 4c 4f 43 41 4c 20 76 6f | 69 64 20 53 6b 69 70 28 |LOCAL vo|id Skip(|
|000017f0| 20 6e 20 29 0d 72 65 67 | 69 73 74 65 72 20 69 6e | n ).reg|ister in|
|00001800| 74 20 20 20 20 6e 3b 0d | 7b 0d 20 20 66 6f 72 20 |t n;.|{. for |
|00001810| 28 3b 20 6e 20 3c 20 33 | 32 3b 20 6e 2b 2b 29 0d |(; n < 3|2; n++).|
|00001820| 20 20 20 20 70 75 74 63 | 68 61 72 28 20 27 20 27 | putc|har( ' '|
|00001830| 20 29 3b 0d 7d 0d 20 0d | 20 0d 2f 2a 0d 20 0d 20 | );.}. .| ./*. . |
|00001840| 20 50 72 69 6e 74 20 74 | 68 65 20 70 72 6f 66 69 | Print t|he profi|
|00001850| 6c 65 20 74 61 62 6c 65 | 20 6f 6e 20 64 65 6d 61 |le table| on dema|
|00001860| 6e 64 2e 20 20 4f 75 74 | 70 75 74 20 69 73 20 77 |nd. Out|put is w|
|00001870| 72 69 74 74 65 6e 20 74 | 6f 20 73 74 64 6f 75 74 |ritten t|o stdout|
|00001880| 20 61 6e 64 20 6d 61 79 | 0d 20 20 62 65 20 72 65 | and may|. be re|
|00001890| 64 69 72 65 63 74 65 64 | 20 77 69 74 68 20 74 68 |directed| with th|
|000018a0| 65 20 55 6e 69 78 20 27 | 3e 27 20 6d 65 63 68 61 |e Unix '|>' mecha|
|000018b0| 6e 69 73 6d 20 74 6f 20 | 61 20 66 69 6c 65 2e 20 |nism to |a file. |
|000018c0| 20 54 68 65 20 75 73 65 | 72 20 73 68 6f 75 6c 64 | The use|r should|
|000018d0| 0d 20 20 63 61 6c 6c 20 | 74 68 69 73 20 72 6f 75 |. call |this rou|
|000018e0| 74 69 6e 65 20 77 68 65 | 6e 65 76 65 72 20 61 20 |tine whe|never a |
|000018f0| 72 65 70 6f 72 74 20 69 | 73 20 64 65 73 69 72 65 |report i|s desire|
|00001900| 64 2e 20 20 45 61 63 68 | 20 74 69 6d 65 20 74 68 |d. Each| time th|
|00001910| 65 20 72 6f 75 74 69 6e | 65 20 69 73 0d 20 20 63 |e routin|e is. c|
|00001920| 61 6c 6c 65 64 2c 20 74 | 68 65 20 70 72 6f 67 72 |alled, t|he progr|
|00001930| 61 6d 20 6f 70 65 6e 73 | 20 74 68 65 20 6d 61 70 |am opens| the map|
|00001940| 20 66 69 6c 65 20 77 68 | 69 63 68 20 63 6f 72 72 | file wh|ich corr|
|00001950| 65 73 70 6f 6e 64 73 20 | 74 6f 20 74 68 65 20 70 |esponds |to the p|
|00001960| 72 6f 67 72 61 6d 0d 20 | 20 72 75 6e 6e 69 6e 67 |rogram. | running|
|00001970| 2e 20 20 54 68 65 20 6e | 61 6d 65 20 6f 66 20 74 |. The n|ame of t|
|00001980| 68 65 20 6d 61 70 20 66 | 69 6c 65 20 69 73 20 62 |he map f|ile is b|
|00001990| 75 69 6c 74 20 62 79 20 | 61 70 70 65 6e 64 69 6e |uilt by |appendin|
|000019a0| 67 20 22 2e 6d 61 70 22 | 20 74 6f 20 74 68 65 20 |g ".map"| to the |
|000019b0| 6e 61 6d 65 0d 20 20 6f | 66 20 74 68 65 20 72 75 |name. o|f the ru|
|000019c0| 6e 6e 69 6e 67 20 70 72 | 6f 67 72 61 6d 2e 20 20 |nning pr|ogram. |
|000019d0| 49 66 20 74 68 65 20 6d | 61 70 20 66 69 6c 65 20 |If the m|ap file |
|000019e0| 63 61 6e 6e 6f 74 20 62 | 65 20 66 6f 75 6e 64 20 |cannot b|e found |
|000019f0| 74 68 65 6e 20 74 68 65 | 20 72 6f 75 74 69 6e 65 |then the| routine|
|00001a00| 0d 20 20 72 65 74 75 72 | 6e 73 2e 0d 20 0d 20 2a |. retur|ns.. . *|
|00001a10| 2f 0d 0d 76 6f 69 64 20 | 44 75 6d 70 50 72 6f 66 |/..void |DumpProf|
|00001a20| 69 6c 65 28 29 0d 7b 0d | 20 20 42 6f 6f 6c 65 61 |ile().{.| Boolea|
|00001a30| 6e 09 66 6c 61 67 3b 09 | 09 09 09 09 09 09 09 2f |n.flag;.|......./|
|00001a40| 2a 20 73 61 76 65 20 73 | 74 61 74 65 20 6f 66 20 |* save s|tate of |
|00001a50| 5f 70 72 6f 66 69 6c 65 | 20 2a 2f 0d 20 20 69 6e |_profile| */. in|
|00001a60| 74 20 20 20 20 20 20 20 | 20 20 20 20 6a 2c 20 6b |t | j, k|
|00001a70| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|00001a80| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 67 | | /* g|
|00001a90| 65 6e 65 72 69 63 20 6c | 6f 6f 70 20 76 61 72 69 |eneric l|oop vari|
|00001aa0| 61 62 6c 65 73 20 20 20 | 20 2a 2f 0d 20 20 72 65 |ables | */. re|
|00001ab0| 67 69 73 74 65 72 20 69 | 6e 74 20 20 69 3b 20 20 |gister i|nt i; |
|00001ac0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001ad0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 70 | | /* p|
|00001ae0| 72 69 6d 61 72 79 20 6c | 6f 6f 70 20 76 61 72 69 |rimary l|oop vari|
|00001af0| 61 62 6c 65 20 20 20 20 | 20 2a 2f 0d 20 20 72 65 |able | */. re|
|00001b00| 67 69 73 74 65 72 20 74 | 69 6d 65 20 64 75 72 61 |gister t|ime dura|
|00001b10| 74 69 6f 6e 20 20 20 20 | 20 20 20 20 3d 20 30 4c |tion | = 0L|
|00001b20| 3b 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 74 |; | /* t|
|00001b30| 69 6d 65 20 69 6e 20 74 | 65 73 74 20 72 65 67 69 |ime in t|est regi|
|00001b40| 6f 6e 73 20 20 20 20 20 | 20 2a 2f 0d 0d 09 66 6c |ons | */...fl|
|00001b50| 61 67 20 3d 20 5f 70 72 | 6f 66 69 6c 65 3b 0d 09 |ag = _pr|ofile;..|
|00001b60| 0d 20 20 5f 70 72 6f 66 | 69 6c 65 20 3d 20 30 3b |. _prof|ile = 0;|
|00001b70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b90| 20 2f 2a 20 74 75 72 6e | 20 6f 66 66 20 70 72 6f | /* turn| off pro|
|00001ba0| 66 69 6c 69 6e 67 20 68 | 65 72 65 20 20 20 2a 2f |filing h|ere */|
|00001bb0| 0d 20 0d 20 20 66 6f 72 | 20 28 69 20 3d 20 30 3b |. . for| (i = 0;|
|00001bc0| 20 69 20 3c 20 70 72 6f | 66 69 6c 65 5f 63 6f 75 | i < pro|file_cou|
|00001bd0| 6e 74 3b 20 69 2b 2b 29 | 0d 20 20 20 20 64 75 72 |nt; i++)|. dur|
|00001be0| 61 74 69 6f 6e 20 2b 3d | 20 70 72 6f 66 69 6c 65 |ation +=| profile|
|00001bf0| 73 5b 69 5d 2e 74 6f 74 | 61 6c 3b 20 20 20 20 20 |s[i].tot|al; |
|00001c00| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 63 6f 6d 70 | | /* comp|
|00001c10| 75 74 65 20 74 6f 74 61 | 6c 20 74 69 6d 65 20 20 |ute tota|l time |
|00001c20| 20 20 20 20 20 20 2a 2f | 0d 20 0d 20 20 70 72 69 | */|. . pri|
|00001c30| 6e 74 66 28 20 22 5c 6e | 5c 6e 22 20 29 3b 0d 20 |ntf( "\n|\n" );. |
|00001c40| 20 70 72 69 6e 74 66 28 | 20 22 5c 74 5c 74 5c 74 | printf(| "\t\t\t|
|00001c50| 5c 74 52 6f 75 74 69 6e | 65 20 50 72 6f 66 69 6c |\tRoutin|e Profil|
|00001c60| 65 73 5c 6e 5c 6e 22 20 | 29 3b 0d 20 20 70 72 69 |es\n\n" |);. pri|
|00001c70| 6e 74 66 28 20 22 52 6f | 75 74 69 6e 65 20 41 64 |ntf( "Ro|utine Ad|
|00001c80| 64 72 65 73 73 22 20 29 | 3b 0d 20 20 53 6b 69 70 |dress" )|;. Skip|
|00001c90| 28 20 31 35 20 29 3b 0d | 20 20 70 72 69 6e 74 66 |( 15 );.| printf|
|00001ca0| 28 20 22 20 20 4d 69 6e | 69 6d 75 6d 20 20 20 4d |( " Min|imum M|
|00001cb0| 61 78 69 6d 75 6d 20 20 | 20 41 76 65 72 61 67 65 |aximum | Average|
|00001cc0| 20 20 20 20 25 25 20 45 | 6e 74 72 69 65 73 5c 6e | %% E|ntries\n|
|00001cd0| 22 20 29 3b 0d 20 0d 20 | 20 69 66 20 28 64 75 72 |" );. . | if (dur|
|00001ce0| 61 74 69 6f 6e 20 3c 3d | 20 30 2e 30 29 0d 20 20 |ation <=| 0.0). |
|00001cf0| 20 20 64 75 72 61 74 69 | 6f 6e 2b 2b 3b 0d 20 0d | durati|on++;. .|
|00001d00| 20 20 66 6f 72 20 28 69 | 20 3d 20 30 3b 20 69 20 | for (i| = 0; i |
|00001d10| 3c 20 70 72 6f 66 69 6c | 65 5f 63 6f 75 6e 74 3b |< profil|e_count;|
|00001d20| 20 69 2b 2b 29 0d 20 20 | 20 20 7b 20 2f 2a 20 66 | i++). | { /* f|
|00001d30| 6f 72 20 61 6c 6c 20 65 | 6e 74 72 69 65 73 20 69 |or all e|ntries i|
|00001d40| 6e 20 74 68 65 20 70 72 | 6f 66 69 6c 65 20 74 61 |n the pr|ofile ta|
|00001d50| 62 6c 65 20 2a 2f 0d 20 | 20 20 20 69 66 20 28 70 |ble */. | if (p|
|00001d60| 72 6f 66 69 6c 65 73 5b | 69 5d 2e 6d 69 6e 69 6d |rofiles[|i].minim|
|00001d70| 75 6d 20 3d 3d 20 4d 41 | 58 5f 54 49 4d 45 29 0d |um == MA|X_TIME).|
|00001d80| 20 20 20 20 20 20 63 6f | 6e 74 69 6e 75 65 3b 20 | co|ntinue; |
|00001d90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001da0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001db0| 2f 2a 20 72 6f 75 74 69 | 6e 65 20 65 6e 74 72 79 |/* routi|ne entry|
|00001dc0| 2c 20 6e 6f 20 65 78 69 | 74 20 20 20 20 2a 2f 0d |, no exi|t */.|
|00001dd0| 20 20 20 20 70 72 69 6e | 74 66 28 20 22 25 73 22 | prin|tf( "%s"|
|00001de0| 2c 20 50 74 6f 43 73 74 | 72 28 20 70 72 6f 66 69 |, PtoCst|r( profi|
|00001df0| 6c 65 73 5b 69 5d 2e 6e | 61 6d 65 20 29 20 29 3b |les[i].n|ame ) );|
|00001e00| 0d 20 20 20 20 43 74 6f | 50 73 74 72 28 20 70 72 |. Cto|Pstr( pr|
|00001e10| 6f 66 69 6c 65 73 5b 69 | 5d 2e 6e 61 6d 65 20 29 |ofiles[i|].name )|
|00001e20| 3b 0d 20 20 20 20 53 6b | 69 70 28 20 70 72 6f 66 |;. Sk|ip( prof|
|00001e30| 69 6c 65 73 5b 69 5d 2e | 6e 61 6d 65 5b 30 5d 20 |iles[i].|name[0] |
|00001e40| 29 3b 0d 20 20 20 20 70 | 72 69 6e 74 66 28 20 22 |);. p|rintf( "|
|00001e50| 25 39 6c 75 20 25 39 6c | 75 20 25 39 6c 75 20 20 |%9lu %9l|u %9lu |
|00001e60| 25 33 2e 30 66 20 25 37 | 75 5c 6e 22 2c 0d 20 20 |%3.0f %7|u\n",. |
|00001e70| 20 20 20 20 20 20 20 20 | 20 20 70 72 6f 66 69 6c | | profil|
|00001e80| 65 73 5b 69 5d 2e 6d 69 | 6e 69 6d 75 6d 2c 20 70 |es[i].mi|nimum, p|
|00001e90| 72 6f 66 69 6c 65 73 5b | 69 5d 2e 6d 61 78 69 6d |rofiles[|i].maxim|
|00001ea0| 75 6d 2c 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |um,. | |
|00001eb0| 70 72 6f 66 69 6c 65 73 | 5b 69 5d 2e 61 76 65 72 |profiles|[i].aver|
|00001ec0| 61 67 65 2c 0d 20 20 20 | 20 20 20 20 20 20 20 20 |age,. | |
|00001ed0| 20 28 28 66 6c 6f 61 74 | 29 20 70 72 6f 66 69 6c | ((float|) profil|
|00001ee0| 65 73 5b 69 5d 2e 74 6f | 74 61 6c 20 2a 20 31 30 |es[i].to|tal * 10|
|00001ef0| 30 2e 30 29 20 2f 20 28 | 66 6c 6f 61 74 29 20 64 |0.0) / (|float) d|
|00001f00| 75 72 61 74 69 6f 6e 20 | 2b 20 30 2e 30 35 2c 0d |uration |+ 0.05,.|
|00001f10| 20 20 20 20 20 20 20 20 | 20 20 20 20 70 72 6f 66 | | prof|
|00001f20| 69 6c 65 73 5b 69 5d 2e | 65 6e 74 72 69 65 73 20 |iles[i].|entries |
|00001f30| 29 3b 0d 20 20 20 20 7d | 0d 20 20 20 20 0d 20 20 |);. }|. . |
|00001f40| 20 20 5f 70 72 6f 66 69 | 6c 65 20 3d 20 66 6c 61 | _profi|le = fla|
|00001f50| 67 3b 09 09 09 09 20 2f | 2a 20 72 65 73 74 6f 72 |g;.... /|* restor|
|00001f60| 65 20 73 74 61 74 65 20 | 6f 66 20 5f 70 72 6f 66 |e state |of _prof|
|00001f70| 69 6c 65 20 2a 2f 0d 7d | 0d 20 0d 20 0d 2f 2a 0d |ile */.}|. . ./*.|
|00001f80| 20 0d 20 20 43 61 6c 6c | 65 64 20 62 79 20 61 73 | . Call|ed by as|
|00001f90| 73 65 6d 62 6c 65 72 20 | 65 78 69 74 20 72 6f 75 |sembler |exit rou|
|00001fa0| 74 69 6e 65 2e 20 20 43 | 6f 6d 70 75 74 65 20 75 |tine. C|ompute u|
|00001fb0| 73 61 67 65 20 73 74 61 | 74 69 73 74 69 63 73 20 |sage sta|tistics |
|00001fc0| 66 6f 72 20 72 6f 75 74 | 69 6e 65 20 6f 6e 0d 20 |for rout|ine on. |
|00001fd0| 20 74 6f 70 20 6f 66 20 | 70 72 6f 66 69 6c 69 6e | top of |profilin|
|00001fe0| 67 20 73 74 61 63 6b 2e | 0d 20 0d 20 2a 2f 0d 20 |g stack.|. . */. |
|00001ff0| 0d 61 64 64 72 65 73 73 | 20 5f 5f 70 72 6f 66 69 |.address| __profi|
|00002000| 6c 65 5f 65 78 69 74 28 | 29 0d 7b 0d 20 20 69 6e |le_exit(|).{. in|
|00002010| 74 20 20 20 20 20 20 20 | 20 20 20 20 69 3b 0d 20 |t | i;. |
|00002020| 20 74 69 6d 65 20 20 20 | 20 20 20 20 20 20 20 65 | time | e|
|00002030| 78 69 74 5f 74 69 6d 65 | 20 20 20 20 20 20 20 3d |xit_time| =|
|00002040| 20 28 74 69 6d 65 29 20 | 54 69 63 6b 43 6f 75 6e | (time) |TickCoun|
|00002050| 74 28 29 3b 0d 20 0d 20 | 20 64 65 70 74 68 2d 2d |t();. . | depth--|
|00002060| 3b 0d 20 20 2f 2a 20 65 | 6e 64 20 74 69 6d 69 6e |;. /* e|nd timin|
|00002070| 67 20 66 6f 72 20 61 20 | 66 75 6e 63 74 69 6f 6e |g for a |function|
|00002080| 20 2a 2f 0d 20 0d 2f 2a | 20 44 65 62 75 67 67 65 | */. ./*| Debugge|
|00002090| 72 28 29 3b 20 2a 2f 0d | 20 20 69 20 3d 20 73 74 |r(); */.| i = st|
|000020a0| 61 63 6b 5b 73 74 61 63 | 6b 5f 70 6f 69 6e 74 65 |ack[stac|k_pointe|
|000020b0| 72 5d 2e 66 75 6e 63 74 | 69 6f 6e 3b 0d 23 69 66 |r].funct|ion;.#if|
|000020c0| 64 65 66 20 20 53 49 4e | 47 4c 45 0d 20 20 20 20 |def SIN|GLE. |
|000020d0| 65 78 69 74 5f 74 69 6d | 65 20 3d 20 65 78 69 74 |exit_tim|e = exit|
|000020e0| 5f 74 69 6d 65 20 2d 20 | 64 65 6c 74 61 28 20 65 |_time - |delta( e|
|000020f0| 78 69 74 5f 74 69 6d 65 | 20 29 20 2d 0d 20 20 20 |xit_time| ) -. |
|00002100| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 73 74 61 | | sta|
|00002110| 63 6b 5b 73 74 61 63 6b | 5f 70 6f 69 6e 74 65 72 |ck[stack|_pointer|
|00002120| 5d 2e 73 74 61 72 74 20 | 2d 20 73 74 61 63 6b 5b |].start |- stack[|
|00002130| 73 74 61 63 6b 5f 70 6f | 69 6e 74 65 72 2d 2d 5d |stack_po|inter--]|
|00002140| 2e 63 6f 72 72 65 63 74 | 69 6f 6e 3b 0d 20 20 20 |.correct|ion;. |
|00002150| 20 69 66 20 28 65 78 69 | 74 5f 74 69 6d 65 20 3e | if (exi|t_time >|
|00002160| 20 30 78 37 46 46 46 46 | 46 46 46 29 0d 20 20 20 | 0x7FFFF|FFF). |
|00002170| 20 20 20 65 78 69 74 5f | 74 69 6d 65 20 3d 20 30 | exit_|time = 0|
|00002180| 4c 3b 20 20 20 20 20 09 | 09 09 09 09 09 2f 2a 20 |L; .|...../* |
|00002190| 68 61 6e 64 6c 65 20 63 | 6c 6f 63 6b 20 72 6f 6c |handle c|lock rol|
|000021a0| 6c 6f 76 65 72 20 20 20 | 20 20 2a 2f 0d 20 20 20 |lover | */. |
|000021b0| 20 70 72 6f 66 69 6c 65 | 73 5b 69 5d 2e 74 6f 74 | profile|s[i].tot|
|000021c0| 61 6c 20 2b 3d 20 65 78 | 69 74 5f 74 69 6d 65 3b |al += ex|it_time;|
|000021d0| 0d 20 20 20 20 69 66 20 | 28 73 74 61 63 6b 5f 70 |. if |(stack_p|
|000021e0| 6f 69 6e 74 65 72 20 3e | 3d 20 30 29 0d 20 20 20 |ointer >|= 0). |
|000021f0| 20 20 20 73 74 61 63 6b | 5b 73 74 61 63 6b 5f 70 | stack|[stack_p|
|00002200| 6f 69 6e 74 65 72 5d 2e | 63 6f 72 72 65 63 74 69 |ointer].|correcti|
|00002210| 6f 6e 20 2b 3d 20 65 78 | 69 74 5f 74 69 6d 65 20 |on += ex|it_time |
|00002220| 2b 20 73 74 61 63 6b 5b | 73 74 61 63 6b 5f 70 6f |+ stack[|stack_po|
|00002230| 69 6e 74 65 72 20 2b 20 | 31 5d 2e 63 6f 72 72 65 |inter + |1].corre|
|00002240| 63 74 69 6f 6e 3b 0d 23 | 65 6c 73 65 0d 20 20 20 |ction;.#|else. |
|00002250| 20 65 78 69 74 5f 74 69 | 6d 65 20 3d 20 65 78 69 | exit_ti|me = exi|
|00002260| 74 5f 74 69 6d 65 20 2d | 20 64 65 6c 74 61 28 20 |t_time -| delta( |
|00002270| 65 78 69 74 5f 74 69 6d | 65 20 29 20 2d 20 73 74 |exit_tim|e ) - st|
|00002280| 61 63 6b 5b 73 74 61 63 | 6b 5f 70 6f 69 6e 74 65 |ack[stac|k_pointe|
|00002290| 72 2d 2d 5d 2e 73 74 61 | 72 74 3b 0d 20 20 20 20 |r--].sta|rt;. |
|000022a0| 69 66 20 28 65 78 69 74 | 5f 74 69 6d 65 20 3e 20 |if (exit|_time > |
|000022b0| 30 78 37 46 46 46 46 46 | 46 46 29 0d 20 20 20 20 |0x7FFFFF|FF). |
|000022c0| 20 20 65 78 69 74 5f 74 | 69 6d 65 20 3d 20 30 4c | exit_t|ime = 0L|
|000022d0| 3b 09 09 09 09 09 09 09 | 2f 2a 20 68 61 6e 64 6c |;.......|/* handl|
|000022e0| 65 20 63 6c 6f 63 6b 20 | 72 6f 6c 6c 6f 76 65 72 |e clock |rollover|
|000022f0| 20 20 20 20 20 2a 2f 0d | 20 20 20 20 70 72 6f 66 | */.| prof|
|00002300| 69 6c 65 73 5b 69 5d 2e | 74 6f 74 61 6c 20 2b 3d |iles[i].|total +=|
|00002310| 20 65 78 69 74 5f 74 69 | 6d 65 3b 0d 23 65 6e 64 | exit_ti|me;.#end|
|00002320| 69 66 0d 20 20 69 66 20 | 28 65 78 69 74 5f 74 69 |if. if |(exit_ti|
|00002330| 6d 65 20 3e 20 70 72 6f | 66 69 6c 65 73 5b 69 5d |me > pro|files[i]|
|00002340| 2e 6d 61 78 69 6d 75 6d | 29 0d 20 20 20 20 70 72 |.maximum|). pr|
|00002350| 6f 66 69 6c 65 73 5b 69 | 5d 2e 6d 61 78 69 6d 75 |ofiles[i|].maximu|
|00002360| 6d 20 20 20 20 20 20 20 | 20 20 3d 20 65 78 69 74 |m | = exit|
|00002370| 5f 74 69 6d 65 3b 0d 20 | 20 69 66 20 28 65 78 69 |_time;. | if (exi|
|00002380| 74 5f 74 69 6d 65 20 3c | 20 70 72 6f 66 69 6c 65 |t_time <| profile|
|00002390| 73 5b 69 5d 2e 6d 69 6e | 69 6d 75 6d 29 0d 20 20 |s[i].min|imum). |
|000023a0| 20 20 70 72 6f 66 69 6c | 65 73 5b 69 5d 2e 6d 69 | profil|es[i].mi|
|000023b0| 6e 69 6d 75 6d 20 20 20 | 20 20 20 20 20 20 3d 20 |nimum | = |
|000023c0| 65 78 69 74 5f 74 69 6d | 65 3b 0d 20 20 69 66 20 |exit_tim|e;. if |
|000023d0| 28 70 72 6f 66 69 6c 65 | 73 5b 69 5d 2e 65 6e 74 |(profile|s[i].ent|
|000023e0| 72 69 65 73 29 0d 20 20 | 20 20 70 72 6f 66 69 6c |ries). | profil|
|000023f0| 65 73 5b 69 5d 2e 61 76 | 65 72 61 67 65 20 20 20 |es[i].av|erage |
|00002400| 20 20 20 20 20 20 3d 20 | 70 72 6f 66 69 6c 65 73 | = |profiles|
|00002410| 5b 69 5d 2e 74 6f 74 61 | 6c 20 2f 20 70 72 6f 66 |[i].tota|l / prof|
|00002420| 69 6c 65 73 5b 69 5d 2e | 65 6e 74 72 69 65 73 3b |iles[i].|entries;|
|00002430| 0d 20 20 72 65 74 75 72 | 6e 28 20 73 74 61 63 6b |. retur|n( stack|
|00002440| 5b 73 74 61 63 6b 5f 70 | 6f 69 6e 74 65 72 20 2b |[stack_p|ointer +|
|00002450| 20 31 5d 2e 75 73 65 72 | 20 29 3b 0d 7d 0d 20 0d | 1].user| );.}. .|
|00002460| 20 0d 2f 2a 0d 20 0d 20 | 48 61 6e 64 6c 65 20 74 | ./*. . |Handle t|
|00002470| 68 65 20 72 6f 75 74 69 | 6e 65 20 65 6e 74 72 79 |he routi|ne entry|
|00002480| 20 70 72 6f 66 69 6c 69 | 6e 67 2e 20 20 53 65 74 | profili|ng. Set|
|00002490| 75 70 20 61 20 73 74 61 | 63 6b 20 66 72 61 6d 65 |up a sta|ck frame|
|000024a0| 20 61 6e 64 20 61 20 70 | 72 6f 66 69 6c 65 20 0d | and a p|rofile .|
|000024b0| 20 74 61 62 6c 65 20 65 | 6e 74 72 79 20 69 66 20 | table e|ntry if |
|000024c0| 6e 65 65 64 65 64 2e 0d | 20 0d 20 2a 2f 0d 20 0d |needed..| . */. .|
|000024d0| 76 6f 69 64 20 5f 5f 70 | 72 6f 66 69 6c 65 28 20 |void __p|rofile( |
|000024e0| 75 6e 75 73 65 64 2c 20 | 72 65 74 2c 20 6e 61 6d |unused, |ret, nam|
|000024f0| 65 20 29 0d 75 6e 73 69 | 67 6e 65 64 20 6c 6f 6e |e ).unsi|gned lon|
|00002500| 67 09 2a 72 65 74 3b 0d | 61 64 64 72 65 73 73 09 |g.*ret;.|address.|
|00002510| 09 09 75 6e 75 73 65 64 | 3b 0d 63 68 61 72 20 20 |..unused|;.char |
|00002520| 20 20 20 20 20 20 09 2a | 6e 61 6d 65 3b 0d 0d 7b | .*|name;..{|
|00002530| 0d 20 20 72 65 67 69 73 | 74 65 72 20 69 6e 74 20 |. regis|ter int |
|00002540| 20 66 75 6e 63 74 69 6f | 6e 2c 20 20 20 20 20 20 | functio|n, |
|00002550| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002560| 20 2f 2a 20 69 6e 64 65 | 78 20 6f 66 20 72 6f 75 | /* inde|x of rou|
|00002570| 74 69 6e 65 20 20 20 20 | 20 20 20 20 20 20 2a 2f |tine | */|
|00002580| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00002590| 20 69 3b 0d 20 20 72 65 | 67 69 73 74 65 72 20 74 | i;. re|gister t|
|000025a0| 69 6d 65 20 65 6e 74 72 | 79 5f 74 69 6d 65 20 3d |ime entr|y_time =|
|000025b0| 20 28 74 69 6d 65 29 20 | 54 69 63 6b 43 6f 75 6e | (time) |TickCoun|
|000025c0| 74 28 29 3b 0d 20 20 42 | 6f 6f 6c 65 61 6e 20 09 |t();. B|oolean .|
|000025d0| 09 66 6c 61 67 3b 09 09 | 09 09 09 09 2f 2a 20 73 |.flag;..|..../* s|
|000025e0| 61 76 65 20 73 74 61 74 | 65 20 6f 66 20 5f 70 72 |ave stat|e of _pr|
|000025f0| 6f 66 69 6c 65 20 2a 2f | 0d 20 20 64 65 70 74 68 |ofile */|. depth|
|00002600| 2b 2b 3b 0d 20 20 69 66 | 20 28 5f 74 72 61 63 65 |++;. if| (_trace|
|00002610| 29 0d 20 20 20 20 7b 0d | 20 20 20 20 66 6c 61 67 |). {.| flag|
|00002620| 20 3d 20 5f 70 72 6f 66 | 69 6c 65 3b 09 09 09 2f | = _prof|ile;.../|
|00002630| 2a 20 73 61 76 65 20 5f | 70 72 6f 66 69 6c 65 20 |* save _|profile |
|00002640| 2a 2f 0d 20 20 20 20 5f | 70 72 6f 66 69 6c 65 20 |*/. _|profile |
|00002650| 3d 20 30 3b 0d 0d 20 20 | 20 20 66 6f 72 20 28 69 |= 0;.. | for (i|
|00002660| 20 3d 20 30 3b 20 69 20 | 3c 20 64 65 70 74 68 3b | = 0; i |< depth;|
|00002670| 20 69 2b 2b 29 0d 20 20 | 20 20 20 20 70 75 74 63 | i++). | putc|
|00002680| 68 61 72 28 20 27 20 27 | 20 29 3b 0d 20 20 20 20 |har( ' '| );. |
|00002690| 70 72 69 6e 74 66 28 20 | 22 25 73 5c 6e 22 2c 20 |printf( |"%s\n", |
|000026a0| 50 74 6f 43 73 74 72 28 | 20 6e 61 6d 65 20 29 20 |PtoCstr(| name ) |
|000026b0| 29 3b 0d 20 20 20 20 43 | 74 6f 50 73 74 72 28 20 |);. C|toPstr( |
|000026c0| 6e 61 6d 65 20 29 3b 0d | 20 20 20 20 5f 70 72 6f |name );.| _pro|
|000026d0| 66 69 6c 65 20 3d 20 66 | 6c 61 67 3b 0d 20 20 20 |file = f|lag;. |
|000026e0| 20 7d 0d 20 20 69 66 20 | 28 2b 2b 73 74 61 63 6b | }. if |(++stack|
|000026f0| 5f 70 6f 69 6e 74 65 72 | 20 3c 20 4d 41 58 5f 53 |_pointer| < MAX_S|
|00002700| 54 41 43 4b 29 0d 20 20 | 20 20 7b 20 2f 2a 20 73 |TACK). | { /* s|
|00002710| 65 74 75 70 20 66 6f 72 | 20 72 65 74 75 72 6e 20 |etup for| return |
|00002720| 74 6f 20 50 52 4f 46 49 | 4c 45 5f 45 58 49 54 20 |to PROFI|LE_EXIT |
|00002730| 6f 6e 20 75 73 65 72 20 | 65 78 69 74 20 2a 2f 0d |on user |exit */.|
|00002740| 20 20 20 20 73 74 61 63 | 6b 5b 73 74 61 63 6b 5f | stac|k[stack_|
|00002750| 70 6f 69 6e 74 65 72 5d | 2e 75 73 65 72 20 20 20 |pointer]|.user |
|00002760| 20 20 20 20 20 20 20 20 | 3d 20 28 61 64 64 72 65 | |= (addre|
|00002770| 73 73 29 20 2a 72 65 74 | 3b 0d 20 20 20 20 2a 72 |ss) *ret|;. *r|
|00002780| 65 74 09 09 09 09 09 09 | 09 09 3d 20 28 75 6e 73 |et......|..= (uns|
|00002790| 69 67 6e 65 64 20 6c 6f | 6e 67 29 20 5f 70 72 6f |igned lo|ng) _pro|
|000027a0| 66 69 6c 65 5f 65 78 69 | 74 5f 3b 0d 20 20 20 20 |file_exi|t_;. |
|000027b0| 73 74 61 63 6b 5b 73 74 | 61 63 6b 5f 70 6f 69 6e |stack[st|ack_poin|
|000027c0| 74 65 72 5d 2e 63 6f 72 | 72 65 63 74 69 6f 6e 20 |ter].cor|rection |
|000027d0| 20 20 20 20 3d 20 4e 55 | 4c 4c 3b 0d 20 20 20 20 | = NU|LL;. |
|000027e0| 7d 0d 20 20 65 6c 73 65 | 0d 20 20 20 20 7b 0d 20 |}. else|. {. |
|000027f0| 20 20 20 64 65 70 74 68 | 2d 2d 3b 0d 20 20 20 20 | depth|--;. |
|00002800| 72 65 74 75 72 6e 3b 0d | 20 20 20 20 7d 0d 20 0d |return;.| }. .|
|00002810| 20 20 69 66 20 28 5f 70 | 72 6f 66 69 6c 65 20 26 | if (_p|rofile &|
|00002820| 26 20 28 28 66 75 6e 63 | 74 69 6f 6e 20 3d 20 6c |& ((func|tion = l|
|00002830| 6f 6f 6b 75 70 28 20 6e | 61 6d 65 2c 20 74 72 75 |ookup( n|ame, tru|
|00002840| 65 20 29 29 20 3e 3d 20 | 30 29 29 0d 20 20 20 20 |e )) >= |0)). |
|00002850| 7b 20 2f 2a 20 70 72 6f | 63 65 73 73 20 66 75 6e |{ /* pro|cess fun|
|00002860| 63 74 69 6f 6e 20 65 6e | 74 72 79 20 2a 2f 0d 20 |ction en|try */. |
|00002870| 20 20 20 70 72 6f 66 69 | 6c 65 73 5b 66 75 6e 63 | profi|les[func|
|00002880| 74 69 6f 6e 5d 2e 65 6e | 74 72 69 65 73 2b 2b 3b |tion].en|tries++;|
|00002890| 0d 20 20 20 20 73 74 61 | 63 6b 5b 73 74 61 63 6b |. sta|ck[stack|
|000028a0| 5f 70 6f 69 6e 74 65 72 | 5d 2e 66 75 6e 63 74 69 |_pointer|].functi|
|000028b0| 6f 6e 20 20 20 20 20 3d | 20 66 75 6e 63 74 69 6f |on =| functio|
|000028c0| 6e 3b 0d 20 20 20 20 65 | 6e 74 72 79 5f 74 69 6d |n;. e|ntry_tim|
|000028d0| 65 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |e | |
|000028e0| 20 20 20 20 20 20 20 20 | 20 3d 20 54 69 63 6b 43 | | = TickC|
|000028f0| 6f 75 6e 74 28 29 3b 0d | 20 20 20 20 73 74 61 63 |ount();.| stac|
|00002900| 6b 5b 73 74 61 63 6b 5f | 70 6f 69 6e 74 65 72 5d |k[stack_|pointer]|
|00002910| 2e 73 74 61 72 74 20 20 | 20 20 20 20 20 20 3d 20 |.start | = |
|00002920| 65 6e 74 72 79 5f 74 69 | 6d 65 20 2d 20 64 65 6c |entry_ti|me - del|
|00002930| 74 61 28 20 65 6e 74 72 | 79 5f 74 69 6d 65 20 29 |ta( entr|y_time )|
|00002940| 3b 0d 20 20 20 20 7d 0d | 20 20 65 6c 73 65 0d 20 |;. }.| else. |
|00002950| 20 20 20 7b 20 2f 2a 20 | 72 65 6d 6f 76 65 20 65 | { /* |remove e|
|00002960| 6e 74 72 79 20 66 72 6f | 6d 20 73 74 61 63 6b 20 |ntry fro|m stack |
|00002970| 2a 2f 0d 20 20 20 20 2a | 72 65 74 09 09 09 09 09 |*/. *|ret.....|
|00002980| 09 09 09 3d 20 28 75 6e | 73 69 67 6e 65 64 20 6c |...= (un|signed l|
|00002990| 6f 6e 67 29 20 73 74 61 | 63 6b 5b 73 74 61 63 6b |ong) sta|ck[stack|
|000029a0| 5f 70 6f 69 6e 74 65 72 | 2d 2d 5d 2e 75 73 65 72 |_pointer|--].user|
|000029b0| 3b 0d 20 20 20 20 64 65 | 70 74 68 2d 2d 3b 0d 20 |;. de|pth--;. |
|000029c0| 20 20 20 7d 0d 7d 0d 00 | 00 00 00 00 00 00 00 00 | }.}..|........|
|000029d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+