Revision 30,
1.1 KB
checked in by pntsvt00, 14 years ago
(diff) |
aggiornata tool-chain
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[17] | 1 | #!/usr/bin/php -q |
---|
| 2 | <?php |
---|
| 3 | |
---|
| 4 | // Open the stdin |
---|
| 5 | $fp = fopen("php://stdin", "r"); |
---|
| 6 | |
---|
| 7 | // Discard first lines |
---|
[30] | 8 | for($i=0; $i<7; $i++) fgets($fp); |
---|
[17] | 9 | |
---|
[26] | 10 | // instruction start at address 10h |
---|
| 11 | //echo "@ 10\n"; |
---|
| 12 | echo "// inserisco 16 ff per partire da 10h e scrivo op4,op3,op2,op1 \n"; |
---|
[30] | 13 | echo "0001\n"; |
---|
| 14 | echo "0000\n"; |
---|
| 15 | echo "0001\n"; |
---|
| 16 | echo "0000\n"; |
---|
| 17 | echo "0001\n"; |
---|
| 18 | echo "0000\n"; |
---|
| 19 | echo "0001\n"; |
---|
| 20 | echo "0000\n"; |
---|
| 21 | echo "0001\n"; |
---|
| 22 | echo "0000\n"; |
---|
| 23 | echo "0001\n"; |
---|
| 24 | echo "0000\n"; |
---|
| 25 | echo "0001\n"; |
---|
| 26 | echo "0000\n"; |
---|
| 27 | echo "0001\n"; |
---|
| 28 | echo "0000\n"; |
---|
| 29 | |
---|
[17] | 30 | // Print only the opcodes to stdout |
---|
| 31 | while (!feof($fp)) { |
---|
| 32 | $line = fgets($fp); |
---|
[26] | 33 | $opcode1 = substr($line, 6, 2); |
---|
[19] | 34 | $opcode2 = substr($line, 9, 2); |
---|
[26] | 35 | $opcode3 = substr($line, 12, 2); |
---|
| 36 | $opcode4 = substr($line, 15, 2); |
---|
| 37 | $caratteri = strlen($opcode1); |
---|
[17] | 38 | if($caratteri != 0){ |
---|
[26] | 39 | echo $opcode2.$opcode1; |
---|
| 40 | //echo $opcode1.$opcode2; |
---|
[25] | 41 | echo "\t //".$line; |
---|
[26] | 42 | echo $opcode4.$opcode3."\n"; |
---|
| 43 | //echo $opcode3.$opcode4."\n"; |
---|
[17] | 44 | } |
---|
| 45 | else{ |
---|
| 46 | for($i=0; $i<1; $i++) fgets($fp); |
---|
| 47 | } |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | // Close the input file |
---|
| 51 | fclose($fp); |
---|
| 52 | |
---|
| 53 | ?> |
---|
| 54 | |
---|
Note: See
TracBrowser
for help on using the repository browser.