URL
https://opencores.org/ocsvn/m1_core/m1_core/trunk
[/] [m1_core/] [trunk/] [tools/] [bin/] [dump2hex.php] - Diff between revs 2 and 54
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 2 |
Rev 54 |
#!/usr/bin/php -q
|
#!/usr/bin/php -q
|
<?php
|
<?php
|
|
|
// Open the stdin
|
// Open the stdin
|
$fp = fopen("php://stdin", "r");
|
$fp = fopen("php://stdin", "r");
|
|
|
// Discard first lines
|
// Discard first lines
|
for($i=0; $i<6; $i++) fgets($fp);
|
for($i=0; $i<6; $i++) fgets($fp);
|
|
|
// Print only the opcodes to stdout
|
// Print only the opcodes to stdout
|
while (!feof($fp)) {
|
while (!feof($fp)) {
|
$line = fgets($fp);
|
$line = fgets($fp);
|
$opcode = substr($line, 6, 8);
|
$opcode = substr($line, 6, 8);
|
$caratteri = strlen($opcode);
|
$caratteri = strlen($opcode);
|
if($caratteri != 0){
|
if($caratteri != 0){
|
echo $opcode."\n";
|
echo $opcode."\n";
|
}
|
}
|
else{
|
else{
|
for($i=0; $i<1; $i++) fgets($fp);
|
for($i=0; $i<1; $i++) fgets($fp);
|
}
|
}
|
}
|
}
|
|
|
// Close the input file
|
// Close the input file
|
fclose($fp);
|
fclose($fp);
|
|
|
?>
|
?>
|
|
|
|
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.