--- nono/m680x0/gentable.php 2026/04/29 17:05:08 1.1.1.4 +++ nono/m680x0/gentable.php 2026/04/29 17:05:15 1.1.1.5 @@ -34,7 +34,6 @@ $insttable = read_instructions($mputype, "instructions.txt"); $insttable = expandDST($insttable); $insttable = expandSS($insttable); - $insttable = expandCond($insttable); makeop16($insttable); $op10table = makeop10table(); $op10func = makeop10func($op10table); @@ -250,55 +249,6 @@ function expandSS($insttable) return $inst2table; } -// $insttable の cccc を展開する。 -function expandCond($insttable) -{ - $cccc = array( - "0000" => "t", - "0001" => "f", - "0010" => "hi", - "0011" => "ls", - "0100" => "cc", - "0101" => "cs", - "0110" => "ne", - "0111" => "eq", - "1000" => "vc", - "1001" => "vs", - "1010" => "pl", - "1011" => "mi", - "1100" => "ge", - "1101" => "lt", - "1110" => "gt", - "1111" => "le", - ); - $inst2table = array(); - foreach ($insttable as $inst) { - if (preg_match("/cccc/", $inst["bits"])) { - foreach ($cccc as $cbit => $cname) { - $uname = strtoupper($cname); - $inst2 = $inst; - $inst2["bits"] = preg_replace("/cccc/", $cbit, $inst["bits"]); - $inst2["name"] = preg_replace("/cc/", $cname, $inst["name"]); - $inst2["text"] = preg_replace("/cc/", $uname, $inst["text"]); - $inst2table[] = $inst2; - } - } else { - $inst2table[] = $inst; - } - } - - // デバッグ表示 - if (0) { - print "expandCond\n"; - foreach ($inst2table as $inst) { - printf("%s|%s|%-14s|%s\n", - $inst["bits"], $inst["addr"], $inst["name"], $inst["text"]); - } - } - - return $inst2table; -} - // insttable を16ビットの op16table に展開。 // $optable = array( // 0 => &$inst0, @@ -597,3 +547,4 @@ function write_file($filename, $str) print "Output: {$filename}\n"; } +?>