Canola  0.8.D001
lib/opcode.cc
Go to the documentation of this file.
00001 //
00002 // canola - canon canola 1614p emulator
00003 // Copyright (C) 2011 Peter Miller
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License, version 3, as
00007 // published by the Free Software Foundation.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License along
00015 // with this program. If not, see <http://www.gnu.org/licenses/>.
00016 //
00017 
00018 #include <lib/opcode.h>
00019 #include <lib/std_string_printf.h>
00020 #include <lib/unicode.h>
00021 
00022 
00023 std::string
00024 opcode_name(opcode_t n)
00025 {
00026     switch (n)
00027     {
00028     case opcode_zero:
00029         goto yuck;
00030 
00031     case opcode_plus_equals:
00032         return "+=";
00033 
00034     case opcode_minus_equals:
00035         return "-=";
00036 
00037     case opcode_mul:
00038         return "*";
00039 
00040     case opcode_div:
00041         return "/";
00042 
00043     case opcode_sqrt:
00044         return "SQRT";
00045 
00046     case opcode_ent:
00047         return "ENT";
00048 
00049     case opcode_sj:
00050         return "SJ";
00051 
00052     case opcode_ej:
00053         return "EJ";
00054 
00055     case opcode_mj:
00056         return "MJ";
00057 
00058     case opcode_uj:
00059         return "UJ";
00060 
00061     case opcode_fj:
00062         return "FJ";
00063 
00064     case opcode_suj:
00065         return "SUJ";
00066 
00067     case opcode_sfj:
00068         return "SFJ";
00069 
00070     case opcode_srj:
00071         return "SRJ";
00072 
00073     case opcode_m1:
00074         return "M1";
00075 
00076     case opcode_m2:
00077         return "M2";
00078 
00079     case opcode_m3:
00080         return "M3";
00081 
00082     case opcode_m4:
00083         return "M4";
00084 
00085     case opcode_m5:
00086         return "M5";
00087 
00088     case opcode_m6:
00089         return "M6";
00090 
00091     case opcode_m7:
00092         return "M7";
00093 
00094     case opcode_m8:
00095         return "M8";
00096 
00097     case opcode_m9:
00098         return "M9";
00099 
00100     case opcode_m10:
00101         return "M10";
00102 
00103     case opcode_m11:
00104         return "M11";
00105 
00106     case opcode_m12:
00107         return "M12";
00108 
00109     case opcode_m13:
00110         return "M13";
00111 
00112     case opcode_m14:
00113         return "M14";
00114 
00115     case opcode_mm1:
00116         return "MM1";
00117 
00118     case opcode_mm2:
00119         return "MM2";
00120 
00121     case opcode_sm3:
00122         return "SM3";
00123 
00124     case opcode_sm4:
00125         return "SM4";
00126 
00127     case opcode_sm5:
00128         return "SM5";
00129 
00130     case opcode_sm6:
00131         return "SM6";
00132 
00133     case opcode_sm7:
00134         return "SM7";
00135 
00136     case opcode_sm8:
00137         return "SM8";
00138 
00139     case opcode_sm9:
00140         return "SM9";
00141 
00142     case opcode_sm10:
00143         return "SM10";
00144 
00145     case opcode_sm11:
00146         return "SM11";
00147 
00148     case opcode_sm12:
00149         return "SM12";
00150 
00151     case opcode_sm13:
00152         return "SM13";
00153 
00154     case opcode_sm14:
00155         return "SM14";
00156 
00157     case opcode_rm1:
00158         return "RM1";
00159 
00160     case opcode_rm2:
00161         return "RM2";
00162 
00163     case opcode_rm3:
00164         return "RM3";
00165 
00166     case opcode_rm4:
00167         return "RM4";
00168 
00169     case opcode_rm5:
00170         return "RM5";
00171 
00172     case opcode_rm6:
00173         return "RM6";
00174 
00175     case opcode_rm7:
00176         return "RM7";
00177 
00178     case opcode_rm8:
00179         return "RM8";
00180 
00181     case opcode_rm9:
00182         return "RM9";
00183 
00184     case opcode_rm10:
00185         return "RM10";
00186 
00187     case opcode_rm11:
00188         return "RM11";
00189 
00190     case opcode_rm12:
00191         return "RM12";
00192 
00193     case opcode_rm13:
00194         return "RM13";
00195 
00196     case opcode_rm14:
00197         return "RM14";
00198 
00199     case opcode_clear_indicator:
00200         return "CI";
00201 
00202     case opcode_cm1:
00203         return "CM1";
00204 
00205     case opcode_cm2:
00206         return "CM2";
00207 
00208     case opcode_cm3:
00209         return "CM3";
00210 
00211     case opcode_cm4:
00212         return "CM4";
00213 
00214     case opcode_cm5:
00215         return "CM5";
00216 
00217     case opcode_cm6:
00218         return "CM6";
00219 
00220     case opcode_cm7:
00221         return "CM7";
00222 
00223     case opcode_cm8:
00224         return "CM8";
00225 
00226     case opcode_cm9:
00227         return "CM9";
00228 
00229     case opcode_cm10:
00230         return "CM10";
00231 
00232     case opcode_cm11:
00233         return "CM11";
00234 
00235     case opcode_cm12:
00236         return "CM12";
00237 
00238     case opcode_cm13:
00239         return "CM13";
00240 
00241     case opcode_cm14:
00242         return "CM14";
00243 
00244     case opcode_dot:
00245         return ".";
00246 
00247     case opcode_rv:
00248         return "RV";
00249 
00250     case opcode_right:
00251         return "->";
00252 
00253     case opcode_chg_sign:
00254         return "CS";
00255 
00256     case opcode_round_down:
00257         return "FLOOR";
00258 
00259     case opcode_round_off:
00260         return "ROUND";
00261 
00262     case opcode_round_up:
00263         return "CEIL";
00264 
00265     case opcode_print:
00266         return "PRINT";
00267 
00268     case opcode_fd:
00269         return "FD";
00270 
00271     case opcode_n0:
00272         return "0";
00273 
00274     case opcode_n1:
00275         return "1";
00276 
00277     case opcode_n2:
00278         return "2";
00279 
00280     case opcode_n3:
00281         return "3";
00282 
00283     case opcode_n4:
00284         return "4";
00285 
00286     case opcode_n5:
00287         return "5";
00288 
00289     case opcode_n6:
00290         return "6";
00291 
00292     case opcode_n7:
00293         return "7";
00294 
00295     case opcode_n8:
00296         return "8";
00297 
00298     case opcode_n9:
00299         return "9";
00300 
00301     case opcode_n10:
00302         return "$710"; // otherwise is ambiguous
00303 
00304     case opcode_n11:
00305         return "$711"; // otherwise is ambiguous
00306 
00307     case opcode_n12:
00308         return "$712"; // otherwise is ambiguous
00309 
00310     case opcode_n13:
00311         return "$713"; // otherwise is ambiguous
00312 
00313     case opcode_n14:
00314         return "$714"; // otherwise is ambiguous
00315 
00316     case opcode_extended_c:
00317         return "C";
00318 
00319     case opcode_extended_start:
00320         return "START";
00321 
00322     case opcode_extended_m3_tilde:
00323         return "M3~";
00324 
00325     case opcode_extended_sm3_tilde:
00326         return "SM3~";
00327 
00328     case opcode_extended_rm3_tilde:
00329         return "RM3~";
00330 
00331     case opcode_extended_cm3_tilde:
00332         return "CM3~";
00333 
00334     case opcode_extended_off:
00335         return "OFF";
00336 
00337     case opcode_extended_program_print:
00338         return "PROGRAM_PRINT";
00339 
00340     case opcode_extended_display_print:
00341         return "DISPLAY_PRINT";
00342 
00343     case opcode_extended_paper_feed:
00344         return "PAPER_FEED";
00345 
00346     case opcode_extended_rounding_switch_up:
00347         return "rounding_switch_up";
00348 
00349     case opcode_extended_rounding_switch_off:
00350         return "rounding_switch_off";
00351 
00352     case opcode_extended_rounding_switch_down:
00353         return "rounding_switch_down";
00354 
00355     case opcode_extended_decimal_point_selector_0:
00356         return "decimal_point_selector_0";
00357 
00358     case opcode_extended_decimal_point_selector_1:
00359         return "decimal_point_selector_1";
00360 
00361     case opcode_extended_decimal_point_selector_2:
00362         return "decimal_point_selector_2";
00363 
00364     case opcode_extended_decimal_point_selector_3:
00365         return "decimal_point_selector_3";
00366 
00367     case opcode_extended_decimal_point_selector_4:
00368         return "decimal_point_selector_4";
00369 
00370     case opcode_extended_decimal_point_selector_5:
00371         return "decimal_point_selector_5";
00372 
00373     case opcode_extended_decimal_point_selector_6:
00374         return "decimal_point_selector_6";
00375 
00376     case opcode_extended_decimal_point_selector_7:
00377         return "decimal_point_selector_7";
00378 
00379     case opcode_extended_decimal_point_selector_8:
00380         return "decimal_point_selector_8";
00381 
00382     case opcode_extended_decimal_point_selector_9:
00383         return "decimal_point_selector_9";
00384 
00385     case opcode_extended_decimal_point_selector_10:
00386         return "decimal_point_selector_10";
00387 
00388     case opcode_extended_decimal_point_selector_11:
00389         return "decimal_point_selector_11";
00390 
00391     case opcode_extended_decimal_point_selector_12:
00392         return "decimal_point_selector_12";
00393 
00394     case opcode_extended_decimal_point_selector_float:
00395         return "decimal_point_selector_float";
00396 
00397     case opcode_extended_goto_000:
00398     case opcode_extended_goto_001:
00399     case opcode_extended_goto_002:
00400     case opcode_extended_goto_003:
00401     case opcode_extended_goto_004:
00402     case opcode_extended_goto_005:
00403     case opcode_extended_goto_006:
00404     case opcode_extended_goto_007:
00405     case opcode_extended_goto_008:
00406     case opcode_extended_goto_009:
00407     case opcode_extended_goto_010:
00408     case opcode_extended_goto_011:
00409     case opcode_extended_goto_012:
00410     case opcode_extended_goto_013:
00411     case opcode_extended_goto_014:
00412     case opcode_extended_goto_015:
00413     case opcode_extended_goto_100:
00414     case opcode_extended_goto_101:
00415     case opcode_extended_goto_102:
00416     case opcode_extended_goto_103:
00417     case opcode_extended_goto_104:
00418     case opcode_extended_goto_105:
00419     case opcode_extended_goto_106:
00420     case opcode_extended_goto_107:
00421     case opcode_extended_goto_108:
00422     case opcode_extended_goto_109:
00423     case opcode_extended_goto_110:
00424     case opcode_extended_goto_111:
00425     case opcode_extended_goto_112:
00426     case opcode_extended_goto_113:
00427     case opcode_extended_goto_114:
00428     case opcode_extended_goto_115:
00429     case opcode_extended_goto_200:
00430     case opcode_extended_goto_201:
00431     case opcode_extended_goto_202:
00432     case opcode_extended_goto_203:
00433     case opcode_extended_goto_204:
00434     case opcode_extended_goto_205:
00435     case opcode_extended_goto_206:
00436     case opcode_extended_goto_207:
00437     case opcode_extended_goto_208:
00438     case opcode_extended_goto_209:
00439     case opcode_extended_goto_210:
00440     case opcode_extended_goto_211:
00441     case opcode_extended_goto_212:
00442     case opcode_extended_goto_213:
00443     case opcode_extended_goto_214:
00444     case opcode_extended_goto_215:
00445     case opcode_extended_goto_300:
00446     case opcode_extended_goto_301:
00447     case opcode_extended_goto_302:
00448     case opcode_extended_goto_303:
00449     case opcode_extended_goto_304:
00450     case opcode_extended_goto_305:
00451     case opcode_extended_goto_306:
00452     case opcode_extended_goto_307:
00453     case opcode_extended_goto_308:
00454     case opcode_extended_goto_309:
00455     case opcode_extended_goto_310:
00456     case opcode_extended_goto_311:
00457     case opcode_extended_goto_312:
00458     case opcode_extended_goto_313:
00459     case opcode_extended_goto_314:
00460     case opcode_extended_goto_315:
00461     case opcode_extended_goto_400:
00462     case opcode_extended_goto_401:
00463     case opcode_extended_goto_402:
00464     case opcode_extended_goto_403:
00465     case opcode_extended_goto_404:
00466     case opcode_extended_goto_405:
00467     case opcode_extended_goto_406:
00468     case opcode_extended_goto_407:
00469     case opcode_extended_goto_408:
00470     case opcode_extended_goto_409:
00471     case opcode_extended_goto_410:
00472     case opcode_extended_goto_411:
00473     case opcode_extended_goto_412:
00474     case opcode_extended_goto_413:
00475     case opcode_extended_goto_414:
00476     case opcode_extended_goto_415:
00477     case opcode_extended_goto_500:
00478     case opcode_extended_goto_501:
00479     case opcode_extended_goto_502:
00480     case opcode_extended_goto_503:
00481     case opcode_extended_goto_504:
00482     case opcode_extended_goto_505:
00483     case opcode_extended_goto_506:
00484     case opcode_extended_goto_507:
00485     case opcode_extended_goto_508:
00486     case opcode_extended_goto_509:
00487     case opcode_extended_goto_510:
00488     case opcode_extended_goto_511:
00489     case opcode_extended_goto_512:
00490     case opcode_extended_goto_513:
00491     case opcode_extended_goto_514:
00492     case opcode_extended_goto_515:
00493     case opcode_extended_goto_600:
00494     case opcode_extended_goto_601:
00495     case opcode_extended_goto_602:
00496     case opcode_extended_goto_603:
00497     case opcode_extended_goto_604:
00498     case opcode_extended_goto_605:
00499     case opcode_extended_goto_606:
00500     case opcode_extended_goto_607:
00501     case opcode_extended_goto_608:
00502     case opcode_extended_goto_609:
00503     case opcode_extended_goto_610:
00504     case opcode_extended_goto_611:
00505     case opcode_extended_goto_612:
00506     case opcode_extended_goto_613:
00507     case opcode_extended_goto_614:
00508     case opcode_extended_goto_615:
00509     case opcode_extended_goto_700:
00510     case opcode_extended_goto_701:
00511     case opcode_extended_goto_702:
00512     case opcode_extended_goto_703:
00513     case opcode_extended_goto_704:
00514     case opcode_extended_goto_705:
00515     case opcode_extended_goto_706:
00516     case opcode_extended_goto_707:
00517     case opcode_extended_goto_708:
00518     case opcode_extended_goto_709:
00519     case opcode_extended_goto_710:
00520     case opcode_extended_goto_711:
00521     case opcode_extended_goto_712:
00522     case opcode_extended_goto_713:
00523     case opcode_extended_goto_714:
00524     case opcode_extended_goto_715:
00525         return ("UJ@" + opcode_name(opcode_t(n - opcode_extended_goto_000)));
00526 
00527     default:
00528         yuck:
00529         return opcode_raw_name(n);
00530     }
00531 }
00532 
00533 
00534 std::string
00535 opcode_uname(opcode_t n)
00536 {
00537     switch (n)
00538     {
00539     case opcode_zero:
00540         goto yuck;
00541 
00542     case opcode_plus_equals:
00543         return "+=";
00544 
00545     case opcode_minus_equals:
00546         return UNICODE_MINUS "=";
00547 
00548     case opcode_mul:
00549         return UNICODE_MUL;
00550 
00551     case opcode_div:
00552         return UNICODE_DIV;
00553 
00554     case opcode_sqrt:
00555         return UNICODE_SQRT;
00556 
00557     case opcode_ent:
00558         return "ENT";
00559 
00560     case opcode_sj:
00561         return "SJ";
00562 
00563     case opcode_ej:
00564         return "EJ";
00565 
00566     case opcode_mj:
00567         return "MJ";
00568 
00569     case opcode_uj:
00570         return "UJ";
00571 
00572     case opcode_fj:
00573         return "FJ";
00574 
00575     case opcode_suj:
00576         return "SUJ";
00577 
00578     case opcode_sfj:
00579         return "SFJ";
00580 
00581     case opcode_srj:
00582         return "SRJ";
00583 
00584     case opcode_m1:
00585         return "M1";
00586 
00587     case opcode_m2:
00588         return "M2";
00589 
00590     case opcode_m3:
00591         return "M3";
00592 
00593     case opcode_m4:
00594         return "M4";
00595 
00596     case opcode_m5:
00597         return "M5";
00598 
00599     case opcode_m6:
00600         return "M6";
00601 
00602     case opcode_m7:
00603         return "M7";
00604 
00605     case opcode_m8:
00606         return "M8";
00607 
00608     case opcode_m9:
00609         return "M9";
00610 
00611     case opcode_m10:
00612         return "M10";
00613 
00614     case opcode_m11:
00615         return "M11";
00616 
00617     case opcode_m12:
00618         return "M12";
00619 
00620     case opcode_m13:
00621         return "M13";
00622 
00623     case opcode_m14:
00624         return "M14";
00625 
00626     case opcode_mm1:
00627         return "MM1";
00628 
00629     case opcode_mm2:
00630         return "MM2";
00631 
00632     case opcode_sm3:
00633         return "SM3";
00634 
00635     case opcode_sm4:
00636         return "SM4";
00637 
00638     case opcode_sm5:
00639         return "SM5";
00640 
00641     case opcode_sm6:
00642         return "SM6";
00643 
00644     case opcode_sm7:
00645         return "SM7";
00646 
00647     case opcode_sm8:
00648         return "SM8";
00649 
00650     case opcode_sm9:
00651         return "SM9";
00652 
00653     case opcode_sm10:
00654         return "SM10";
00655 
00656     case opcode_sm11:
00657         return "SM11";
00658 
00659     case opcode_sm12:
00660         return "SM12";
00661 
00662     case opcode_sm13:
00663         return "SM13";
00664 
00665     case opcode_sm14:
00666         return "SM14";
00667 
00668     case opcode_rm1:
00669         return "RM1";
00670 
00671     case opcode_rm2:
00672         return "RM2";
00673 
00674     case opcode_rm3:
00675         return "RM3";
00676 
00677     case opcode_rm4:
00678         return "RM4";
00679 
00680     case opcode_rm5:
00681         return "RM5";
00682 
00683     case opcode_rm6:
00684         return "RM6";
00685 
00686     case opcode_rm7:
00687         return "RM7";
00688 
00689     case opcode_rm8:
00690         return "RM8";
00691 
00692     case opcode_rm9:
00693         return "RM9";
00694 
00695     case opcode_rm10:
00696         return "RM10";
00697 
00698     case opcode_rm11:
00699         return "RM11";
00700 
00701     case opcode_rm12:
00702         return "RM12";
00703 
00704     case opcode_rm13:
00705         return "RM13";
00706 
00707     case opcode_rm14:
00708         return "RM14";
00709 
00710     case opcode_clear_indicator:
00711         return "CE";
00712 
00713     case opcode_cm1:
00714         return "CM1";
00715 
00716     case opcode_cm2:
00717         return "CM2";
00718 
00719     case opcode_cm3:
00720         return "CM3";
00721 
00722     case opcode_cm4:
00723         return "CM4";
00724 
00725     case opcode_cm5:
00726         return "CM5";
00727 
00728     case opcode_cm6:
00729         return "CM6";
00730 
00731     case opcode_cm7:
00732         return "CM7";
00733 
00734     case opcode_cm8:
00735         return "CM8";
00736 
00737     case opcode_cm9:
00738         return "CM9";
00739 
00740     case opcode_cm10:
00741         return "CM10";
00742 
00743     case opcode_cm11:
00744         return "CM11";
00745 
00746     case opcode_cm12:
00747         return "CM12";
00748 
00749     case opcode_cm13:
00750         return "CM13";
00751 
00752     case opcode_cm14:
00753         return "CM14";
00754 
00755     case opcode_dot:
00756         return ".";
00757 
00758     case opcode_rv:
00759         return "RV";
00760 
00761     case opcode_right:
00762         return UNICODE_RIGHT;
00763 
00764     case opcode_chg_sign:
00765         return "CS";
00766 
00767     case opcode_round_down:
00768         return UNICODE_DOWN;
00769 
00770     case opcode_round_off:
00771         return "5/4";
00772 
00773     case opcode_round_up:
00774         return UNICODE_UP;
00775 
00776     case opcode_print:
00777         return UNICODE_PRINT;
00778 
00779     case opcode_fd:
00780         return "FD";
00781 
00782     case opcode_n0:
00783         return "0";
00784 
00785     case opcode_n1:
00786         return "1";
00787 
00788     case opcode_n2:
00789         return "2";
00790 
00791     case opcode_n3:
00792         return "3";
00793 
00794     case opcode_n4:
00795         return "4";
00796 
00797     case opcode_n5:
00798         return "5";
00799 
00800     case opcode_n6:
00801         return "6";
00802 
00803     case opcode_n7:
00804         return "7";
00805 
00806     case opcode_n8:
00807         return "8";
00808 
00809     case opcode_n9:
00810         return "9";
00811 
00812     case opcode_n10:
00813         return "10";
00814 
00815     case opcode_n11:
00816         return "11";
00817 
00818     case opcode_n12:
00819         return "12";
00820 
00821     case opcode_n13:
00822         return "13";
00823 
00824     case opcode_n14:
00825         return "14";
00826 
00827     case opcode_extended_c:
00828         return "C";
00829 
00830     case opcode_extended_start:
00831         return "START";
00832 
00833     case opcode_extended_m3_tilde:
00834         return "M3~";
00835 
00836     case opcode_extended_sm3_tilde:
00837         return "SM3~";
00838 
00839     case opcode_extended_rm3_tilde:
00840         return "RM3~";
00841 
00842     case opcode_extended_cm3_tilde:
00843         return "CM3~";
00844 
00845     case opcode_extended_off:
00846         return "OFF";
00847 
00848     case opcode_extended_program_print:
00849         return "PROGRAM_PRINT";
00850 
00851     case opcode_extended_display_print:
00852         return "DISPLAY_PRINT";
00853 
00854     case opcode_extended_paper_feed:
00855         return "PAPER_FEED";
00856 
00857     case opcode_extended_rounding_switch_up:
00858         return "rounding_switch_up";
00859 
00860     case opcode_extended_rounding_switch_off:
00861         return "rounding_switch_off";
00862 
00863     case opcode_extended_rounding_switch_down:
00864         return "rounding_switch_down";
00865 
00866     case opcode_extended_decimal_point_selector_0:
00867         return "decimal_point_selector_0";
00868 
00869     case opcode_extended_decimal_point_selector_1:
00870         return "decimal_point_selector_1";
00871 
00872     case opcode_extended_decimal_point_selector_2:
00873         return "decimal_point_selector_2";
00874 
00875     case opcode_extended_decimal_point_selector_3:
00876         return "decimal_point_selector_3";
00877 
00878     case opcode_extended_decimal_point_selector_4:
00879         return "decimal_point_selector_4";
00880 
00881     case opcode_extended_decimal_point_selector_5:
00882         return "decimal_point_selector_5";
00883 
00884     case opcode_extended_decimal_point_selector_6:
00885         return "decimal_point_selector_6";
00886 
00887     case opcode_extended_decimal_point_selector_7:
00888         return "decimal_point_selector_7";
00889 
00890     case opcode_extended_decimal_point_selector_8:
00891         return "decimal_point_selector_8";
00892 
00893     case opcode_extended_decimal_point_selector_9:
00894         return "decimal_point_selector_9";
00895 
00896     case opcode_extended_decimal_point_selector_10:
00897         return "decimal_point_selector_10";
00898 
00899     case opcode_extended_decimal_point_selector_11:
00900         return "decimal_point_selector_11";
00901 
00902     case opcode_extended_decimal_point_selector_12:
00903         return "decimal_point_selector_12";
00904 
00905     case opcode_extended_decimal_point_selector_float:
00906         return "decimal_point_selector_float";
00907 
00908     case opcode_extended_goto_000:
00909     case opcode_extended_goto_001:
00910     case opcode_extended_goto_002:
00911     case opcode_extended_goto_003:
00912     case opcode_extended_goto_004:
00913     case opcode_extended_goto_005:
00914     case opcode_extended_goto_006:
00915     case opcode_extended_goto_007:
00916     case opcode_extended_goto_008:
00917     case opcode_extended_goto_009:
00918     case opcode_extended_goto_010:
00919     case opcode_extended_goto_011:
00920     case opcode_extended_goto_012:
00921     case opcode_extended_goto_013:
00922     case opcode_extended_goto_014:
00923     case opcode_extended_goto_015:
00924     case opcode_extended_goto_100:
00925     case opcode_extended_goto_101:
00926     case opcode_extended_goto_102:
00927     case opcode_extended_goto_103:
00928     case opcode_extended_goto_104:
00929     case opcode_extended_goto_105:
00930     case opcode_extended_goto_106:
00931     case opcode_extended_goto_107:
00932     case opcode_extended_goto_108:
00933     case opcode_extended_goto_109:
00934     case opcode_extended_goto_110:
00935     case opcode_extended_goto_111:
00936     case opcode_extended_goto_112:
00937     case opcode_extended_goto_113:
00938     case opcode_extended_goto_114:
00939     case opcode_extended_goto_115:
00940     case opcode_extended_goto_200:
00941     case opcode_extended_goto_201:
00942     case opcode_extended_goto_202:
00943     case opcode_extended_goto_203:
00944     case opcode_extended_goto_204:
00945     case opcode_extended_goto_205:
00946     case opcode_extended_goto_206:
00947     case opcode_extended_goto_207:
00948     case opcode_extended_goto_208:
00949     case opcode_extended_goto_209:
00950     case opcode_extended_goto_210:
00951     case opcode_extended_goto_211:
00952     case opcode_extended_goto_212:
00953     case opcode_extended_goto_213:
00954     case opcode_extended_goto_214:
00955     case opcode_extended_goto_215:
00956     case opcode_extended_goto_300:
00957     case opcode_extended_goto_301:
00958     case opcode_extended_goto_302:
00959     case opcode_extended_goto_303:
00960     case opcode_extended_goto_304:
00961     case opcode_extended_goto_305:
00962     case opcode_extended_goto_306:
00963     case opcode_extended_goto_307:
00964     case opcode_extended_goto_308:
00965     case opcode_extended_goto_309:
00966     case opcode_extended_goto_310:
00967     case opcode_extended_goto_311:
00968     case opcode_extended_goto_312:
00969     case opcode_extended_goto_313:
00970     case opcode_extended_goto_314:
00971     case opcode_extended_goto_315:
00972     case opcode_extended_goto_400:
00973     case opcode_extended_goto_401:
00974     case opcode_extended_goto_402:
00975     case opcode_extended_goto_403:
00976     case opcode_extended_goto_404:
00977     case opcode_extended_goto_405:
00978     case opcode_extended_goto_406:
00979     case opcode_extended_goto_407:
00980     case opcode_extended_goto_408:
00981     case opcode_extended_goto_409:
00982     case opcode_extended_goto_410:
00983     case opcode_extended_goto_411:
00984     case opcode_extended_goto_412:
00985     case opcode_extended_goto_413:
00986     case opcode_extended_goto_414:
00987     case opcode_extended_goto_415:
00988     case opcode_extended_goto_500:
00989     case opcode_extended_goto_501:
00990     case opcode_extended_goto_502:
00991     case opcode_extended_goto_503:
00992     case opcode_extended_goto_504:
00993     case opcode_extended_goto_505:
00994     case opcode_extended_goto_506:
00995     case opcode_extended_goto_507:
00996     case opcode_extended_goto_508:
00997     case opcode_extended_goto_509:
00998     case opcode_extended_goto_510:
00999     case opcode_extended_goto_511:
01000     case opcode_extended_goto_512:
01001     case opcode_extended_goto_513:
01002     case opcode_extended_goto_514:
01003     case opcode_extended_goto_515:
01004     case opcode_extended_goto_600:
01005     case opcode_extended_goto_601:
01006     case opcode_extended_goto_602:
01007     case opcode_extended_goto_603:
01008     case opcode_extended_goto_604:
01009     case opcode_extended_goto_605:
01010     case opcode_extended_goto_606:
01011     case opcode_extended_goto_607:
01012     case opcode_extended_goto_608:
01013     case opcode_extended_goto_609:
01014     case opcode_extended_goto_610:
01015     case opcode_extended_goto_611:
01016     case opcode_extended_goto_612:
01017     case opcode_extended_goto_613:
01018     case opcode_extended_goto_614:
01019     case opcode_extended_goto_615:
01020     case opcode_extended_goto_700:
01021     case opcode_extended_goto_701:
01022     case opcode_extended_goto_702:
01023     case opcode_extended_goto_703:
01024     case opcode_extended_goto_704:
01025     case opcode_extended_goto_705:
01026     case opcode_extended_goto_706:
01027     case opcode_extended_goto_707:
01028     case opcode_extended_goto_708:
01029     case opcode_extended_goto_709:
01030     case opcode_extended_goto_710:
01031     case opcode_extended_goto_711:
01032     case opcode_extended_goto_712:
01033     case opcode_extended_goto_713:
01034     case opcode_extended_goto_714:
01035     case opcode_extended_goto_715:
01036         return "UJ@" + opcode_raw_name(opcode_t(n - opcode_extended_goto_000));
01037 
01038     default:
01039         yuck:
01040         return opcode_raw_name(n);
01041     }
01042 }
01043 
01044 
01045 std::string
01046 opcode_raw_name(opcode_t n)
01047 {
01048     if (n < 0 || n >= 128)
01049         return std_string_printf("UNKNOWN_%d", n);
01050     return std_string_printf("$%d%02d", ((n >> 4) & 15), (n & 15));
01051 }
01052 
01053 
01054 bool
01055 opcode_valid(int c)
01056 {
01057     if (c < 0 || c >= 128)
01058         return false;
01059     switch ((opcode_t)c)
01060     {
01061     case opcode_zero:
01062         return false;
01063 
01064     case opcode_plus_equals:
01065     case opcode_minus_equals:
01066     case opcode_mul:
01067     case opcode_div:
01068     case opcode_sqrt:
01069     case opcode_ent:
01070     case opcode_sj:
01071     case opcode_ej:
01072     case opcode_mj:
01073     case opcode_uj:
01074     case opcode_fj:
01075     case opcode_suj:
01076     case opcode_sfj:
01077     case opcode_srj:
01078     case opcode_m1:
01079     case opcode_m2:
01080     case opcode_m3:
01081     case opcode_m4:
01082     case opcode_m5:
01083     case opcode_m6:
01084     case opcode_m7:
01085     case opcode_m8:
01086     case opcode_m9:
01087     case opcode_m10:
01088     case opcode_m11:
01089     case opcode_m12:
01090     case opcode_m13:
01091     case opcode_m14:
01092     case opcode_mm1:
01093     case opcode_mm2:
01094     case opcode_sm3:
01095     case opcode_sm4:
01096     case opcode_sm5:
01097     case opcode_sm6:
01098     case opcode_sm7:
01099     case opcode_sm8:
01100     case opcode_sm9:
01101     case opcode_sm10:
01102     case opcode_sm11:
01103     case opcode_sm12:
01104     case opcode_sm13:
01105     case opcode_sm14:
01106     case opcode_rm1:
01107     case opcode_rm2:
01108     case opcode_rm3:
01109     case opcode_rm4:
01110     case opcode_rm5:
01111     case opcode_rm6:
01112     case opcode_rm7:
01113     case opcode_rm8:
01114     case opcode_rm9:
01115     case opcode_rm10:
01116     case opcode_rm11:
01117     case opcode_rm12:
01118     case opcode_rm13:
01119     case opcode_rm14:
01120     case opcode_clear_indicator:
01121     case opcode_cm1:
01122     case opcode_cm2:
01123     case opcode_cm3:
01124     case opcode_cm4:
01125     case opcode_cm5:
01126     case opcode_cm6:
01127     case opcode_cm7:
01128     case opcode_cm8:
01129     case opcode_cm9:
01130     case opcode_cm10:
01131     case opcode_cm11:
01132     case opcode_cm12:
01133     case opcode_cm13:
01134     case opcode_cm14:
01135     case opcode_dot:
01136     case opcode_rv:
01137     case opcode_right:
01138     case opcode_chg_sign:
01139     case opcode_round_down:
01140     case opcode_round_off:
01141     case opcode_round_up:
01142     case opcode_print:
01143     case opcode_fd:
01144     case opcode_n0:
01145     case opcode_n1:
01146     case opcode_n2:
01147     case opcode_n3:
01148     case opcode_n4:
01149     case opcode_n5:
01150     case opcode_n6:
01151     case opcode_n7:
01152     case opcode_n8:
01153     case opcode_n9:
01154     case opcode_n10:
01155     case opcode_n11:
01156     case opcode_n12:
01157     case opcode_n13:
01158     case opcode_n14:
01159         return true;
01160 
01161     case opcode_extended_c:
01162     case opcode_extended_start:
01163     case opcode_extended_m3_tilde:
01164     case opcode_extended_sm3_tilde:
01165     case opcode_extended_rm3_tilde:
01166     case opcode_extended_cm3_tilde:
01167     case opcode_extended_off:
01168     case opcode_extended_program_print:
01169     case opcode_extended_display_print:
01170     case opcode_extended_paper_feed:
01171     case opcode_extended_rounding_switch_up:
01172     case opcode_extended_rounding_switch_off:
01173     case opcode_extended_rounding_switch_down:
01174     case opcode_extended_decimal_point_selector_0:
01175     case opcode_extended_decimal_point_selector_1:
01176     case opcode_extended_decimal_point_selector_2:
01177     case opcode_extended_decimal_point_selector_3:
01178     case opcode_extended_decimal_point_selector_4:
01179     case opcode_extended_decimal_point_selector_5:
01180     case opcode_extended_decimal_point_selector_6:
01181     case opcode_extended_decimal_point_selector_7:
01182     case opcode_extended_decimal_point_selector_8:
01183     case opcode_extended_decimal_point_selector_9:
01184     case opcode_extended_decimal_point_selector_10:
01185     case opcode_extended_decimal_point_selector_11:
01186     case opcode_extended_decimal_point_selector_12:
01187     case opcode_extended_decimal_point_selector_float:
01188     case opcode_extended_goto_000:
01189     case opcode_extended_goto_001:
01190     case opcode_extended_goto_002:
01191     case opcode_extended_goto_003:
01192     case opcode_extended_goto_004:
01193     case opcode_extended_goto_005:
01194     case opcode_extended_goto_006:
01195     case opcode_extended_goto_007:
01196     case opcode_extended_goto_008:
01197     case opcode_extended_goto_009:
01198     case opcode_extended_goto_010:
01199     case opcode_extended_goto_011:
01200     case opcode_extended_goto_012:
01201     case opcode_extended_goto_013:
01202     case opcode_extended_goto_014:
01203     case opcode_extended_goto_015:
01204     case opcode_extended_goto_100:
01205     case opcode_extended_goto_101:
01206     case opcode_extended_goto_102:
01207     case opcode_extended_goto_103:
01208     case opcode_extended_goto_104:
01209     case opcode_extended_goto_105:
01210     case opcode_extended_goto_106:
01211     case opcode_extended_goto_107:
01212     case opcode_extended_goto_108:
01213     case opcode_extended_goto_109:
01214     case opcode_extended_goto_110:
01215     case opcode_extended_goto_111:
01216     case opcode_extended_goto_112:
01217     case opcode_extended_goto_113:
01218     case opcode_extended_goto_114:
01219     case opcode_extended_goto_115:
01220     case opcode_extended_goto_200:
01221     case opcode_extended_goto_201:
01222     case opcode_extended_goto_202:
01223     case opcode_extended_goto_203:
01224     case opcode_extended_goto_204:
01225     case opcode_extended_goto_205:
01226     case opcode_extended_goto_206:
01227     case opcode_extended_goto_207:
01228     case opcode_extended_goto_208:
01229     case opcode_extended_goto_209:
01230     case opcode_extended_goto_210:
01231     case opcode_extended_goto_211:
01232     case opcode_extended_goto_212:
01233     case opcode_extended_goto_213:
01234     case opcode_extended_goto_214:
01235     case opcode_extended_goto_215:
01236     case opcode_extended_goto_300:
01237     case opcode_extended_goto_301:
01238     case opcode_extended_goto_302:
01239     case opcode_extended_goto_303:
01240     case opcode_extended_goto_304:
01241     case opcode_extended_goto_305:
01242     case opcode_extended_goto_306:
01243     case opcode_extended_goto_307:
01244     case opcode_extended_goto_308:
01245     case opcode_extended_goto_309:
01246     case opcode_extended_goto_310:
01247     case opcode_extended_goto_311:
01248     case opcode_extended_goto_312:
01249     case opcode_extended_goto_313:
01250     case opcode_extended_goto_314:
01251     case opcode_extended_goto_315:
01252     case opcode_extended_goto_400:
01253     case opcode_extended_goto_401:
01254     case opcode_extended_goto_402:
01255     case opcode_extended_goto_403:
01256     case opcode_extended_goto_404:
01257     case opcode_extended_goto_405:
01258     case opcode_extended_goto_406:
01259     case opcode_extended_goto_407:
01260     case opcode_extended_goto_408:
01261     case opcode_extended_goto_409:
01262     case opcode_extended_goto_410:
01263     case opcode_extended_goto_411:
01264     case opcode_extended_goto_412:
01265     case opcode_extended_goto_413:
01266     case opcode_extended_goto_414:
01267     case opcode_extended_goto_415:
01268     case opcode_extended_goto_500:
01269     case opcode_extended_goto_501:
01270     case opcode_extended_goto_502:
01271     case opcode_extended_goto_503:
01272     case opcode_extended_goto_504:
01273     case opcode_extended_goto_505:
01274     case opcode_extended_goto_506:
01275     case opcode_extended_goto_507:
01276     case opcode_extended_goto_508:
01277     case opcode_extended_goto_509:
01278     case opcode_extended_goto_510:
01279     case opcode_extended_goto_511:
01280     case opcode_extended_goto_512:
01281     case opcode_extended_goto_513:
01282     case opcode_extended_goto_514:
01283     case opcode_extended_goto_515:
01284     case opcode_extended_goto_600:
01285     case opcode_extended_goto_601:
01286     case opcode_extended_goto_602:
01287     case opcode_extended_goto_603:
01288     case opcode_extended_goto_604:
01289     case opcode_extended_goto_605:
01290     case opcode_extended_goto_606:
01291     case opcode_extended_goto_607:
01292     case opcode_extended_goto_608:
01293     case opcode_extended_goto_609:
01294     case opcode_extended_goto_610:
01295     case opcode_extended_goto_611:
01296     case opcode_extended_goto_612:
01297     case opcode_extended_goto_613:
01298     case opcode_extended_goto_614:
01299     case opcode_extended_goto_615:
01300     case opcode_extended_goto_700:
01301     case opcode_extended_goto_701:
01302     case opcode_extended_goto_702:
01303     case opcode_extended_goto_703:
01304     case opcode_extended_goto_704:
01305     case opcode_extended_goto_705:
01306     case opcode_extended_goto_706:
01307     case opcode_extended_goto_707:
01308     case opcode_extended_goto_708:
01309     case opcode_extended_goto_709:
01310     case opcode_extended_goto_710:
01311     case opcode_extended_goto_711:
01312     case opcode_extended_goto_712:
01313     case opcode_extended_goto_713:
01314     case opcode_extended_goto_714:
01315     case opcode_extended_goto_715:
01316     default:
01317         return false;
01318     }
01319 }
01320 
01321 
01322 bool
01323 opcode_red(opcode_t c)
01324 {
01325     if (c < 0 || c >= 128)
01326         return true;
01327     switch ((opcode_t)c)
01328     {
01329     case opcode_zero:
01330         return true;
01331 
01332     case opcode_plus_equals:
01333         return false;
01334 
01335     case opcode_minus_equals:
01336         return true;
01337 
01338     case opcode_mul:
01339     case opcode_div:
01340     case opcode_sqrt:
01341     case opcode_ent:
01342     case opcode_sj:
01343     case opcode_ej:
01344     case opcode_mj:
01345     case opcode_uj:
01346     case opcode_fj:
01347     case opcode_suj:
01348     case opcode_sfj:
01349     case opcode_srj:
01350     case opcode_m1:
01351     case opcode_m2:
01352     case opcode_m3:
01353     case opcode_m4:
01354     case opcode_m5:
01355     case opcode_m6:
01356     case opcode_m7:
01357     case opcode_m8:
01358     case opcode_m9:
01359     case opcode_m10:
01360     case opcode_m11:
01361     case opcode_m12:
01362     case opcode_m13:
01363     case opcode_m14:
01364         return false;
01365 
01366     case opcode_mm1:
01367     case opcode_mm2:
01368         return true;
01369 
01370     case opcode_sm3:
01371     case opcode_sm4:
01372     case opcode_sm5:
01373     case opcode_sm6:
01374     case opcode_sm7:
01375     case opcode_sm8:
01376     case opcode_sm9:
01377     case opcode_sm10:
01378     case opcode_sm11:
01379     case opcode_sm12:
01380     case opcode_sm13:
01381     case opcode_sm14:
01382     case opcode_rm1:
01383     case opcode_rm2:
01384     case opcode_rm3:
01385     case opcode_rm4:
01386     case opcode_rm5:
01387     case opcode_rm6:
01388     case opcode_rm7:
01389     case opcode_rm8:
01390     case opcode_rm9:
01391     case opcode_rm10:
01392     case opcode_rm11:
01393     case opcode_rm12:
01394     case opcode_rm13:
01395     case opcode_rm14:
01396     case opcode_clear_indicator:
01397     case opcode_cm1:
01398     case opcode_cm2:
01399     case opcode_cm3:
01400     case opcode_cm4:
01401     case opcode_cm5:
01402     case opcode_cm6:
01403     case opcode_cm7:
01404     case opcode_cm8:
01405     case opcode_cm9:
01406     case opcode_cm10:
01407     case opcode_cm11:
01408     case opcode_cm12:
01409     case opcode_cm13:
01410     case opcode_cm14:
01411     case opcode_dot:
01412     case opcode_rv:
01413     case opcode_right:
01414         return false;
01415 
01416     case opcode_chg_sign:
01417         return true;
01418 
01419     case opcode_round_down:
01420     case opcode_round_off:
01421     case opcode_round_up:
01422     case opcode_print:
01423     case opcode_fd:
01424     case opcode_n0:
01425     case opcode_n1:
01426     case opcode_n2:
01427     case opcode_n3:
01428     case opcode_n4:
01429     case opcode_n5:
01430     case opcode_n6:
01431     case opcode_n7:
01432     case opcode_n8:
01433     case opcode_n9:
01434     case opcode_n10:
01435     case opcode_n11:
01436     case opcode_n12:
01437     case opcode_n13:
01438     case opcode_n14:
01439         return false;
01440 
01441     case opcode_extended_c:
01442     case opcode_extended_start:
01443     case opcode_extended_m3_tilde:
01444     case opcode_extended_sm3_tilde:
01445     case opcode_extended_rm3_tilde:
01446     case opcode_extended_cm3_tilde:
01447     case opcode_extended_off:
01448     case opcode_extended_program_print:
01449     case opcode_extended_display_print:
01450     case opcode_extended_paper_feed:
01451     case opcode_extended_rounding_switch_up:
01452     case opcode_extended_rounding_switch_off:
01453     case opcode_extended_rounding_switch_down:
01454     case opcode_extended_decimal_point_selector_0:
01455     case opcode_extended_decimal_point_selector_1:
01456     case opcode_extended_decimal_point_selector_2:
01457     case opcode_extended_decimal_point_selector_3:
01458     case opcode_extended_decimal_point_selector_4:
01459     case opcode_extended_decimal_point_selector_5:
01460     case opcode_extended_decimal_point_selector_6:
01461     case opcode_extended_decimal_point_selector_7:
01462     case opcode_extended_decimal_point_selector_8:
01463     case opcode_extended_decimal_point_selector_9:
01464     case opcode_extended_decimal_point_selector_10:
01465     case opcode_extended_decimal_point_selector_11:
01466     case opcode_extended_decimal_point_selector_12:
01467     case opcode_extended_decimal_point_selector_float:
01468     case opcode_extended_goto_000:
01469     case opcode_extended_goto_001:
01470     case opcode_extended_goto_002:
01471     case opcode_extended_goto_003:
01472     case opcode_extended_goto_004:
01473     case opcode_extended_goto_005:
01474     case opcode_extended_goto_006:
01475     case opcode_extended_goto_007:
01476     case opcode_extended_goto_008:
01477     case opcode_extended_goto_009:
01478     case opcode_extended_goto_010:
01479     case opcode_extended_goto_011:
01480     case opcode_extended_goto_012:
01481     case opcode_extended_goto_013:
01482     case opcode_extended_goto_014:
01483     case opcode_extended_goto_015:
01484     case opcode_extended_goto_100:
01485     case opcode_extended_goto_101:
01486     case opcode_extended_goto_102:
01487     case opcode_extended_goto_103:
01488     case opcode_extended_goto_104:
01489     case opcode_extended_goto_105:
01490     case opcode_extended_goto_106:
01491     case opcode_extended_goto_107:
01492     case opcode_extended_goto_108:
01493     case opcode_extended_goto_109:
01494     case opcode_extended_goto_110:
01495     case opcode_extended_goto_111:
01496     case opcode_extended_goto_112:
01497     case opcode_extended_goto_113:
01498     case opcode_extended_goto_114:
01499     case opcode_extended_goto_115:
01500     case opcode_extended_goto_200:
01501     case opcode_extended_goto_201:
01502     case opcode_extended_goto_202:
01503     case opcode_extended_goto_203:
01504     case opcode_extended_goto_204:
01505     case opcode_extended_goto_205:
01506     case opcode_extended_goto_206:
01507     case opcode_extended_goto_207:
01508     case opcode_extended_goto_208:
01509     case opcode_extended_goto_209:
01510     case opcode_extended_goto_210:
01511     case opcode_extended_goto_211:
01512     case opcode_extended_goto_212:
01513     case opcode_extended_goto_213:
01514     case opcode_extended_goto_214:
01515     case opcode_extended_goto_215:
01516     case opcode_extended_goto_300:
01517     case opcode_extended_goto_301:
01518     case opcode_extended_goto_302:
01519     case opcode_extended_goto_303:
01520     case opcode_extended_goto_304:
01521     case opcode_extended_goto_305:
01522     case opcode_extended_goto_306:
01523     case opcode_extended_goto_307:
01524     case opcode_extended_goto_308:
01525     case opcode_extended_goto_309:
01526     case opcode_extended_goto_310:
01527     case opcode_extended_goto_311:
01528     case opcode_extended_goto_312:
01529     case opcode_extended_goto_313:
01530     case opcode_extended_goto_314:
01531     case opcode_extended_goto_315:
01532     case opcode_extended_goto_400:
01533     case opcode_extended_goto_401:
01534     case opcode_extended_goto_402:
01535     case opcode_extended_goto_403:
01536     case opcode_extended_goto_404:
01537     case opcode_extended_goto_405:
01538     case opcode_extended_goto_406:
01539     case opcode_extended_goto_407:
01540     case opcode_extended_goto_408:
01541     case opcode_extended_goto_409:
01542     case opcode_extended_goto_410:
01543     case opcode_extended_goto_411:
01544     case opcode_extended_goto_412:
01545     case opcode_extended_goto_413:
01546     case opcode_extended_goto_414:
01547     case opcode_extended_goto_415:
01548     case opcode_extended_goto_500:
01549     case opcode_extended_goto_501:
01550     case opcode_extended_goto_502:
01551     case opcode_extended_goto_503:
01552     case opcode_extended_goto_504:
01553     case opcode_extended_goto_505:
01554     case opcode_extended_goto_506:
01555     case opcode_extended_goto_507:
01556     case opcode_extended_goto_508:
01557     case opcode_extended_goto_509:
01558     case opcode_extended_goto_510:
01559     case opcode_extended_goto_511:
01560     case opcode_extended_goto_512:
01561     case opcode_extended_goto_513:
01562     case opcode_extended_goto_514:
01563     case opcode_extended_goto_515:
01564     case opcode_extended_goto_600:
01565     case opcode_extended_goto_601:
01566     case opcode_extended_goto_602:
01567     case opcode_extended_goto_603:
01568     case opcode_extended_goto_604:
01569     case opcode_extended_goto_605:
01570     case opcode_extended_goto_606:
01571     case opcode_extended_goto_607:
01572     case opcode_extended_goto_608:
01573     case opcode_extended_goto_609:
01574     case opcode_extended_goto_610:
01575     case opcode_extended_goto_611:
01576     case opcode_extended_goto_612:
01577     case opcode_extended_goto_613:
01578     case opcode_extended_goto_614:
01579     case opcode_extended_goto_615:
01580     case opcode_extended_goto_700:
01581     case opcode_extended_goto_701:
01582     case opcode_extended_goto_702:
01583     case opcode_extended_goto_703:
01584     case opcode_extended_goto_704:
01585     case opcode_extended_goto_705:
01586     case opcode_extended_goto_706:
01587     case opcode_extended_goto_707:
01588     case opcode_extended_goto_708:
01589     case opcode_extended_goto_709:
01590     case opcode_extended_goto_710:
01591     case opcode_extended_goto_711:
01592     case opcode_extended_goto_712:
01593     case opcode_extended_goto_713:
01594     case opcode_extended_goto_714:
01595     case opcode_extended_goto_715:
01596         return false;
01597 
01598     default:
01599         return true;
01600     }
01601 }
01602 
01603 
01604 bool
01605 opcode_valid_label(int c)
01606 {
01607     return (c > 0 && c < 127 && (c & 0x0F) != 0x0F && (c & 0xF0) != 0x10);
01608 }