home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1999-07-28 | 11.8 KB | [TEXT/CWIE] |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: ExprVirtualMachine.cpp
Confidence | Program | Detection | Match Type | Support
|
---|
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Wed Jul 28 01:52:44 1999, modified Wed Jul 28 01:52:44 1999, creator 'CWIE', type ASCII, 11265 bytes "ExprVirtualMachine.cpp" , at 0x2c81 410 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [CWIE] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 16 45 78 70 72 56 69 | 72 74 75 61 6c 4d 61 63 |..ExprVi|rtualMac|
|00000010| 68 69 6e 65 2e 63 70 70 | 00 00 00 00 00 00 00 00 |hine.cpp|........|
|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 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 2c 01 00 | 00 01 9a b3 c4 4b 2c b3 |.....,..|.....K,.|
|00000060| c4 4b 2c 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.K,.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 ba 1a 00 00 |........|........|
|00000080| 23 69 6e 63 6c 75 64 65 | 20 22 45 78 70 72 56 69 |#include| "ExprVi|
|00000090| 72 74 75 61 6c 4d 61 63 | 68 69 6e 65 2e 68 22 0d |rtualMac|hine.h".|
|000000a0| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 6d 61 74 68 2e |.#includ|e <math.|
|000000b0| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 3c 73 74 64 |h>.#incl|ude <std|
|000000c0| 6c 69 62 2e 68 3e 0d 0d | 0d 23 64 65 66 69 6e 65 |lib.h>..|.#define|
|000000d0| 20 5f 5f 61 64 64 49 6e | 73 74 28 20 6f 70 63 6f | __addIn|st( opco|
|000000e0| 64 65 2c 20 64 61 74 61 | 31 36 20 29 09 09 6c 6f |de, data|16 )..lo|
|000000f0| 6e 67 20 6f 70 20 3d 20 | 28 6f 70 63 6f 64 65 29 |ng op = |(opcode)|
|00000100| 20 7c 20 28 64 61 74 61 | 31 36 29 3b 09 5c 0d 09 | | (data|16);.\..|
|00000110| 09 09 09 09 09 09 09 09 | 09 6d 50 72 6f 67 72 61 |........|.mProgra|
|00000120| 6d 2e 41 70 70 65 6e 64 | 28 20 26 6f 70 2c 20 34 |m.Append|( &op, 4|
|00000130| 20 29 3b 0d 09 09 09 09 | 09 0d 0d 23 64 65 66 69 | );.....|...#defi|
|00000140| 6e 65 20 52 45 47 5f 49 | 4e 5f 55 53 45 09 30 78 |ne REG_I|N_USE.0x|
|00000150| 31 0d 23 64 65 66 69 6e | 65 20 52 45 47 5f 55 53 |1.#defin|e REG_US|
|00000160| 45 44 09 30 78 32 0d 0d | 23 64 65 66 69 6e 65 20 |ED.0x2..|#define |
|00000170| 5f 66 65 74 63 68 28 20 | 72 2c 20 76 61 6c 20 29 |_fetch( |r, val )|
|00000180| 09 73 77 69 74 63 68 20 | 28 20 28 72 29 20 29 20 |.switch |( (r) ) |
|00000190| 7b 09 09 09 09 09 5c 0d | 09 09 09 09 09 09 09 09 |{.....\.|........|
|000001a0| 63 61 73 65 20 30 3a 09 | 09 76 61 6c 20 3d 20 46 |case 0:.|.val = F|
|000001b0| 52 30 3b 09 62 72 65 61 | 6b 3b 09 5c 0d 09 09 09 |R0;.brea|k;.\....|
|000001c0| 09 09 09 09 09 63 61 73 | 65 20 31 3a 09 09 76 61 |.....cas|e 1:..va|
|000001d0| 6c 20 3d 20 46 52 31 3b | 09 62 72 65 61 6b 3b 09 |l = FR1;|.break;.|
|000001e0| 5c 0d 09 09 09 09 09 09 | 09 09 63 61 73 65 20 32 |\.......|..case 2|
|000001f0| 3a 09 09 76 61 6c 20 3d | 20 46 52 32 3b 09 62 72 |:..val =| FR2;.br|
|00000200| 65 61 6b 3b 09 5c 0d 09 | 09 09 09 09 09 09 09 63 |eak;.\..|.......c|
|00000210| 61 73 65 20 33 3a 09 09 | 76 61 6c 20 3d 20 46 52 |ase 3:..|val = FR|
|00000220| 33 3b 09 62 72 65 61 6b | 3b 09 5c 0d 09 09 09 09 |3;.break|;.\.....|
|00000230| 09 09 09 09 63 61 73 65 | 20 34 3a 09 09 76 61 6c |....case| 4:..val|
|00000240| 20 3d 20 46 52 34 3b 09 | 62 72 65 61 6b 3b 09 5c | = FR4;.|break;.\|
|00000250| 0d 09 09 09 09 09 09 09 | 09 63 61 73 65 20 35 3a |........|.case 5:|
|00000260| 09 09 76 61 6c 20 3d 20 | 46 52 35 3b 09 62 72 65 |..val = |FR5;.bre|
|00000270| 61 6b 3b 09 5c 0d 09 09 | 09 09 09 09 09 09 63 61 |ak;.\...|......ca|
|00000280| 73 65 20 36 3a 09 09 76 | 61 6c 20 3d 20 46 52 36 |se 6:..v|al = FR6|
|00000290| 3b 09 62 72 65 61 6b 3b | 09 5c 0d 09 09 09 09 09 |;.break;|.\......|
|000002a0| 09 09 09 63 61 73 65 20 | 37 3a 09 09 76 61 6c 20 |...case |7:..val |
|000002b0| 3d 20 46 52 37 3b 09 62 | 72 65 61 6b 3b 09 5c 0d |= FR7;.b|reak;.\.|
|000002c0| 09 09 09 09 09 09 09 09 | 64 65 66 61 75 6c 74 3a |........|default:|
|000002d0| 09 76 61 6c 20 3d 20 6d | 56 69 72 74 46 52 5b 20 |.val = m|VirtFR[ |
|000002e0| 72 20 2d 20 4e 55 4d 5f | 50 48 59 53 5f 52 45 47 |r - NUM_|PHYS_REG|
|000002f0| 53 20 5d 3b 09 5c 0d 09 | 09 09 09 09 09 09 7d 0d |S ];.\..|......}.|
|00000300| 09 09 09 09 09 09 09 09 | 2f 2a 0d 09 09 09 09 09 |........|/*......|
|00000310| 09 09 09 63 61 73 65 20 | 38 3a 09 09 76 61 6c 20 |...case |8:..val |
|00000320| 3d 20 46 52 38 3b 09 62 | 72 65 61 6b 3b 09 5c 0d |= FR8;.b|reak;.\.|
|00000330| 09 09 09 09 09 09 09 09 | 63 61 73 65 20 39 3a 09 |........|case 9:.|
|00000340| 09 76 61 6c 20 3d 20 46 | 52 39 3b 09 62 72 65 61 |.val = F|R9;.brea|
|00000350| 6b 3b 09 5c 0d 09 09 09 | 09 09 09 09 09 63 61 73 |k;.\....|.....cas|
|00000360| 65 20 31 30 3a 09 76 61 | 6c 20 3d 20 46 52 31 30 |e 10:.va|l = FR10|
|00000370| 3b 09 62 72 65 61 6b 3b | 09 5c 0d 09 09 09 09 09 |;.break;|.\......|
|00000380| 09 09 09 63 61 73 65 20 | 31 31 3a 09 76 61 6c 20 |...case |11:.val |
|00000390| 3d 20 46 52 31 31 3b 09 | 62 72 65 61 6b 3b 09 5c |= FR11;.|break;.\|
|000003a0| 0d 09 09 09 09 09 09 09 | 09 63 61 73 65 20 31 32 |........|.case 12|
|000003b0| 3a 09 76 61 6c 20 3d 20 | 46 52 31 32 3b 09 62 72 |:.val = |FR12;.br|
|000003c0| 65 61 6b 3b 09 5c 0d 09 | 09 09 09 09 09 09 09 63 |eak;.\..|.......c|
|000003d0| 61 73 65 20 31 33 3a 09 | 76 61 6c 20 3d 20 46 52 |ase 13:.|val = FR|
|000003e0| 31 33 3b 09 62 72 65 61 | 6b 3b 09 5c 0d 09 09 09 |13;.brea|k;.\....|
|000003f0| 09 09 09 09 09 63 61 73 | 65 20 31 34 3a 09 76 61 |.....cas|e 14:.va|
|00000400| 6c 20 3d 20 46 52 31 34 | 3b 09 62 72 65 61 6b 3b |l = FR14|;.break;|
|00000410| 09 5c 0d 09 09 09 09 09 | 09 09 09 63 61 73 65 20 |.\......|...case |
|00000420| 31 35 3a 09 76 61 6c 20 | 3d 20 46 52 31 35 3b 09 |15:.val |= FR15;.|
|00000430| 62 72 65 61 6b 3b 09 5c | 0d 09 09 09 09 09 09 09 |break;.\|........|
|00000440| 09 64 65 66 61 75 6c 74 | 3a 09 76 61 6c 20 3d 20 |.default|:.val = |
|00000450| 30 3b 09 62 72 65 61 6b | 3b 09 5c 0d 09 09 09 09 |0;.break|;.\.....|
|00000460| 09 09 09 7d 2a 2f 0d 09 | 09 09 09 09 09 09 0d 23 |...}*/..|.......#|
|00000470| 64 65 66 69 6e 65 20 5f | 73 74 6f 72 65 28 20 72 |define _|store( r|
|00000480| 2c 20 76 61 6c 20 29 09 | 73 77 69 74 63 68 20 28 |, val ).|switch (|
|00000490| 20 28 72 29 20 29 20 7b | 09 09 09 09 09 5c 0d 09 | (r) ) {|.....\..|
|000004a0| 09 09 09 09 09 09 09 63 | 61 73 65 20 30 3a 09 09 |.......c|ase 0:..|
|000004b0| 46 52 30 20 3d 20 76 61 | 6c 3b 09 62 72 65 61 6b |FR0 = va|l;.break|
|000004c0| 3b 09 5c 0d 09 09 09 09 | 09 09 09 09 63 61 73 65 |;.\.....|....case|
|000004d0| 20 31 3a 09 09 46 52 31 | 20 3d 20 76 61 6c 3b 09 | 1:..FR1| = val;.|
|000004e0| 62 72 65 61 6b 3b 09 5c | 0d 09 09 09 09 09 09 09 |break;.\|........|
|000004f0| 09 63 61 73 65 20 32 3a | 09 09 46 52 32 20 3d 20 |.case 2:|..FR2 = |
|00000500| 76 61 6c 3b 09 62 72 65 | 61 6b 3b 09 5c 0d 09 09 |val;.bre|ak;.\...|
|00000510| 09 09 09 09 09 09 63 61 | 73 65 20 33 3a 09 09 46 |......ca|se 3:..F|
|00000520| 52 33 20 3d 20 76 61 6c | 3b 09 62 72 65 61 6b 3b |R3 = val|;.break;|
|00000530| 09 5c 0d 09 09 09 09 09 | 09 09 09 63 61 73 65 20 |.\......|...case |
|00000540| 34 3a 09 09 46 52 34 20 | 3d 20 76 61 6c 3b 09 62 |4:..FR4 |= val;.b|
|00000550| 72 65 61 6b 3b 09 5c 0d | 09 09 09 09 09 09 09 09 |reak;.\.|........|
|00000560| 63 61 73 65 20 35 3a 09 | 09 46 52 35 20 3d 20 76 |case 5:.|.FR5 = v|
|00000570| 61 6c 3b 09 62 72 65 61 | 6b 3b 09 5c 0d 09 09 09 |al;.brea|k;.\....|
|00000580| 09 09 09 09 09 63 61 73 | 65 20 36 3a 09 09 46 52 |.....cas|e 6:..FR|
|00000590| 36 20 3d 20 76 61 6c 3b | 09 62 72 65 61 6b 3b 09 |6 = val;|.break;.|
|000005a0| 5c 0d 09 09 09 09 09 09 | 09 09 63 61 73 65 20 37 |\.......|..case 7|
|000005b0| 3a 09 09 46 52 37 20 3d | 20 76 61 6c 3b 09 62 72 |:..FR7 =| val;.br|
|000005c0| 65 61 6b 3b 09 5c 0d 09 | 09 09 09 09 09 09 09 64 |eak;.\..|.......d|
|000005d0| 65 66 61 75 6c 74 3a 09 | 6d 56 69 72 74 46 52 5b |efault:.|mVirtFR[|
|000005e0| 20 72 20 2d 20 4e 55 4d | 5f 50 48 59 53 5f 52 45 | r - NUM|_PHYS_RE|
|000005f0| 47 53 20 5d 20 3d 20 76 | 61 6c 3b 20 5c 0d 09 09 |GS ] = v|al; \...|
|00000600| 09 09 09 09 09 7d 0d 09 | 09 09 09 09 09 09 2f 2a |.....}..|....../*|
|00000610| 0d 09 09 09 09 09 09 09 | 09 63 61 73 65 20 38 3a |........|.case 8:|
|00000620| 09 09 46 52 38 20 3d 20 | 76 61 6c 3b 09 62 72 65 |..FR8 = |val;.bre|
|00000630| 61 6b 3b 09 5c 0d 09 09 | 09 09 09 09 09 09 63 61 |ak;.\...|......ca|
|00000640| 73 65 20 39 3a 09 09 46 | 52 39 20 3d 20 76 61 6c |se 9:..F|R9 = val|
|00000650| 3b 09 62 72 65 61 6b 3b | 09 5c 0d 09 09 09 09 09 |;.break;|.\......|
|00000660| 09 09 09 63 61 73 65 20 | 31 30 3a 09 46 52 31 30 |...case |10:.FR10|
|00000670| 20 3d 20 76 61 6c 3b 09 | 62 72 65 61 6b 3b 09 5c | = val;.|break;.\|
|00000680| 0d 09 09 09 09 09 09 09 | 09 63 61 73 65 20 31 31 |........|.case 11|
|00000690| 3a 09 46 52 31 31 20 3d | 20 76 61 6c 3b 09 62 72 |:.FR11 =| val;.br|
|000006a0| 65 61 6b 3b 09 5c 0d 09 | 09 09 09 09 09 09 09 63 |eak;.\..|.......c|
|000006b0| 61 73 65 20 31 32 3a 09 | 46 52 31 32 20 3d 20 76 |ase 12:.|FR12 = v|
|000006c0| 61 6c 3b 09 62 72 65 61 | 6b 3b 09 5c 0d 09 09 09 |al;.brea|k;.\....|
|000006d0| 09 09 09 09 09 63 61 73 | 65 20 31 33 3a 09 46 52 |.....cas|e 13:.FR|
|000006e0| 31 33 20 3d 20 76 61 6c | 3b 09 62 72 65 61 6b 3b |13 = val|;.break;|
|000006f0| 09 5c 0d 09 09 09 09 09 | 09 09 09 63 61 73 65 20 |.\......|...case |
|00000700| 31 34 3a 09 46 52 31 34 | 20 3d 20 76 61 6c 3b 09 |14:.FR14| = val;.|
|00000710| 62 72 65 61 6b 3b 09 5c | 0d 09 09 09 09 09 09 09 |break;.\|........|
|00000720| 09 63 61 73 65 20 31 35 | 3a 09 46 52 31 35 20 3d |.case 15|:.FR15 =|
|00000730| 20 76 61 6c 3b 09 62 72 | 65 61 6b 3b 09 5c 0d 09 | val;.br|eak;.\..|
|00000740| 09 09 09 09 09 09 7d 2a | 2f 0d 09 09 0d 0d 0d 0d |......}*|/.......|
|00000750| 23 64 65 66 69 6e 65 20 | 5f 65 78 65 46 6e 28 20 |#define |_exeFn( |
|00000760| 72 20 29 09 09 73 77 69 | 74 63 68 20 28 20 73 75 |r )..swi|tch ( su|
|00000770| 62 6f 70 20 29 20 7b 09 | 09 09 09 09 09 09 5c 0d |bop ) {.|......\.|
|00000780| 09 09 09 09 09 09 09 63 | 61 73 65 20 63 53 51 52 |.......c|ase cSQR|
|00000790| 54 3a 09 72 20 3d 20 73 | 71 72 74 28 20 72 20 29 |T:.r = s|qrt( r )|
|000007a0| 3b 09 62 72 65 61 6b 3b | 09 09 5c 0d 09 09 09 09 |;.break;|..\.....|
|000007b0| 09 09 09 63 61 73 65 20 | 63 41 54 41 4e 3a 09 72 |...case |cATAN:.r|
|000007c0| 20 3d 20 61 74 61 6e 28 | 20 72 20 29 3b 09 62 72 | = atan(| r );.br|
|000007d0| 65 61 6b 3b 09 09 5c 0d | 09 09 09 09 09 09 09 63 |eak;..\.|.......c|
|000007e0| 61 73 65 20 63 41 42 53 | 3a 09 72 20 3d 20 66 61 |ase cABS|:.r = fa|
|000007f0| 62 73 28 20 72 20 29 3b | 09 62 72 65 61 6b 3b 09 |bs( r );|.break;.|
|00000800| 09 5c 0d 09 09 09 09 09 | 09 09 63 61 73 65 20 63 |.\......|..case c|
|00000810| 53 49 4e 3a 09 72 20 3d | 20 73 69 6e 28 20 72 20 |SIN:.r =| sin( r |
|00000820| 29 3b 09 62 72 65 61 6b | 3b 09 09 5c 0d 09 09 09 |);.break|;..\....|
|00000830| 09 09 09 09 63 61 73 65 | 20 63 43 4f 53 3a 09 72 |....case| cCOS:.r|
|00000840| 20 3d 20 63 6f 73 28 20 | 72 20 29 3b 09 62 72 65 | = cos( |r );.bre|
|00000850| 61 6b 3b 09 09 5c 0d 09 | 09 09 09 09 09 09 63 61 |ak;..\..|......ca|
|00000860| 73 65 20 63 54 41 4e 3a | 09 72 20 3d 20 74 61 6e |se cTAN:|.r = tan|
|00000870| 28 20 72 20 29 3b 09 62 | 72 65 61 6b 3b 09 09 5c |( r );.b|reak;..\|
|00000880| 0d 09 09 09 09 09 09 09 | 63 61 73 65 20 63 53 47 |........|case cSG|
|00000890| 4e 3a 09 72 20 3d 20 28 | 20 72 20 3e 3d 20 30 20 |N:.r = (| r >= 0 |
|000008a0| 29 20 3f 20 31 20 3a 20 | 2d 31 3b 09 62 72 65 61 |) ? 1 : |-1;.brea|
|000008b0| 6b 3b 09 09 5c 0d 09 09 | 09 09 09 09 09 63 61 73 |k;..\...|.....cas|
|000008c0| 65 20 63 4c 4f 47 3a 09 | 72 20 3d 20 6c 6f 67 28 |e cLOG:.|r = log(|
|000008d0| 20 72 20 29 3b 09 62 72 | 65 61 6b 3b 09 09 5c 0d | r );.br|eak;..\.|
|000008e0| 09 09 09 09 09 09 09 63 | 61 73 65 20 63 45 58 50 |.......c|ase cEXP|
|000008f0| 3a 09 72 20 3d 20 65 78 | 70 28 20 72 20 29 3b 09 |:.r = ex|p( r );.|
|00000900| 62 72 65 61 6b 3b 09 09 | 5c 0d 09 09 09 09 09 09 |break;..|\.......|
|00000910| 09 63 61 73 65 20 63 53 | 51 52 3a 09 72 20 3d 20 |.case cS|QR:.r = |
|00000920| 72 20 2a 20 72 3b 09 09 | 62 72 65 61 6b 3b 09 09 |r * r;..|break;..|
|00000930| 5c 0d 09 09 09 09 09 09 | 09 63 61 73 65 20 63 52 |\.......|.case cR|
|00000940| 4e 44 3a 09 72 20 3d 20 | 72 20 2a 20 28 20 28 66 |ND:.r = |r * ( (f|
|00000950| 6c 6f 61 74 29 20 72 61 | 6e 64 28 29 20 29 20 2f |loat) ra|nd() ) /|
|00000960| 20 28 20 28 66 6c 6f 61 | 74 29 20 52 41 4e 44 5f | ( (floa|t) RAND_|
|00000970| 4d 41 58 20 29 3b 20 62 | 72 65 61 6b 3b 09 5c 0d |MAX ); b|reak;.\.|
|00000980| 09 09 09 09 09 09 09 63 | 61 73 65 20 63 53 51 57 |.......c|ase cSQW|
|00000990| 56 3a 09 72 20 3d 20 28 | 20 72 20 3e 3d 20 2d 31 |V:.r = (| r >= -1|
|000009a0| 2e 30 20 26 26 20 72 20 | 3c 3d 20 31 2e 30 20 29 |.0 && r |<= 1.0 )|
|000009b0| 20 3f 20 31 20 3a 20 30 | 3b 09 62 72 65 61 6b 3b | ? 1 : 0|;.break;|
|000009c0| 09 5c 0d 09 09 09 09 09 | 09 09 63 61 73 65 20 63 |.\......|..case c|
|000009d0| 54 52 57 56 3a 20 72 20 | 3d 20 66 61 62 73 28 20 |TRWV: r |= fabs( |
|000009e0| 2e 35 20 2a 20 72 20 29 | 3b 20 72 20 3d 20 32 20 |.5 * r )|; r = 2 |
|000009f0| 2a 20 28 20 72 20 2d 20 | 66 6c 6f 6f 72 28 20 72 |* ( r - |floor( r|
|00000a00| 20 29 20 29 3b 20 20 69 | 66 20 28 20 72 20 3e 20 | ) ); i|f ( r > |
|00000a10| 31 20 29 20 72 20 3d 20 | 32 20 2d 20 72 3b 09 62 |1 ) r = |2 - r;.b|
|00000a20| 72 65 61 6b 3b 09 5c 0d | 09 09 09 09 09 09 09 63 |reak;.\.|.......c|
|00000a30| 61 73 65 20 63 50 4f 53 | 3a 09 69 66 20 28 20 72 |ase cPOS|:.if ( r|
|00000a40| 20 3c 20 30 20 29 20 72 | 20 3d 20 30 3b 09 09 09 | < 0 ) r| = 0;...|
|00000a50| 62 72 65 61 6b 3b 09 09 | 5c 0d 09 09 09 09 09 09 |break;..|\.......|
|00000a60| 09 63 61 73 65 20 63 53 | 45 45 44 3a 20 69 20 3d |.case cS|EED: i =|
|00000a70| 20 2a 28 28 6c 6f 6e 67 | 2a 29 20 26 72 29 3b 09 | *((long|*) &r);.|
|00000a80| 09 09 09 09 09 5c 0d 09 | 09 09 09 09 09 09 09 09 |.....\..|........|
|00000a90| 09 73 69 7a 65 20 3d 20 | 69 20 25 20 33 31 3b 09 |.size = |i % 31;.|
|00000aa0| 09 09 09 09 09 09 5c 0d | 09 09 09 09 09 09 09 09 |......\.|........|
|00000ab0| 09 09 73 72 61 6e 64 28 | 20 28 20 69 20 3c 3c 20 |..srand(| ( i << |
|00000ac0| 73 69 7a 65 20 29 20 7c | 20 28 20 69 20 3e 3e 20 |size ) || ( i >> |
|00000ad0| 28 20 33 32 20 2d 20 73 | 69 7a 65 20 29 20 29 20 |( 32 - s|ize ) ) |
|00000ae0| 20 29 3b 20 09 62 72 65 | 61 6b 3b 09 09 09 09 5c | ); .bre|ak;....\|
|00000af0| 0d 09 09 09 09 09 09 09 | 63 61 73 65 20 63 43 4c |........|case cCL|
|00000b00| 49 50 3a 09 69 66 20 28 | 20 72 20 3c 20 30 20 29 |IP:.if (| r < 0 )|
|00000b10| 20 72 20 3d 20 30 3b 20 | 65 6c 73 65 20 69 66 20 | r = 0; |else if |
|00000b20| 28 20 72 20 3e 20 31 20 | 29 20 72 20 3d 20 31 3b |( r > 1 |) r = 1;|
|00000b30| 20 62 72 65 61 6b 3b 09 | 5c 0d 09 09 09 09 09 09 | break;.|\.......|
|00000b40| 7d 0d 09 09 09 09 0d 09 | 09 0d 23 64 65 66 69 6e |}.......|..#defin|
|00000b50| 65 20 5f 65 78 65 4f 70 | 28 20 72 31 2c 20 72 32 |e _exeOp|( r1, r2|
|00000b60| 20 29 20 09 73 77 69 74 | 63 68 20 28 20 73 75 62 | ) .swit|ch ( sub|
|00000b70| 6f 70 20 29 20 7b 09 09 | 09 09 09 09 5c 0d 09 09 |op ) {..|....\...|
|00000b80| 09 09 09 09 09 09 63 61 | 73 65 20 27 2b 27 3a 09 |......ca|se '+':.|
|00000b90| 72 31 20 2b 3d 20 72 32 | 3b 09 09 62 72 65 61 6b |r1 += r2|;..break|
|00000ba0| 3b 09 5c 0d 09 09 09 09 | 09 09 09 09 63 61 73 65 |;.\.....|....case|
|00000bb0| 20 27 2d 27 3a 09 72 31 | 20 2d 3d 20 72 32 3b 09 | '-':.r1| -= r2;.|
|00000bc0| 09 62 72 65 61 6b 3b 09 | 5c 0d 09 09 09 09 09 09 |.break;.|\.......|
|00000bd0| 09 09 63 61 73 65 20 27 | 2f 27 3a 09 72 31 20 2f |..case '|/':.r1 /|
|00000be0| 3d 20 72 32 3b 09 09 62 | 72 65 61 6b 3b 09 5c 0d |= r2;..b|reak;.\.|
|00000bf0| 09 09 09 09 09 09 09 09 | 63 61 73 65 20 27 2a 27 |........|case '*'|
|00000c00| 3a 09 72 31 20 2a 3d 20 | 72 32 3b 09 09 62 72 65 |:.r1 *= |r2;..bre|
|00000c10| 61 6b 3b 09 5c 0d 09 09 | 09 09 09 09 09 09 63 61 |ak;.\...|......ca|
|00000c20| 73 65 20 27 5e 27 3a 09 | 72 31 20 3d 20 70 6f 77 |se '^':.|r1 = pow|
|00000c30| 28 20 72 31 2c 20 72 32 | 20 29 3b 09 09 09 09 09 |( r1, r2| );.....|
|00000c40| 62 72 65 61 6b 3b 09 5c | 0d 09 09 09 09 09 09 09 |break;.\|........|
|00000c50| 09 63 61 73 65 20 27 25 | 27 3a 09 72 31 20 3d 20 |.case '%|':.r1 = |
|00000c60| 28 20 28 6c 6f 6e 67 29 | 20 72 31 20 29 20 25 20 |( (long)| r1 ) % |
|00000c70| 28 20 28 6c 6f 6e 67 29 | 20 72 32 20 29 3b 09 62 |( (long)| r2 );.b|
|00000c80| 72 65 61 6b 3b 09 5c 0d | 09 09 09 09 09 09 09 7d |reak;.\.|.......}|
|00000c90| 0d 09 09 0d 45 78 70 72 | 56 69 72 74 75 61 6c 4d |....Expr|VirtualM|
|00000ca0| 61 63 68 69 6e 65 3a 3a | 45 78 70 72 56 69 72 74 |achine::|ExprVirt|
|00000cb0| 75 61 6c 4d 61 63 68 69 | 6e 65 28 29 20 7b 0d 09 |ualMachi|ne() {..|
|00000cc0| 6d 50 43 53 74 61 72 74 | 09 3d 20 4e 55 4c 4c 3b |mPCStart|.= NULL;|
|00000cd0| 0d 09 6d 50 43 45 6e 64 | 09 09 3d 20 4e 55 4c 4c |..mPCEnd|..= NULL|
|00000ce0| 3b 0d 0d 7d 0d 09 09 09 | 09 0d 09 09 09 09 09 09 |;..}....|........|
|00000cf0| 0d 69 6e 74 20 45 78 70 | 72 56 69 72 74 75 61 6c |.int Exp|rVirtual|
|00000d00| 4d 61 63 68 69 6e 65 3a | 3a 46 69 6e 64 47 6c 6f |Machine:|:FindGlo|
|00000d10| 62 61 6c 46 72 65 65 52 | 65 67 28 29 20 7b 0d 09 |balFreeR|eg() {..|
|00000d20| 69 6e 74 20 72 65 67 20 | 3d 20 31 3b 0d 09 0d 09 |int reg |= 1;....|
|00000d30| 2f 2f 20 4c 6f 6f 6b 20 | 66 6f 72 20 61 20 67 6c |// Look |for a gl|
|00000d40| 6f 62 61 6c 20 66 72 65 | 65 20 72 65 67 69 73 74 |obal fre|e regist|
|00000d50| 65 72 20 0d 09 77 68 69 | 6c 65 20 28 20 28 20 6d |er ..whi|le ( ( m|
|00000d60| 52 65 67 43 6f 6c 6f 72 | 5b 20 72 65 67 20 5d 20 |RegColor|[ reg ] |
|00000d70| 26 20 52 45 47 5f 55 53 | 45 44 20 29 20 26 26 20 |& REG_US|ED ) && |
|00000d80| 72 65 67 20 3c 20 4e 55 | 4d 5f 52 45 47 53 20 29 |reg < NU|M_REGS )|
|00000d90| 0d 09 09 72 65 67 2b 2b | 3b 0d 09 0d 09 0d 09 72 |...reg++|;......r|
|00000da0| 65 74 75 72 6e 20 72 65 | 67 3b 0d 7d 09 09 09 09 |eturn re|g;.}....|
|00000db0| 0d 09 09 0d 0d 69 6e 74 | 20 45 78 70 72 56 69 72 |.....int| ExprVir|
|00000dc0| 74 75 61 6c 4d 61 63 68 | 69 6e 65 3a 3a 41 6c 6c |tualMach|ine::All|
|00000dd0| 6f 63 52 65 67 28 29 20 | 7b 0d 09 69 6e 74 20 72 |ocReg() |{..int r|
|00000de0| 65 67 20 3d 20 30 3b 0d | 09 0d 09 2f 2f 20 4c 6f |eg = 0;.|...// Lo|
|00000df0| 6f 6b 20 66 6f 72 20 61 | 20 66 72 65 65 20 72 65 |ok for a| free re|
|00000e00| 67 69 73 74 65 72 20 28 | 69 65 2c 20 66 69 6e 64 |gister (|ie, find|
|00000e10| 20 6f 6e 65 20 6e 6f 74 | 20 69 6e 20 75 73 65 20 | one not| in use |
|00000e20| 72 69 67 68 74 20 6e 6f | 77 29 2e 2e 2e 0d 09 77 |right no|w).....w|
|00000e30| 68 69 6c 65 20 28 20 28 | 20 6d 52 65 67 43 6f 6c |hile ( (| mRegCol|
|00000e40| 6f 72 5b 20 72 65 67 20 | 5d 20 26 20 52 45 47 5f |or[ reg |] & REG_|
|00000e50| 49 4e 5f 55 53 45 20 29 | 20 26 26 20 72 65 67 20 |IN_USE )| && reg |
|00000e60| 3c 20 4e 55 4d 5f 52 45 | 47 53 20 29 0d 09 09 72 |< NUM_RE|GS )...r|
|00000e70| 65 67 2b 2b 3b 0d 09 0d | 09 2f 2f 20 43 6f 6c 6f |eg++;...|.// Colo|
|00000e80| 72 20 69 74 0d 09 69 66 | 20 28 20 72 65 67 20 3c |r it..if| ( reg <|
|00000e90| 20 4e 55 4d 5f 52 45 47 | 53 20 29 0d 09 09 6d 52 | NUM_REG|S )...mR|
|00000ea0| 65 67 43 6f 6c 6f 72 5b | 20 72 65 67 20 5d 20 3d |egColor[| reg ] =|
|00000eb0| 20 52 45 47 5f 49 4e 5f | 55 53 45 20 7c 20 52 45 | REG_IN_|USE | RE|
|00000ec0| 47 5f 55 53 45 44 3b 0d | 09 0d 09 72 65 74 75 72 |G_USED;.|...retur|
|00000ed0| 6e 20 72 65 67 3b 0d 7d | 0d 0d 0d 0d 76 6f 69 64 |n reg;.}|....void|
|00000ee0| 20 45 78 70 72 56 69 72 | 74 75 61 6c 4d 61 63 68 | ExprVir|tualMach|
|00000ef0| 69 6e 65 3a 3a 44 65 61 | 6c 6c 6f 63 52 65 67 28 |ine::Dea|llocReg(|
|00000f00| 20 69 6e 74 20 69 6e 52 | 65 67 20 29 20 7b 0d 0d | int inR|eg ) {..|
|00000f10| 09 2f 2f 20 43 6c 65 61 | 72 20 74 68 65 20 62 69 |.// Clea|r the bi|
|00000f20| 74 20 74 68 61 74 20 73 | 61 79 73 20 74 68 65 20 |t that s|ays the |
|00000f30| 72 65 67 20 69 73 20 61 | 6c 6c 6f 63 61 74 65 64 |reg is a|llocated|
|00000f40| 0d 09 6d 52 65 67 43 6f | 6c 6f 72 5b 20 69 6e 52 |..mRegCo|lor[ inR|
|00000f50| 65 67 20 5d 20 26 3d 20 | 7e 52 45 47 5f 49 4e 5f |eg ] &= |~REG_IN_|
|00000f60| 55 53 45 3b 0d 7d 0d 0d | 09 09 09 0d 76 6f 69 64 |USE;.}..|....void|
|00000f70| 20 45 78 70 72 56 69 72 | 74 75 61 6c 4d 61 63 68 | ExprVir|tualMach|
|00000f80| 69 6e 65 3a 3a 44 6f 4f | 70 28 20 69 6e 74 20 69 |ine::DoO|p( int i|
|00000f90| 6e 52 65 67 2c 20 69 6e | 74 20 69 6e 52 65 67 32 |nReg, in|t inReg2|
|00000fa0| 2c 20 63 68 61 72 20 69 | 6e 4f 70 43 6f 64 65 20 |, char i|nOpCode |
|00000fb0| 29 20 7b 0d 0d 09 5f 5f | 61 64 64 49 6e 73 74 28 |) {...__|addInst(|
|00000fc0| 20 4f 50 5f 4f 50 45 52 | 2c 20 28 20 69 6e 4f 70 | OP_OPER|, ( inOp|
|00000fd0| 43 6f 64 65 20 3c 3c 20 | 31 36 20 29 20 7c 20 28 |Code << |16 ) | (|
|00000fe0| 20 69 6e 52 65 67 32 20 | 3c 3c 20 38 20 29 20 7c | inReg2 |<< 8 ) ||
|00000ff0| 20 69 6e 52 65 67 20 29 | 0d 7d 0d 0d 0d 09 09 0d | inReg )|.}......|
|00001000| 0d 0d 76 6f 69 64 20 45 | 78 70 72 56 69 72 74 75 |..void E|xprVirtu|
|00001010| 61 6c 4d 61 63 68 69 6e | 65 3a 3a 4d 6f 76 65 28 |alMachin|e::Move(|
|00001020| 20 69 6e 74 20 69 6e 52 | 65 67 2c 20 69 6e 74 20 | int inR|eg, int |
|00001030| 69 6e 44 65 73 74 52 65 | 67 20 29 20 7b 0d 09 0d |inDestRe|g ) {...|
|00001040| 09 69 66 20 28 20 69 6e | 44 65 73 74 52 65 67 20 |.if ( in|DestReg |
|00001050| 21 3d 20 69 6e 52 65 67 | 20 29 20 7b 0d 09 09 5f |!= inReg| ) {..._|
|00001060| 5f 61 64 64 49 6e 73 74 | 28 20 4f 50 5f 4d 4f 56 |_addInst|( OP_MOV|
|00001070| 45 2c 20 28 20 69 6e 52 | 65 67 20 3c 3c 20 38 20 |E, ( inR|eg << 8 |
|00001080| 29 20 7c 20 69 6e 44 65 | 73 74 52 65 67 20 29 09 |) | inDe|stReg ).|
|00001090| 0d 09 7d 0d 7d 0d 09 0d | 0d 09 0d 0d 76 6f 69 64 |..}.}...|....void|
|000010a0| 20 45 78 70 72 56 69 72 | 74 75 61 6c 4d 61 63 68 | ExprVir|tualMach|
|000010b0| 69 6e 65 3a 3a 4c 6f 61 | 64 69 28 20 66 6c 6f 61 |ine::Loa|di( floa|
|000010c0| 74 20 69 6e 56 61 6c 2c | 20 69 6e 74 20 69 6e 52 |t inVal,| int inR|
|000010d0| 65 67 20 29 20 7b 0d 09 | 0d 09 5f 5f 61 64 64 49 |eg ) {..|..__addI|
|000010e0| 6e 73 74 28 20 4f 50 5f | 4c 4f 41 44 49 4d 4d 45 |nst( OP_|LOADIMME|
|000010f0| 44 2c 20 69 6e 52 65 67 | 20 29 0d 09 6d 50 72 6f |D, inReg| )..mPro|
|00001100| 67 72 61 6d 2e 41 70 70 | 65 6e 64 28 20 26 69 6e |gram.App|end( &in|
|00001110| 56 61 6c 2c 20 73 69 7a | 65 6f 66 28 20 66 6c 6f |Val, siz|eof( flo|
|00001120| 61 74 20 29 20 29 3b 0d | 7d 0d 0d 0d 76 6f 69 64 |at ) );.|}...void|
|00001130| 20 45 78 70 72 56 69 72 | 74 75 61 6c 4d 61 63 68 | ExprVir|tualMach|
|00001140| 69 6e 65 3a 3a 4c 6f 61 | 64 69 28 20 66 6c 6f 61 |ine::Loa|di( floa|
|00001150| 74 2a 20 69 6e 56 61 6c | 2c 20 69 6e 74 20 69 6e |t* inVal|, int in|
|00001160| 52 65 67 20 29 20 7b 0d | 09 0d 09 5f 5f 61 64 64 |Reg ) {.|...__add|
|00001170| 49 6e 73 74 28 20 4f 50 | 5f 4c 4f 41 44 2c 20 69 |Inst( OP|_LOAD, i|
|00001180| 6e 52 65 67 20 29 0d 09 | 6d 50 72 6f 67 72 61 6d |nReg )..|mProgram|
|00001190| 2e 41 70 70 65 6e 64 28 | 20 26 69 6e 56 61 6c 2c |.Append(| &inVal,|
|000011a0| 20 34 20 29 3b 0d 7d 09 | 0d 0d 0d 0d 76 6f 69 64 | 4 );.}.|....void|
|000011b0| 20 45 78 70 72 56 69 72 | 74 75 61 6c 4d 61 63 68 | ExprVir|tualMach|
|000011c0| 69 6e 65 3a 3a 55 73 65 | 72 46 63 6e 4f 70 28 20 |ine::Use|rFcnOp( |
|000011d0| 69 6e 74 20 69 6e 52 65 | 67 2c 20 66 6c 6f 61 74 |int inRe|g, float|
|000011e0| 2a 2a 20 69 6e 46 63 6e | 48 2c 20 6c 6f 6e 67 20 |** inFcn|H, long |
|000011f0| 69 6e 53 69 7a 65 20 29 | 20 7b 0d 09 75 6e 73 69 |inSize )| {..unsi|
|00001200| 67 6e 65 64 20 73 68 6f | 72 74 20 73 69 7a 65 20 |gned sho|rt size |
|00001210| 3d 20 69 6e 53 69 7a 65 | 3b 0d 09 0d 09 69 66 20 |= inSize|;....if |
|00001220| 28 20 69 6e 46 63 6e 48 | 20 29 20 7b 0d 09 09 5f |( inFcnH| ) {..._|
|00001230| 5f 61 64 64 49 6e 73 74 | 28 20 4f 50 5f 55 53 45 |_addInst|( OP_USE|
|00001240| 52 5f 46 43 4e 2c 20 69 | 6e 52 65 67 20 29 0d 09 |R_FCN, i|nReg )..|
|00001250| 09 6d 50 72 6f 67 72 61 | 6d 2e 41 70 70 65 6e 64 |.mProgra|m.Append|
|00001260| 28 20 26 73 69 7a 65 2c | 20 32 20 29 3b 0d 09 09 |( &size,| 2 );...|
|00001270| 6d 50 72 6f 67 72 61 6d | 2e 41 70 70 65 6e 64 28 |mProgram|.Append(|
|00001280| 20 26 69 6e 46 63 6e 48 | 2c 20 34 20 29 3b 20 20 | &inFcnH|, 4 ); |
|00001290| 7d 0d 09 65 6c 73 65 0d | 09 09 4c 6f 61 64 69 28 |}..else.|..Loadi(|
|000012a0| 20 30 2e 30 2c 20 69 6e | 52 65 67 20 29 3b 0d 7d | 0.0, in|Reg );.}|
|000012b0| 0d 0d 09 0d 09 0d 76 6f | 69 64 20 45 78 70 72 56 |......vo|id ExprV|
|000012c0| 69 72 74 75 61 6c 4d 61 | 63 68 69 6e 65 3a 3a 4d |irtualMa|chine::M|
|000012d0| 61 74 68 4f 70 28 20 69 | 6e 74 20 69 6e 52 65 67 |athOp( i|nt inReg|
|000012e0| 2c 20 63 68 61 72 20 69 | 6e 46 63 6e 43 6f 64 65 |, char i|nFcnCode|
|000012f0| 20 29 20 7b 0d 09 0d 09 | 69 66 20 28 20 69 6e 46 | ) {....|if ( inF|
|00001300| 63 6e 43 6f 64 65 20 29 | 20 7b 0d 09 09 5f 5f 61 |cnCode )| {...__a|
|00001310| 64 64 49 6e 73 74 28 20 | 4f 50 5f 4d 41 54 48 4f |ddInst( |OP_MATHO|
|00001320| 50 2c 20 28 20 69 6e 46 | 63 6e 43 6f 64 65 20 3c |P, ( inF|cnCode <|
|00001330| 3c 20 31 36 20 29 20 7c | 20 69 6e 52 65 67 20 29 |< 16 ) || inReg )|
|00001340| 0d 09 7d 0d 7d 09 09 0d | 0d 0d 0d 0d 0d 0d 0d 76 |..}.}...|.......v|
|00001350| 6f 69 64 20 45 78 70 72 | 56 69 72 74 75 61 6c 4d |oid Expr|VirtualM|
|00001360| 61 63 68 69 6e 65 3a 3a | 43 6c 65 61 72 28 29 20 |achine::|Clear() |
|00001370| 7b 0d 0d 09 2f 2f 20 49 | 6e 69 74 20 72 65 67 69 |{...// I|nit regi|
|00001380| 73 74 65 72 20 63 6f 6c | 6f 72 69 6e 67 0d 09 66 |ster col|oring..f|
|00001390| 6f 72 20 28 20 69 6e 74 | 20 69 20 3d 20 30 3b 20 |or ( int| i = 0; |
|000013a0| 69 20 3c 20 4e 55 4d 5f | 52 45 47 53 3b 20 69 2b |i < NUM_|REGS; i+|
|000013b0| 2b 20 29 0d 09 09 6d 52 | 65 67 43 6f 6c 6f 72 5b |+ )...mR|egColor[|
|000013c0| 20 69 20 5d 20 3d 20 30 | 3b 0d 09 09 0d 09 6d 50 | i ] = 0|;.....mP|
|000013d0| 72 6f 67 72 61 6d 2e 57 | 69 70 65 28 29 3b 0d 7d |rogram.W|ipe();.}|
|000013e0| 0d 0d 0d 0d 76 6f 69 64 | 20 45 78 70 72 56 69 72 |....void| ExprVir|
|000013f0| 74 75 61 6c 4d 61 63 68 | 69 6e 65 3a 3a 50 72 65 |tualMach|ine::Pre|
|00001400| 70 46 6f 72 45 78 65 63 | 75 74 69 6f 6e 28 29 20 |pForExec|ution() |
|00001410| 7b 0d 09 6d 50 43 53 74 | 61 72 74 09 3d 20 6d 50 |{..mPCSt|art.= mP|
|00001420| 72 6f 67 72 61 6d 2e 67 | 65 74 43 53 74 72 28 29 |rogram.g|etCStr()|
|00001430| 3b 0d 09 6d 50 43 45 6e | 64 09 09 3d 20 6d 50 43 |;..mPCEn|d..= mPC|
|00001440| 53 74 61 72 74 20 2b 20 | 6d 50 72 6f 67 72 61 6d |Start + |mProgram|
|00001450| 2e 6c 65 6e 67 74 68 28 | 29 3b 0d 7d 0d 0d 09 09 |.length(|);.}....|
|00001460| 09 09 09 09 0d 2f 2f 20 | 41 6e 20 69 6e 73 74 20 |.....// |An inst |
|00001470| 6c 6f 6f 6b 73 20 6c 69 | 6b 65 3a 0d 2f 2f 20 30 |looks li|ke:.// 0|
|00001480| 2d 37 3a 20 09 49 6e 73 | 74 20 6f 70 63 6f 64 65 |-7: .Ins|t opcode|
|00001490| 0d 2f 2f 20 38 2d 31 35 | 3a 09 53 75 62 20 6f 70 |.// 8-15|:.Sub op|
|000014a0| 63 6f 64 65 0d 2f 2f 20 | 31 36 2d 32 33 3a 09 53 |code.// |16-23:.S|
|000014b0| 6f 75 72 63 65 20 52 65 | 67 0d 2f 2f 20 32 34 2d |ource Re|g.// 24-|
|000014c0| 33 31 3a 09 44 65 73 74 | 20 52 65 67 69 73 74 65 |31:.Dest| Registe|
|000014d0| 72 20 6e 75 6d 62 65 72 | 0d 09 09 09 09 09 09 09 |r number|........|
|000014e0| 09 0d 66 6c 6f 61 74 20 | 45 78 70 72 56 69 72 74 |..float |ExprVirt|
|000014f0| 75 61 6c 4d 61 63 68 69 | 6e 65 3a 3a 45 78 65 63 |ualMachi|ne::Exec|
|00001500| 75 74 65 2f 2a 5f 49 6e | 6c 69 6e 65 2a 2f 28 29 |ute/*_In|line*/()|
|00001510| 20 7b 0d 09 72 65 67 69 | 73 74 65 72 20 66 6c 6f | {..regi|ster flo|
|00001520| 61 74 09 46 52 30 2c 20 | 46 52 31 2c 20 46 52 32 |at.FR0, |FR1, FR2|
|00001530| 2c 20 46 52 33 2c 20 46 | 52 34 2c 20 46 52 35 2c |, FR3, F|R4, FR5,|
|00001540| 20 46 52 36 2c 20 46 52 | 37 3b 20 2f 2f 20 46 52 | FR6, FR|7; // FR|
|00001550| 38 2c 20 46 52 39 2c 20 | 46 52 31 30 2c 20 46 52 |8, FR9, |FR10, FR|
|00001560| 31 31 2c 20 46 52 31 32 | 2c 20 46 52 31 33 2c 20 |11, FR12|, FR13, |
|00001570| 46 52 31 34 2c 20 46 52 | 31 35 3b 0d 09 72 65 67 |FR14, FR|15;..reg|
|00001580| 69 73 74 65 72 20 66 6c | 6f 61 74 09 76 31 2c 20 |ister fl|oat.v1, |
|00001590| 76 32 3b 0d 09 63 6f 6e | 73 74 20 63 68 61 72 2a |v2;..con|st char*|
|000015a0| 09 50 43 09 3d 20 6d 50 | 43 53 74 61 72 74 3b 0d |.PC.= mP|CStart;.|
|000015b0| 09 63 6f 6e 73 74 20 63 | 68 61 72 2a 09 65 6e 64 |.const c|har*.end|
|000015c0| 09 3d 20 6d 50 43 45 6e | 64 3b 0d 09 75 6e 73 69 |.= mPCEn|d;..unsi|
|000015d0| 67 6e 65 64 20 6c 6f 6e | 67 09 69 6e 73 74 2c 20 |gned lon|g.inst, |
|000015e0| 6f 70 63 6f 64 65 2c 20 | 73 75 62 6f 70 2c 20 73 |opcode, |subop, s|
|000015f0| 69 7a 65 2c 20 69 3b 0d | 09 66 6c 6f 61 74 2a 09 |ize, i;.|.float*.|
|00001600| 09 09 66 63 6e 42 61 73 | 65 3b 0d 09 66 6c 6f 61 |..fcnBas|e;..floa|
|00001610| 74 09 09 09 6d 56 69 72 | 74 46 52 5b 20 4e 55 4d |t...mVir|tFR[ NUM|
|00001620| 5f 52 45 47 53 20 2d 20 | 4e 55 4d 5f 50 48 59 53 |_REGS - |NUM_PHYS|
|00001630| 5f 52 45 47 53 20 5d 3b | 0d 09 0d 09 77 68 69 6c |_REGS ];|....whil|
|00001640| 65 20 28 20 50 43 20 3c | 20 65 6e 64 20 29 20 7b |e ( PC <| end ) {|
|00001650| 0d 09 09 69 6e 73 74 20 | 3d 20 2a 28 28 6c 6f 6e |...inst |= *((lon|
|00001660| 67 2a 29 20 50 43 29 3b | 09 0d 09 09 50 43 20 2b |g*) PC);|....PC +|
|00001670| 3d 20 34 3b 0d 0d 09 09 | 6f 70 63 6f 64 65 20 3d |= 4;....|opcode =|
|00001680| 20 69 6e 73 74 20 26 20 | 30 78 46 46 30 30 30 30 | inst & |0xFF0000|
|00001690| 30 30 3b 09 0d 09 09 0d | 09 09 69 66 20 28 20 6f |00;.....|..if ( o|
|000016a0| 70 63 6f 64 65 20 3d 3d | 20 4f 50 5f 4c 4f 41 44 |pcode ==| OP_LOAD|
|000016b0| 49 4d 4d 45 44 20 29 20 | 7b 0d 09 09 09 76 31 20 |IMMED ) |{....v1 |
|000016c0| 3d 20 2a 28 28 66 6c 6f | 61 74 2a 29 20 50 43 29 |= *((flo|at*) PC)|
|000016d0| 3b 0d 09 09 09 50 43 20 | 2b 3d 20 34 3b 20 7d 0d |;....PC |+= 4; }.|
|000016e0| 09 09 65 6c 73 65 20 69 | 66 20 28 20 6f 70 63 6f |..else i|f ( opco|
|000016f0| 64 65 20 3d 3d 20 4f 50 | 5f 4c 4f 41 44 20 29 20 |de == OP|_LOAD ) |
|00001700| 7b 0d 09 09 09 76 31 20 | 3d 20 2a 2a 28 28 66 6c |{....v1 |= **((fl|
|00001710| 6f 61 74 2a 2a 29 20 50 | 43 29 3b 0d 09 09 09 50 |oat**) P|C);....P|
|00001720| 43 20 2b 3d 20 34 3b 20 | 7d 0d 09 09 65 6c 73 65 |C += 4; |}...else|
|00001730| 20 7b 0d 09 09 09 5f 66 | 65 74 63 68 28 20 69 6e | {...._f|etch( in|
|00001740| 73 74 20 26 20 30 78 46 | 46 2c 20 76 31 20 29 0d |st & 0xF|F, v1 ).|
|00001750| 09 09 09 5f 66 65 74 63 | 68 28 20 28 20 69 6e 73 |..._fetc|h( ( ins|
|00001760| 74 20 3e 3e 20 38 20 29 | 20 26 20 30 78 46 46 2c |t >> 8 )| & 0xFF,|
|00001770| 20 76 32 20 29 0d 09 09 | 09 73 75 62 6f 70 20 3d | v2 )...|.subop =|
|00001780| 20 28 20 69 6e 73 74 20 | 3e 3e 20 31 36 20 29 20 | ( inst |>> 16 ) |
|00001790| 26 20 30 78 46 46 3b 0d | 09 09 09 0d 09 09 09 73 |& 0xFF;.|.......s|
|000017a0| 77 69 74 63 68 20 28 20 | 6f 70 63 6f 64 65 20 29 |witch ( |opcode )|
|000017b0| 20 7b 0d 09 09 09 09 63 | 61 73 65 20 4f 50 5f 4f | {.....c|ase OP_O|
|000017c0| 50 45 52 3a 09 09 09 09 | 09 09 0d 09 09 09 09 09 |PER:....|........|
|000017d0| 5f 65 78 65 4f 70 28 20 | 76 31 2c 20 76 32 20 29 |_exeOp( |v1, v2 )|
|000017e0| 0d 09 09 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 09 |......br|eak;....|
|000017f0| 0d 09 09 09 09 63 61 73 | 65 20 4f 50 5f 4d 41 54 |.....cas|e OP_MAT|
|00001800| 48 4f 50 3a 0d 09 09 09 | 09 09 5f 65 78 65 46 6e |HOP:....|.._exeFn|
|00001810| 28 20 76 31 20 29 0d 09 | 09 09 09 09 62 72 65 61 |( v1 )..|....brea|
|00001820| 6b 3b 0d 09 09 09 09 09 | 0d 09 09 09 09 63 61 73 |k;......|.....cas|
|00001830| 65 20 4f 50 5f 55 53 45 | 52 5f 46 43 4e 3a 0d 09 |e OP_USE|R_FCN:..|
|00001840| 09 09 09 09 73 69 7a 65 | 20 3d 20 2a 28 20 28 75 |....size| = *( (u|
|00001850| 6e 73 69 67 6e 65 64 20 | 73 68 6f 72 74 2a 29 20 |nsigned |short*) |
|00001860| 50 43 20 29 3b 0d 09 09 | 09 09 09 50 43 20 2b 3d |PC );...|...PC +=|
|00001870| 20 32 3b 0d 09 09 09 09 | 09 66 63 6e 42 61 73 65 | 2;.....|.fcnBase|
|00001880| 20 3d 20 2a 2a 28 28 66 | 6c 6f 61 74 2a 2a 2a 29 | = **((f|loat***)|
|00001890| 20 50 43 29 3b 0d 09 09 | 09 09 09 50 43 20 2b 3d | PC);...|...PC +=|
|000018a0| 20 34 3b 0d 09 09 09 09 | 09 69 20 3d 20 76 31 20 | 4;.....|.i = v1 |
|000018b0| 2a 20 73 69 7a 65 3b 0d | 09 09 09 09 09 69 66 20 |* size;.|.....if |
|000018c0| 28 20 69 20 3c 20 30 20 | 29 0d 09 09 09 09 09 09 |( i < 0 |).......|
|000018d0| 69 20 3d 20 30 3b 0d 09 | 09 09 09 09 69 66 20 28 |i = 0;..|....if (|
|000018e0| 20 69 20 3e 3d 20 73 69 | 7a 65 20 29 20 0d 09 09 | i >= si|ze ) ...|
|000018f0| 09 09 09 09 69 20 3d 20 | 73 69 7a 65 20 2d 20 31 |....i = |size - 1|
|00001900| 3b 0d 09 09 09 09 09 76 | 31 20 3d 20 66 63 6e 42 |;......v|1 = fcnB|
|00001910| 61 73 65 5b 20 69 20 5d | 3b 0d 09 09 09 09 09 62 |ase[ i ]|;......b|
|00001920| 72 65 61 6b 3b 0d 09 09 | 09 09 09 0d 09 09 09 09 |reak;...|........|
|00001930| 63 61 73 65 20 4f 50 5f | 4d 4f 56 45 3a 0d 09 09 |case OP_|MOVE:...|
|00001940| 09 09 09 76 31 20 3d 20 | 76 32 3b 0d 09 09 09 09 |...v1 = |v2;.....|
|00001950| 09 62 72 65 61 6b 3b 0d | 09 09 09 09 09 0d 09 09 |.break;.|........|
|00001960| 09 09 63 61 73 65 20 4f | 50 5f 57 45 49 47 48 54 |..case O|P_WEIGHT|
|00001970| 3a 0d 09 09 09 09 09 66 | 6c 6f 61 74 20 77 65 69 |:......f|loat wei|
|00001980| 67 68 74 20 3d 20 2a 2a | 28 28 66 6c 6f 61 74 2a |ght = **|((float*|
|00001990| 2a 29 20 50 43 29 3b 09 | 0d 09 09 09 09 09 50 43 |*) PC);.|......PC|
|000019a0| 20 2b 3d 20 34 3b 0d 09 | 09 09 09 09 76 31 20 3d | += 4;..|....v1 =|
|000019b0| 20 28 20 31 2e 30 20 2d | 20 77 65 69 67 68 74 20 | ( 1.0 -| weight |
|000019c0| 29 20 2a 20 76 31 20 2b | 20 77 65 69 67 68 74 20 |) * v1 +| weight |
|000019d0| 2a 20 76 32 3b 0d 09 09 | 09 09 09 62 72 65 61 6b |* v2;...|...break|
|000019e0| 3b 0d 09 09 09 7d 0d 09 | 09 7d 0d 09 09 0d 09 09 |;....}..|.}......|
|000019f0| 5f 73 74 6f 72 65 28 20 | 69 6e 73 74 20 26 20 30 |_store( |inst & 0|
|00001a00| 78 46 46 2c 20 76 31 20 | 29 0d 09 7d 0d 09 0d 09 |xFF, v1 |)..}....|
|00001a10| 72 65 74 75 72 6e 20 46 | 52 30 3b 0d 7d 0d 0d 0d |return F|R0;.}...|
|00001a20| 0d 0d 76 6f 69 64 20 45 | 78 70 72 56 69 72 74 75 |..void E|xprVirtu|
|00001a30| 61 6c 4d 61 63 68 69 6e | 65 3a 3a 43 68 61 69 6e |alMachin|e::Chain|
|00001a40| 28 20 45 78 70 72 56 69 | 72 74 75 61 6c 4d 61 63 |( ExprVi|rtualMac|
|00001a50| 68 69 6e 65 26 20 69 6e | 56 4d 2c 20 66 6c 6f 61 |hine& in|VM, floa|
|00001a60| 74 2a 20 69 6e 54 72 61 | 6e 73 69 74 69 6f 6e 4c |t* inTra|nsitionL|
|00001a70| 69 6e 6b 20 29 20 7b 0d | 09 69 6e 74 20 74 65 6d |ink ) {.|.int tem|
|00001a80| 70 52 65 67 20 3d 20 69 | 6e 56 4d 2e 46 69 6e 64 |pReg = i|nVM.Find|
|00001a90| 47 6c 6f 62 61 6c 46 72 | 65 65 52 65 67 28 29 3b |GlobalFr|eeReg();|
|00001aa0| 0d 09 0d 09 2f 2f 20 4d | 6f 76 65 20 74 68 65 20 |....// M|ove the |
|00001ab0| 6f 75 74 70 75 74 20 6f | 66 20 74 68 69 73 20 56 |output o|f this V|
|00001ac0| 4d 20 74 6f 20 61 20 72 | 65 67 20 74 68 61 74 20 |M to a r|eg that |
|00001ad0| 77 6f 6e 27 74 20 67 65 | 74 20 6f 76 65 72 77 72 |won't ge|t overwr|
|00001ae0| 69 74 74 65 6e 20 62 79 | 20 69 6e 56 4d 0d 09 4d |itten by| inVM..M|
|00001af0| 6f 76 65 28 20 30 2c 20 | 74 65 6d 70 52 65 67 20 |ove( 0, |tempReg |
|00001b00| 29 3b 0d 09 0d 09 2f 2f | 20 4e 6f 77 20 65 78 65 |);....//| Now exe|
|00001b10| 63 75 74 65 20 69 6e 56 | 4d 20 28 77 65 20 6b 6e |cute inV|M (we kn|
|00001b20| 6f 77 20 69 74 20 77 6f | 6e 27 74 20 74 6f 75 63 |ow it wo|n't touc|
|00001b30| 68 20 74 65 6d 70 52 65 | 67 29 0d 09 6d 50 72 6f |h tempRe|g)..mPro|
|00001b40| 67 72 61 6d 2e 41 70 70 | 65 6e 64 28 20 69 6e 56 |gram.App|end( inV|
|00001b50| 4d 2e 6d 50 72 6f 67 72 | 61 6d 20 29 3b 0d 09 0d |M.mProgr|am );...|
|00001b60| 09 2f 2f 20 55 73 65 20 | 74 68 65 20 73 70 65 63 |.// Use |the spec|
|00001b70| 69 61 6c 20 77 65 69 67 | 68 74 20 6f 70 20 74 68 |ial weig|ht op th|
|00001b80| 61 74 20 63 6f 6d 62 69 | 6e 65 73 20 74 68 65 20 |at combi|nes the |
|00001b90| 74 77 6f 20 6f 75 74 70 | 75 74 73 20 76 69 61 20 |two outp|uts via |
|00001ba0| 61 6e 20 65 6d 62 65 64 | 64 65 64 20 61 64 64 72 |an embed|ded addr|
|00001bb0| 20 74 6f 20 61 20 30 20 | 74 6f 20 31 20 76 61 6c | to a 0 |to 1 val|
|00001bc0| 75 65 0d 09 2f 2f 20 4e | 6f 74 65 20 74 68 61 74 |ue..// N|ote that|
|00001bd0| 20 74 68 65 20 6f 75 74 | 70 75 74 20 69 73 20 6d | the out|put is m|
|00001be0| 6f 76 65 64 20 74 6f 20 | 72 65 67 69 73 74 65 72 |oved to |register|
|00001bf0| 20 30 0d 09 5f 5f 61 64 | 64 49 6e 73 74 28 20 4f | 0..__ad|dInst( O|
|00001c00| 50 5f 57 45 49 47 48 54 | 2c 20 28 20 74 65 6d 70 |P_WEIGHT|, ( temp|
|00001c10| 52 65 67 20 3c 3c 20 38 | 20 29 20 7c 20 30 20 29 |Reg << 8| ) | 0 )|
|00001c20| 0d 09 6d 50 72 6f 67 72 | 61 6d 2e 41 70 70 65 6e |..mProgr|am.Appen|
|00001c30| 64 28 20 26 69 6e 54 72 | 61 6e 73 69 74 69 6f 6e |d( &inTr|ansition|
|00001c40| 4c 69 6e 6b 2c 20 34 20 | 29 3b 0d 09 0d 09 2f 2f |Link, 4 |);....//|
|00001c50| 20 54 68 65 20 72 65 67 | 20 63 6f 6c 6f 72 69 6e | The reg| colorin|
|00001c60| 67 20 66 6f 72 20 74 68 | 69 73 20 56 4d 20 69 73 |g for th|is VM is|
|00001c70| 20 74 68 65 20 4f 52 20 | 6f 66 20 74 68 65 20 74 | the OR |of the t|
|00001c80| 77 6f 27 73 20 63 6f 6c | 6f 72 69 6e 67 0d 09 66 |wo's col|oring..f|
|00001c90| 6f 72 20 28 20 69 6e 74 | 20 69 20 3d 20 30 3b 20 |or ( int| i = 0; |
|00001ca0| 69 20 3c 20 4e 55 4d 5f | 52 45 47 53 3b 20 69 2b |i < NUM_|REGS; i+|
|00001cb0| 2b 20 29 0d 09 09 6d 52 | 65 67 43 6f 6c 6f 72 5b |+ )...mR|egColor[|
|00001cc0| 20 69 20 5d 20 7c 3d 20 | 69 6e 56 4d 2e 6d 52 65 | i ] |= |inVM.mRe|
|00001cd0| 67 43 6f 6c 6f 72 5b 20 | 69 20 5d 3b 09 0d 09 09 |gColor[ |i ];....|
|00001ce0| 0d 09 50 72 65 70 46 6f | 72 45 78 65 63 75 74 69 |..PrepFo|rExecuti|
|00001cf0| 6f 6e 28 29 3b 0d 7d 0d | 0d 0d 0d 76 6f 69 64 20 |on();.}.|...void |
|00001d00| 45 78 70 72 56 69 72 74 | 75 61 6c 4d 61 63 68 69 |ExprVirt|ualMachi|
|00001d10| 6e 65 3a 3a 41 73 73 69 | 67 6e 28 20 45 78 70 72 |ne::Assi|gn( Expr|
|00001d20| 56 69 72 74 75 61 6c 4d | 61 63 68 69 6e 65 26 20 |VirtualM|achine& |
|00001d30| 69 6e 45 78 70 72 20 29 | 20 7b 0d 0d 09 6d 50 72 |inExpr )| {...mPr|
|00001d40| 6f 67 72 61 6d 2e 41 73 | 73 69 67 6e 28 20 69 6e |ogram.As|sign( in|
|00001d50| 45 78 70 72 2e 6d 50 72 | 6f 67 72 61 6d 20 29 3b |Expr.mPr|ogram );|
|00001d60| 0d 09 0d 09 66 6f 72 20 | 28 20 69 6e 74 20 69 20 |....for |( int i |
|00001d70| 3d 20 30 3b 20 69 20 3c | 20 4e 55 4d 5f 52 45 47 |= 0; i <| NUM_REG|
|00001d80| 53 3b 20 69 2b 2b 20 29 | 0d 09 09 6d 52 65 67 43 |S; i++ )|...mRegC|
|00001d90| 6f 6c 6f 72 5b 20 69 20 | 5d 20 3d 20 69 6e 45 78 |olor[ i |] = inEx|
|00001da0| 70 72 2e 6d 52 65 67 43 | 6f 6c 6f 72 5b 20 69 20 |pr.mRegC|olor[ i |
|00001db0| 5d 3b 0d 09 09 0d 09 50 | 72 65 70 46 6f 72 45 78 |];.....P|repForEx|
|00001dc0| 65 63 75 74 69 6f 6e 28 | 29 3b 0d 7d 0d 0d 0d 0d |ecution(|);.}....|
|00001dd0| 2f 2a 0d 76 6f 69 64 20 | 45 78 70 72 56 69 72 74 |/*.void |ExprVirt|
|00001de0| 75 61 6c 4d 61 63 68 69 | 6e 65 3a 3a 4e 65 67 28 |ualMachi|ne::Neg(|
|00001df0| 29 20 7b 0d 09 0d 09 5f | 5f 61 64 64 49 6e 73 74 |) {...._|_addInst|
|00001e00| 28 20 4f 50 5f 4e 45 47 | 2c 20 30 20 29 0d 7d 09 |( OP_NEG|, 0 ).}.|
|00001e10| 09 0d 2a 2f 0d 0d 2f 2a | 09 09 09 0d 76 6f 69 64 |..*/../*|....void|
|00001e20| 20 45 78 70 72 56 69 72 | 74 75 61 6c 4d 61 63 68 | ExprVir|tualMach|
|00001e30| 69 6e 65 3a 3a 4f 70 74 | 69 6d 69 7a 65 28 29 20 |ine::Opt|imize() |
|00001e40| 7b 0d 09 63 68 61 72 2a | 09 09 62 61 73 65 20 3d |{..char*|..base =|
|00001e50| 20 6d 50 72 6f 67 72 61 | 6d 2e 67 65 74 43 53 74 | mProgra|m.getCSt|
|00001e60| 72 28 29 3b 0d 09 6c 6f | 6e 67 2a 09 09 50 43 09 |r();..lo|ng*..PC.|
|00001e70| 3d 20 28 6c 6f 6e 67 2a | 29 20 6d 50 72 6f 67 72 |= (long*|) mProgr|
|00001e80| 61 6d 2e 67 65 74 43 53 | 74 72 28 29 3b 0d 09 6c |am.getCS|tr();..l|
|00001e90| 6f 6e 67 2a 09 09 65 6e | 64 09 3d 20 28 6c 6f 6e |ong*..en|d.= (lon|
|00001ea0| 67 2a 29 20 28 28 28 63 | 68 61 72 2a 29 20 50 43 |g*) (((c|har*) PC|
|00001eb0| 29 20 2b 20 6d 50 72 6f | 67 72 61 6d 2e 6c 65 6e |) + mPro|gram.len|
|00001ec0| 67 74 68 28 29 29 3b 0d | 09 6c 6f 6e 67 09 09 72 |gth());.|.long..r|
|00001ed0| 65 67 2c 20 6f 70 63 6f | 64 65 3b 0d 09 6c 6f 6e |eg, opco|de;..lon|
|00001ee0| 67 2a 09 09 73 74 61 72 | 74 3b 0d 09 0d 09 77 68 |g*..star|t;....wh|
|00001ef0| 69 6c 65 20 28 20 50 43 | 20 3c 20 65 6e 64 20 29 |ile ( PC| < end )|
|00001f00| 20 7b 0d 09 09 6f 70 63 | 6f 64 65 20 3d 20 28 2a | {...opc|ode = (*|
|00001f10| 50 43 29 20 26 20 30 78 | 46 46 30 30 30 30 30 30 |PC) & 0x|FF000000|
|00001f20| 3b 0d 09 09 73 74 61 72 | 74 20 3d 20 50 43 3b 0d |;...star|t = PC;.|
|00001f30| 09 09 50 43 2b 2b 3b 0d | 09 09 0d 09 09 2f 2f 20 |..PC++;.|.....// |
|00001f40| 4d 61 69 6e 74 61 69 6e | 20 74 68 65 20 50 43 0d |Maintain| the PC.|
|00001f50| 09 09 69 66 20 28 20 6f | 70 63 6f 64 65 20 3d 3d |..if ( o|pcode ==|
|00001f60| 20 4f 50 5f 4c 4f 41 44 | 49 4d 4d 45 44 20 29 0d | OP_LOAD|IMMED ).|
|00001f70| 09 09 09 50 43 20 2b 3d | 20 32 3b 0d 09 09 65 6c |...PC +=| 2;...el|
|00001f80| 73 65 20 69 66 20 28 20 | 20 6f 70 63 6f 64 65 20 |se if ( | opcode |
|00001f90| 3d 3d 20 4f 50 5f 4c 4f | 41 44 20 29 0d 09 09 09 |== OP_LO|AD )....|
|00001fa0| 50 43 2b 2b 3b 0d 09 09 | 09 0d 09 09 2f 2f 20 4c |PC++;...|....// L|
|00001fb0| 6f 6f 6b 20 66 6f 72 20 | 61 20 27 4c 6f 61 64 20 |ook for |a 'Load |
|00001fc0| 69 6e 74 6f 20 72 30 2c | 20 3c 4d 61 74 68 20 6f |into r0,| <Math o|
|00001fd0| 70 3e 2c 20 4d 6f 76 65 | 20 66 72 6f 6d 20 72 30 |p>, Move| from r0|
|00001fe0| 27 20 73 65 71 75 65 6e | 63 65 0d 09 09 69 66 20 |' sequen|ce...if |
|00001ff0| 28 20 6f 70 63 6f 64 65 | 20 3d 3d 20 4f 50 5f 4c |( opcode| == OP_L|
|00002000| 4f 41 44 49 4d 4d 45 44 | 20 7c 7c 20 6f 70 63 6f |OADIMMED| || opco|
|00002010| 64 65 20 3d 3d 20 4f 50 | 5f 4c 4f 41 44 20 29 20 |de == OP|_LOAD ) |
|00002020| 7b 0d 09 09 09 6f 70 63 | 6f 64 65 20 3d 20 28 2a |{....opc|ode = (*|
|00002030| 50 43 29 20 26 20 30 78 | 46 46 30 30 30 30 30 30 |PC) & 0x|FF000000|
|00002040| 3b 0d 09 09 09 69 66 20 | 28 20 6f 70 63 6f 64 65 |;....if |( opcode|
|00002050| 20 3d 3d 20 4f 50 5f 4d | 4f 56 45 5f 46 52 30 20 | == OP_M|OVE_FR0 |
|00002060| 29 20 7b 0d 09 09 09 09 | 72 65 67 20 3d 20 2a 50 |) {.....|reg = *P|
|00002070| 43 20 26 20 30 78 46 46 | 3b 09 09 09 09 09 09 09 |C & 0xFF|;.......|
|00002080| 09 09 09 2f 2f 20 45 78 | 74 72 61 63 74 20 74 68 |...// Ex|tract th|
|00002090| 65 20 66 69 6e 61 6c 20 | 64 65 73 74 20 72 65 67 |e final |dest reg|
|000020a0| 69 73 74 65 72 0d 09 09 | 09 09 2a 73 74 61 72 74 |ister...|..*start|
|000020b0| 20 3d 20 28 2a 73 74 61 | 72 74 29 20 7c 20 72 65 | = (*sta|rt) | re|
|000020c0| 67 3b 09 09 09 09 09 09 | 09 09 2f 2f 20 43 68 61 |g;......|..// Cha|
|000020d0| 6e 67 65 20 74 68 65 20 | 6c 6f 61 64 20 73 6f 20 |nge the |load so |
|000020e0| 69 74 20 6c 6f 61 64 73 | 20 72 69 67 68 74 20 69 |it loads| right i|
|000020f0| 6e 74 6f 20 74 68 65 20 | 72 65 67 20 69 74 20 6e |nto the |reg it n|
|00002100| 65 65 64 73 20 74 6f 0d | 09 09 09 09 6d 50 72 6f |eeds to.|....mPro|
|00002110| 67 72 61 6d 2e 52 65 6d | 6f 76 65 28 20 31 20 2b |gram.Rem|ove( 1 +|
|00002120| 20 28 20 28 28 63 68 61 | 72 2a 29 20 50 43 29 20 | ( ((cha|r*) PC) |
|00002130| 2d 20 62 61 73 65 20 29 | 2c 20 34 20 29 3b 20 7d |- base )|, 4 ); }|
|00002140| 09 2f 2f 20 44 65 6c 65 | 74 65 20 74 68 65 20 6d |.// Dele|te the m|
|00002150| 6f 76 65 20 66 72 6f 6d | 20 66 72 30 20 69 6e 73 |ove from| fr0 ins|
|00002160| 74 0d 09 09 09 09 2f 2f | 20 3f 3f 0d 09 09 09 65 |t.....//| ??....e|
|00002170| 6c 73 65 20 69 66 20 28 | 20 6f 70 63 6f 64 65 20 |lse if (| opcode |
|00002180| 3d 3d 20 4f 50 5f 4d 41 | 54 48 4f 50 20 29 20 7b |== OP_MA|THOP ) {|
|00002190| 0d 09 09 09 09 6f 70 63 | 6f 64 65 20 3d 20 28 2a |.....opc|ode = (*|
|000021a0| 28 50 43 20 2b 20 31 29 | 29 20 26 20 30 78 46 46 |(PC + 1)|) & 0xFF|
|000021b0| 30 30 30 30 30 30 3b 0d | 09 09 09 09 69 66 20 28 |000000;.|....if (|
|000021c0| 20 6f 70 63 6f 64 65 20 | 3d 3d 20 4f 50 5f 4d 4f | opcode |== OP_MO|
|000021d0| 56 45 5f 46 52 30 20 29 | 20 7b 0d 09 09 09 09 09 |VE_FR0 )| {......|
|000021e0| 72 65 67 20 3d 20 2a 28 | 50 43 20 2b 20 31 29 20 |reg = *(|PC + 1) |
|000021f0| 26 20 30 78 46 46 3b 09 | 09 09 09 09 09 09 09 2f |& 0xFF;.|......./|
|00002200| 2f 20 45 78 74 72 61 63 | 74 20 74 68 65 20 66 69 |/ Extrac|t the fi|
|00002210| 6e 61 6c 20 64 65 73 74 | 20 72 65 67 69 73 74 65 |nal dest| registe|
|00002220| 72 0d 09 09 09 09 09 2a | 73 74 61 72 74 20 3d 20 |r......*|start = |
|00002230| 28 2a 73 74 61 72 74 29 | 20 7c 20 72 65 67 3b 09 |(*start)| | reg;.|
|00002240| 09 09 09 09 09 09 2f 2f | 20 43 68 61 6e 67 65 20 |......//| Change |
|00002250| 74 68 65 20 6c 6f 61 64 | 20 73 6f 20 69 74 20 6c |the load| so it l|
|00002260| 6f 61 64 73 20 72 69 67 | 68 74 20 69 6e 74 6f 20 |oads rig|ht into |
|00002270| 74 68 65 20 72 65 67 20 | 69 74 20 6e 65 65 64 73 |the reg |it needs|
|00002280| 20 74 6f 0d 09 09 09 09 | 09 2a 50 43 20 3d 20 28 | to.....|.*PC = (|
|00002290| 2a 50 43 29 20 7c 20 72 | 65 67 3b 09 09 09 09 09 |*PC) | r|eg;.....|
|000022a0| 09 09 09 09 2f 2f 20 43 | 68 61 6e 67 65 20 74 68 |....// C|hange th|
|000022b0| 65 20 6d 61 74 68 20 6f | 70 20 73 6f 20 69 74 20 |e math o|p so it |
|000022c0| 6f 70 65 72 61 74 65 73 | 20 6f 6e 20 74 68 65 20 |operates| on the |
|000022d0| 70 72 6f 70 65 72 20 72 | 65 67 20 28 73 65 65 20 |proper r|eg (see |
|000022e0| 61 62 6f 76 65 29 0d 09 | 09 09 09 09 6d 50 72 6f |above)..|....mPro|
|000022f0| 67 72 61 6d 2e 52 65 6d | 6f 76 65 28 20 35 20 2b |gram.Rem|ove( 5 +|
|00002300| 20 28 20 28 28 63 68 61 | 72 2a 29 20 50 43 29 20 | ( ((cha|r*) PC) |
|00002310| 2d 20 62 61 73 65 20 29 | 2c 20 34 20 29 3b 09 2f |- base )|, 4 );./|
|00002320| 2f 20 44 65 6c 65 74 65 | 20 74 68 65 20 6d 6f 76 |/ Delete| the mov|
|00002330| 65 20 66 72 6f 6d 20 66 | 72 30 20 69 6e 73 74 0d |e from f|r0 inst.|
|00002340| 09 09 09 09 7d 20 0d 09 | 09 09 7d 20 20 2f 2f 20 |....} ..|..} // |
|00002350| 3f 3f 0d 09 09 7d 0d 09 | 7d 09 0d 09 0d 09 2f 2f |??...}..|}.....//|
|00002360| 20 4d 69 6e 69 6d 7a 69 | 6e 67 20 70 75 73 68 65 | Minimzi|ng pushe|
|00002370| 73 2f 70 6f 70 73 20 76 | 69 61 20 73 74 61 63 6b |s/pops v|ia stack|
|00002380| 20 61 6e 61 6c 79 73 69 | 73 0d 09 53 74 61 63 6b | analysi|s..Stack|
|00002390| 52 65 64 75 63 74 69 6f | 6e 28 20 30 2c 20 6d 50 |Reductio|n( 0, mP|
|000023a0| 72 6f 67 72 61 6d 2e 6c | 65 6e 67 74 68 28 29 20 |rogram.l|ength() |
|000023b0| 29 3b 0d 7d 09 09 0d 0d | 0d 0d 0d 6c 6f 6e 67 20 |);.}....|...long |
|000023c0| 45 78 70 72 56 69 72 74 | 75 61 6c 4d 61 63 68 69 |ExprVirt|ualMachi|
|000023d0| 6e 65 3a 3a 53 74 61 63 | 6b 52 65 64 75 63 74 69 |ne::Stac|kReducti|
|000023e0| 6f 6e 28 20 6c 6f 6e 67 | 20 69 6e 53 74 61 72 74 |on( long| inStart|
|000023f0| 50 43 2c 20 6c 6f 6e 67 | 20 69 6e 45 6e 64 50 43 |PC, long| inEndPC|
|00002400| 20 29 20 7b 0d 09 6c 6f | 6e 67 20 72 65 67 73 49 | ) {..lo|ng regsI|
|00002410| 6e 55 73 65 20 3d 20 30 | 2c 20 6f 70 63 6f 64 65 |nUse = 0|, opcode|
|00002420| 2c 20 66 63 6e 44 65 70 | 74 68 20 3d 20 30 2c 20 |, fcnDep|th = 0, |
|00002430| 70 75 73 68 4c 6f 63 2c | 20 72 65 67 2c 20 72 65 |pushLoc,| reg, re|
|00002440| 67 73 54 6f 50 75 73 68 | 3b 0d 09 6c 6f 6e 67 20 |gsToPush|;..long |
|00002450| 50 43 20 3d 20 69 6e 53 | 74 61 72 74 50 43 2c 20 |PC = inS|tartPC, |
|00002460| 70 72 6f 67 4c 65 6e 2c | 20 73 75 62 52 65 67 73 |progLen,| subRegs|
|00002470| 2c 20 2a 69 6e 73 74 3b | 0d 09 63 68 61 72 2a 20 |, *inst;|..char* |
|00002480| 62 61 73 65 20 3d 20 6d | 50 72 6f 67 72 61 6d 2e |base = m|Program.|
|00002490| 67 65 74 43 53 74 72 28 | 29 3b 0d 09 0d 09 77 68 |getCStr(|);....wh|
|000024a0| 69 6c 65 20 28 20 50 43 | 20 3c 20 69 6e 45 6e 64 |ile ( PC| < inEnd|
|000024b0| 50 43 20 29 20 7b 0d 09 | 09 72 65 67 20 3d 20 2a |PC ) {..|.reg = *|
|000024c0| 28 28 6c 6f 6e 67 2a 29 | 20 28 50 43 20 2b 20 62 |((long*)| (PC + b|
|000024d0| 61 73 65 29 29 3b 0d 09 | 09 6f 70 63 6f 64 65 20 |ase));..|.opcode |
|000024e0| 3d 20 72 65 67 20 26 20 | 30 78 46 46 30 30 30 30 |= reg & |0xFF0000|
|000024f0| 30 30 3b 09 09 2f 2f 20 | 45 78 74 72 61 63 74 20 |00;..// |Extract |
|00002500| 74 68 65 20 6f 70 63 6f | 64 65 0d 09 09 72 65 67 |the opco|de...reg|
|00002510| 20 26 3d 20 30 78 46 46 | 3b 09 09 09 09 09 2f 2f | &= 0xFF|;.....//|
|00002520| 20 45 78 74 72 61 63 74 | 20 74 68 65 20 64 65 73 | Extract| the des|
|00002530| 74 20 72 65 67 0d 09 09 | 0d 09 09 2f 2f 20 57 65 |t reg...|...// We|
|00002540| 27 72 65 20 6f 6e 6c 79 | 20 69 6e 74 65 72 65 73 |'re only| interes|
|00002550| 74 65 64 20 69 6e 20 72 | 6f 6f 74 20 6c 65 76 65 |ted in r|oot leve|
|00002560| 6c 20 70 6f 70 2f 70 75 | 73 68 65 73 20 28 69 65 |l pop/pu|shes (ie|
|00002570| 2c 20 77 68 65 6e 20 66 | 63 6e 44 65 70 74 68 20 |, when f|cnDepth |
|00002580| 3d 3d 20 30 29 0d 09 09 | 73 77 69 74 63 68 20 28 |== 0)...|switch (|
|00002590| 20 6f 70 63 6f 64 65 20 | 29 20 7b 0d 09 09 09 0d | opcode |) {.....|
|000025a0| 09 09 09 63 61 73 65 20 | 4f 50 5f 4d 41 53 53 50 |...case |OP_MASSP|
|000025b0| 55 53 48 3a 0d 09 09 09 | 09 69 66 20 28 20 66 63 |USH:....|.if ( fc|
|000025c0| 6e 44 65 70 74 68 20 3d | 3d 20 30 20 29 20 7b 0d |nDepth =|= 0 ) {.|
|000025d0| 09 09 09 09 09 70 75 73 | 68 4c 6f 63 20 3d 20 50 |.....pus|hLoc = P|
|000025e0| 43 3b 0d 09 09 09 09 09 | 72 65 67 73 49 6e 55 73 |C;......|regsInUs|
|000025f0| 65 20 3d 20 72 65 67 3b | 09 2f 2f 20 57 65 20 6b |e = reg;|.// We k|
|00002600| 6e 6f 77 20 77 68 61 74 | 27 73 20 69 6e 20 75 73 |now what|'s in us|
|00002610| 65 20 62 79 20 77 68 61 | 74 20 74 68 65 20 63 6f |e by wha|t the co|
|00002620| 6d 70 69 6c 65 72 20 77 | 61 6e 74 65 64 20 75 73 |mpiler w|anted us|
|00002630| 20 74 6f 20 70 75 73 68 | 0d 09 09 09 09 7d 0d 09 | to push|.....}..|
|00002640| 09 09 09 66 63 6e 44 65 | 70 74 68 2b 2b 3b 0d 09 |...fcnDe|pth++;..|
|00002650| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 0d 09 09 |...break|;.......|
|00002660| 09 63 61 73 65 20 4f 50 | 5f 4d 41 53 53 50 4f 50 |.case OP|_MASSPOP|
|00002670| 3a 0d 09 09 09 09 66 63 | 6e 44 65 70 74 68 2d 2d |:.....fc|nDepth--|
|00002680| 3b 0d 09 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 09 |;.....br|eak;....|
|00002690| 09 0d 09 09 09 63 61 73 | 65 20 4f 50 5f 4c 4f 41 |.....cas|e OP_LOA|
|000026a0| 44 49 4d 4d 45 44 3a 0d | 09 09 09 09 50 43 20 2b |DIMMED:.|....PC +|
|000026b0| 3d 20 34 3b 0d 09 09 09 | 63 61 73 65 20 4f 50 5f |= 4;....|case OP_|
|000026c0| 4c 4f 41 44 3a 0d 09 09 | 09 09 50 43 20 2b 3d 20 |LOAD:...|..PC += |
|000026d0| 34 3b 0d 09 09 7d 0d 09 | 09 09 09 0d 09 09 2f 2f |4;...}..|......//|
|000026e0| 20 73 65 65 20 77 68 61 | 74 20 72 65 67 73 20 61 | see wha|t regs a|
|000026f0| 72 65 20 69 6e 20 75 73 | 65 2d 2d 73 6b 69 70 20 |re in us|e--skip |
|00002700| 6f 76 65 72 20 69 6e 73 | 74 73 20 6e 6f 74 20 61 |over ins|ts not a|
|00002710| 74 20 74 68 65 20 72 6f | 6f 74 20 6c 65 76 65 6c |t the ro|ot level|
|00002720| 0d 09 09 69 66 20 28 20 | 66 63 6e 44 65 70 74 68 |...if ( |fcnDepth|
|00002730| 20 3d 3d 20 30 20 29 20 | 7b 0d 09 09 09 73 77 69 | == 0 ) |{....swi|
|00002740| 74 63 68 20 28 20 6f 70 | 63 6f 64 65 20 29 20 7b |tch ( op|code ) {|
|00002750| 0d 09 09 09 09 0d 09 09 | 09 09 63 61 73 65 20 4f |........|..case O|
|00002760| 50 5f 4f 50 45 52 3a 0d | 09 09 09 09 09 72 65 67 |P_OPER:.|.....reg|
|00002770| 73 49 6e 55 73 65 20 7c | 3d 20 28 20 32 20 3c 3c |sInUse ||= ( 2 <<|
|00002780| 20 72 65 67 20 29 3b 0d | 09 09 09 09 63 61 73 65 | reg );.|....case|
|00002790| 20 4f 50 5f 4c 4f 41 44 | 49 4d 4d 45 44 3a 0d 09 | OP_LOAD|IMMED:..|
|000027a0| 09 09 09 63 61 73 65 20 | 4f 50 5f 4c 4f 41 44 3a |...case |OP_LOAD:|
|000027b0| 0d 09 09 09 09 63 61 73 | 65 20 4f 50 5f 4d 41 54 |.....cas|e OP_MAT|
|000027c0| 48 4f 50 3a 0d 09 09 09 | 09 63 61 73 65 20 4f 50 |HOP:....|.case OP|
|000027d0| 5f 4d 4f 56 45 55 50 3a | 0d 09 09 09 09 63 61 73 |_MOVEUP:|.....cas|
|000027e0| 65 20 4f 50 5f 4d 4f 56 | 45 5f 46 52 30 3a 0d 09 |e OP_MOV|E_FR0:..|
|000027f0| 09 09 09 09 72 65 67 73 | 49 6e 55 73 65 20 7c 3d |....regs|InUse |=|
|00002800| 20 28 20 31 20 3c 3c 20 | 72 65 67 20 29 3b 0d 09 | ( 1 << |reg );..|
|00002810| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 09 09 0d |...break|;.......|
|00002820| 09 09 09 09 2f 2f 20 43 | 61 74 63 68 20 74 68 65 |....// C|atch the|
|00002830| 20 6c 65 61 76 69 6e 67 | 20 61 20 66 63 6e 20 61 | leaving| a fcn a|
|00002840| 74 20 74 68 65 20 72 6f | 6f 74 20 6c 65 76 65 6c |t the ro|ot level|
|00002850| 0d 09 09 09 09 63 61 73 | 65 20 4f 50 5f 4d 41 53 |.....cas|e OP_MAS|
|00002860| 53 50 4f 50 3a 0d 09 09 | 09 09 0d 09 09 09 09 09 |SPOP:...|........|
|00002870| 2f 2f 20 47 65 74 20 74 | 68 65 20 72 65 67 73 20 |// Get t|he regs |
|00002880| 74 68 61 74 20 67 65 74 | 20 73 75 62 2d 75 73 65 |that get| sub-use|
|00002890| 64 20 28 69 65 2c 20 75 | 73 65 64 20 62 65 74 77 |d (ie, u|sed betw|
|000028a0| 65 65 6e 20 70 75 73 68 | 4c 6f 63 20 61 6e 64 20 |een push|Loc and |
|000028b0| 50 43 29 0d 09 09 09 09 | 09 70 72 6f 67 4c 65 6e |PC).....|.progLen|
|000028c0| 20 3d 20 6d 50 72 6f 67 | 72 61 6d 2e 6c 65 6e 67 | = mProg|ram.leng|
|000028d0| 74 68 28 29 3b 0d 09 09 | 09 09 09 73 75 62 52 65 |th();...|...subRe|
|000028e0| 67 73 20 3d 20 53 74 61 | 63 6b 52 65 64 75 63 74 |gs = Sta|ckReduct|
|000028f0| 69 6f 6e 28 20 70 75 73 | 68 4c 6f 63 20 2b 20 34 |ion( pus|hLoc + 4|
|00002900| 2c 20 50 43 20 29 3b 0d | 09 09 09 09 09 0d 09 09 |, PC );.|........|
|00002910| 09 09 09 2f 2f 20 53 74 | 61 63 6b 52 65 64 75 63 |...// St|ackReduc|
|00002920| 74 69 6f 6e 28 29 20 6d | 61 79 20 68 61 76 65 20 |tion() m|ay have |
|00002930| 65 6c 6d 69 6e 61 74 65 | 64 20 69 6e 73 74 72 75 |elminate|d instru|
|00002940| 63 74 69 6f 6e 73 2c 20 | 73 6f 20 61 64 6a 75 73 |ctions, |so adjus|
|00002950| 74 20 6f 75 72 20 50 43 | 0d 09 09 09 09 09 50 43 |t our PC|......PC|
|00002960| 09 09 2d 3d 20 70 72 6f | 67 4c 65 6e 20 2d 20 6d |..-= pro|gLen - m|
|00002970| 50 72 6f 67 72 61 6d 2e | 6c 65 6e 67 74 68 28 29 |Program.|length()|
|00002980| 3b 0d 09 09 09 09 09 69 | 6e 45 6e 64 50 43 20 2d |;......i|nEndPC -|
|00002990| 3d 20 70 72 6f 67 4c 65 | 6e 20 2d 20 6d 50 72 6f |= progLe|n - mPro|
|000029a0| 67 72 61 6d 2e 6c 65 6e | 67 74 68 28 29 3b 0d 09 |gram.len|gth();..|
|000029b0| 09 09 09 09 0d 09 09 09 | 09 09 2f 2f 20 52 65 61 |........|..// Rea|
|000029c0| 73 73 69 67 6e 20 77 68 | 61 74 20 72 65 67 73 20 |ssign wh|at regs |
|000029d0| 67 65 74 20 70 75 73 68 | 65 64 20 74 68 65 6e 20 |get push|ed then |
|000029e0| 70 6f 70 70 65 64 2e 20 | 20 57 65 20 6d 75 73 74 |popped. | We must|
|000029f0| 20 70 75 73 68 20 74 68 | 65 20 72 65 67 73 20 74 | push th|e regs t|
|00002a00| 68 61 74 20 67 65 74 20 | 75 73 65 64 20 69 6e 20 |hat get |used in |
|00002a10| 74 68 65 20 73 75 62 20 | 66 63 6e 20 61 6e 64 20 |the sub |fcn and |
|00002a20| 77 65 20 75 73 65 20 68 | 65 72 65 0d 09 09 09 09 |we use h|ere.....|
|00002a30| 09 72 65 67 73 54 6f 50 | 75 73 68 20 3d 20 73 75 |.regsToP|ush = su|
|00002a40| 62 52 65 67 73 20 26 20 | 72 65 67 73 49 6e 55 73 |bRegs & |regsInUs|
|00002a50| 65 3b 0d 09 09 09 09 09 | 69 66 20 28 20 72 65 67 |e;......|if ( reg|
|00002a60| 73 54 6f 50 75 73 68 20 | 29 20 7b 0d 09 09 09 09 |sToPush |) {.....|
|00002a70| 09 09 69 6e 73 74 20 3d | 20 28 6c 6f 6e 67 2a 29 |..inst =| (long*)|
|00002a80| 20 28 62 61 73 65 20 2b | 20 70 75 73 68 4c 6f 63 | (base +| pushLoc|
|00002a90| 29 3b 0d 09 09 09 09 09 | 09 2a 69 6e 73 74 20 3d |);......|.*inst =|
|00002aa0| 20 4f 50 5f 4d 41 53 53 | 50 55 53 48 20 7c 20 72 | OP_MASS|PUSH | r|
|00002ab0| 65 67 73 54 6f 50 75 73 | 68 3b 09 09 2f 2f 20 52 |egsToPus|h;..// R|
|00002ac0| 65 61 73 73 69 67 6e 20 | 74 68 65 20 70 75 73 68 |eassign |the push|
|00002ad0| 0d 09 09 09 09 09 09 69 | 6e 73 74 20 3d 20 28 6c |.......i|nst = (l|
|00002ae0| 6f 6e 67 2a 29 20 28 62 | 61 73 65 20 2b 20 50 43 |ong*) (b|ase + PC|
|00002af0| 29 3b 0d 09 09 09 09 09 | 09 2a 69 6e 73 74 20 3d |);......|.*inst =|
|00002b00| 20 4f 50 5f 4d 41 53 53 | 50 4f 50 20 7c 20 72 65 | OP_MASS|POP | re|
|00002b10| 67 73 54 6f 50 75 73 68 | 3b 20 7d 09 09 2f 2f 20 |gsToPush|; }..// |
|00002b20| 52 65 61 73 73 69 67 6e | 20 74 68 65 20 70 6f 70 |Reassign| the pop|
|00002b30| 0d 09 09 09 09 09 0d 09 | 09 09 09 09 2f 2f 20 49 |........|....// I|
|00002b40| 66 20 6e 6f 20 72 65 67 | 73 20 6e 65 65 64 20 74 |f no reg|s need t|
|00002b50| 6f 20 67 65 74 20 70 75 | 73 68 65 64 2c 20 64 65 |o get pu|shed, de|
|00002b60| 6c 65 74 65 20 74 68 65 | 20 70 6f 70 20 61 6e 64 |lete the| pop and|
|00002b70| 20 70 75 73 68 20 69 6e | 73 74 73 0d 09 09 09 09 | push in|sts.....|
|00002b80| 09 65 6c 73 65 20 7b 0d | 09 09 09 09 09 09 6d 50 |.else {.|......mP|
|00002b90| 72 6f 67 72 61 6d 2e 52 | 65 6d 6f 76 65 28 20 50 |rogram.R|emove( P|
|00002ba0| 43 20 2b 20 31 2c 20 34 | 20 29 3b 0d 09 09 09 09 |C + 1, 4| );.....|
|00002bb0| 09 09 6d 50 72 6f 67 72 | 61 6d 2e 52 65 6d 6f 76 |..mProgr|am.Remov|
|00002bc0| 65 28 20 70 75 73 68 4c | 6f 63 20 2b 20 31 2c 20 |e( pushL|oc + 1, |
|00002bd0| 34 20 29 3b 0d 09 09 09 | 09 09 09 50 43 09 09 2d |4 );....|...PC..-|
|00002be0| 3d 20 38 3b 0d 09 09 09 | 09 09 09 69 6e 45 6e 64 |= 8;....|...inEnd|
|00002bf0| 50 43 09 2d 3d 20 38 3b | 0d 09 09 09 09 09 7d 0d |PC.-= 8;|......}.|
|00002c00| 09 09 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 09 7d |.....bre|ak;....}|
|00002c10| 0d 09 09 7d 0d 09 09 0d | 09 09 2f 2f 20 4d 6f 76 |...}....|..// Mov|
|00002c20| 65 20 74 68 65 20 50 43 | 20 61 6c 6f 6e 67 2c 20 |e the PC| along, |
|00002c30| 66 6f 72 20 77 65 20 6a | 75 73 74 20 6c 6f 6f 6b |for we j|ust look|
|00002c40| 65 64 20 61 74 20 61 6e | 20 69 6e 73 74 72 75 63 |ed at an| instruc|
|00002c50| 74 69 6f 6e 0d 09 09 50 | 43 20 2b 3d 20 34 3b 0d |tion...P|C += 4;.|
|00002c60| 09 7d 0d 09 0d 09 72 65 | 74 75 72 6e 20 72 65 67 |.}....re|turn reg|
|00002c70| 73 49 6e 55 73 65 3b 0d | 7d 0d 0d 2a 2f 0d 0d 0d |sInUse;.|}..*/...|
|00002c80| 0d 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ca0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d00| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00002d10| 00 00 de 04 00 02 3b 00 | 00 00 f8 00 00 00 15 54 |......;.|.......T|
|00002d20| 45 58 54 64 6f 73 61 01 | 00 01 00 04 00 00 00 b2 |EXTdosa.|........|
|00002d30| 21 ef 83 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |!.......|........|
|00002d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d50| 00 00 00 00 00 00 8c 00 | 00 00 01 00 00 00 00 00 |........|........|
|00002d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d70| 00 00 00 04 00 00 df 04 | 00 02 3c 00 00 00 f9 00 |........|..<.....|
|00002d80| 00 00 16 54 45 58 54 64 | 6f 73 61 01 00 01 00 04 |...TEXTd|osa.....|
|00002d90| 00 00 00 b2 21 ef 83 00 | 00 00 00 00 00 00 00 00 |....!...|........|
|00002da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002db0| 00 00 00 00 00 00 00 00 | 00 00 8c 00 00 00 01 00 |........|........|
|00002dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002dd0| 00 00 00 00 00 00 00 04 | 00 00 e0 04 00 02 3d 00 |........|......=.|
|00002de0| 00 00 fa 00 00 00 15 54 | 45 58 54 64 6f 73 61 01 |.......T|EXTdosa.|
|00002df0| 00 01 00 04 00 00 00 b2 | 21 ef 83 00 00 00 00 00 |........|!.......|
|00002e00| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00002e10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e20| 00 00 00 00 00 00 00 03 | 00 04 00 49 00 12 02 47 |........|...I...G|
|00002e30| 02 76 00 49 00 12 02 47 | 02 76 b3 c4 04 dc 00 00 |.v.I...G|.v......|
|00002e40| 0d 4d 00 00 0d 57 00 00 | 0c af 01 00 00 00 00 04 |.M...W..|........|
|00002e50| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00002e60| 00 00 00 46 05 c2 e7 3c | 17 e0 00 00 00 1c 00 46 |...F...<|.......F|
|00002e70| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00002e80| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00002e90| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|00002ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+