Revision 17,
672 bytes
checked in by pntsvt00, 14 years ago
(diff) |
la simulazione legge dalla flash
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!/usr/bin/php -q |
---|
2 | <?php |
---|
3 | |
---|
4 | // Open the stdin |
---|
5 | $fp = fopen("php://stdin", "r"); |
---|
6 | |
---|
7 | // Discard first lines |
---|
8 | for($i=0; $i<6; $i++) fgets($fp); |
---|
9 | |
---|
10 | // Print only the opcodes to stdout |
---|
11 | while (!feof($fp)) { |
---|
12 | $line = fgets($fp); |
---|
13 | /*$opcode = substr($line, 8, 8); |
---|
14 | $caratteri = strlen($opcode); |
---|
15 | if($caratteri != 0){ |
---|
16 | echo $opcode."\n"; |
---|
17 | }*/ |
---|
18 | |
---|
19 | $opcode = substr($line, 8, 4); |
---|
20 | $caratteri = strlen($opcode); |
---|
21 | if($caratteri != 0){ |
---|
22 | echo $opcode."\n"; |
---|
23 | $opcode = substr($line, 12, 4); |
---|
24 | echo $opcode."\n"; |
---|
25 | } |
---|
26 | else{ |
---|
27 | for($i=0; $i<1; $i++) fgets($fp); |
---|
28 | } |
---|
29 | } |
---|
30 | |
---|
31 | // Close the input file |
---|
32 | fclose($fp); |
---|
33 | |
---|
34 | ?> |
---|
35 | |
---|
Note: See
TracBrowser
for help on using the repository browser.