Revision 26,
1.1 KB
checked in by pntsvt00, 14 years ago
(diff) |
checkpoint: baco con store consecutivi
|
-
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<8; $i++) fgets($fp); |
---|
9 | |
---|
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"; |
---|
13 | echo "ffff\n"; |
---|
14 | echo "ffff\n"; |
---|
15 | echo "ffff\n"; |
---|
16 | echo "ffff\n"; |
---|
17 | echo "ffff\n"; |
---|
18 | echo "ffff\n"; |
---|
19 | echo "ffff\n"; |
---|
20 | echo "ffff\n"; |
---|
21 | echo "ffff\n"; |
---|
22 | echo "ffff\n"; |
---|
23 | echo "ffff\n"; |
---|
24 | echo "ffff\n"; |
---|
25 | echo "ffff\n"; |
---|
26 | echo "ffff\n"; |
---|
27 | echo "ffff\n"; |
---|
28 | echo "ffff\n"; |
---|
29 | // Print only the opcodes to stdout |
---|
30 | while (!feof($fp)) { |
---|
31 | $line = fgets($fp); |
---|
32 | $opcode1 = substr($line, 6, 2); |
---|
33 | $opcode2 = substr($line, 9, 2); |
---|
34 | $opcode3 = substr($line, 12, 2); |
---|
35 | $opcode4 = substr($line, 15, 2); |
---|
36 | $caratteri = strlen($opcode1); |
---|
37 | if($caratteri != 0){ |
---|
38 | echo $opcode2.$opcode1; |
---|
39 | //echo $opcode1.$opcode2; |
---|
40 | echo "\t //".$line; |
---|
41 | echo $opcode4.$opcode3."\n"; |
---|
42 | //echo $opcode3.$opcode4."\n"; |
---|
43 | } |
---|
44 | else{ |
---|
45 | for($i=0; $i<1; $i++) fgets($fp); |
---|
46 | } |
---|
47 | } |
---|
48 | |
---|
49 | // Close the input file |
---|
50 | fclose($fp); |
---|
51 | |
---|
52 | ?> |
---|
53 | |
---|
Note: See
TracBrowser
for help on using the repository browser.