Annotation of nono/m88xx0/m88100subr.cpp, revision 1.1.1.4

1.1       root        1: //
                      2: // nono
1.1.1.2   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
                      7: #include "m88100.h"
                      8: 
                      9: // コンストラクタ
                     10: m88kcpu::m88kcpu()
                     11: {
1.1.1.2   root       12:        cmmu[0].Ctor(this);
                     13:        cmmu[1].Ctor(this);
1.1       root       14: }
                     15: 
                     16: // デストラクタ
                     17: m88kcpu::~m88kcpu()
                     18: {
                     19: }
                     20: 
1.1.1.2   root       21: // PID の VERSION フィールドをセットする。初期化時に呼ぶ。
                     22: void
                     23: m88kcpu::SetVersion(uint32 version)
                     24: {
                     25:        pid &= ~PID_VER_MASK;
                     26:        pid |= version << 1;
                     27: }
                     28: 
1.1       root       29: /*static*/ const char * const m88100reg::sipname[3] = {
                     30:        "sxip", "snip", "sfip",
                     31: };
                     32: 
1.1.1.2   root       33: /*static*/ const char * const m88100reg::dmt_en_str[16] = {
                     34:        "----",
                     35:        "---B",
                     36:        "--B-",
                     37:        "--HH",
                     38:        "-B--",
                     39:        "-1-1", // not used normally
                     40:        "-11-", // not used normally
                     41:        "-111", // not used normally
                     42:        "B---",
                     43:        "1--1", // not used normally
                     44:        "1-1-", // not used normally
                     45:        "1-11", // not used normally
                     46:        "HH--",
                     47:        "11-1", // not used normally
                     48:        "111-", // not used normally
                     49:        "LLLL",
                     50: };
1.1.1.3   root       51: 
                     52: // 例外
                     53: /*static*/ const char * const m88kcpu::exception_names[] = {
                     54:                        //   01234567890123456789012 <- 例外履歴欄の横幅
                     55:        /*  0 */        "Reset Exception",
                     56:        /*  1 */        "Interrupt Exception",
                     57:        /*  2 */        "Inst Access Exception",
                     58:        /*  3 */        "Data Access Exception",
                     59:        /*  4 */        "Misaligned Access Excep",
                     60:        /*  5 */        "Unimplemented Opcode",
                     61:        /*  6 */        "Priv. Violation Excep.",
                     62:        /*  7 */        "Bounds Check Violation",
                     63:        /*  8 */        "Illegal Integer Divide",
                     64:        /*  9 */        "Int Overflow Exception",
                     65:        /* 10 */        "Error Exception",
                     66:                        //   01234567890123456789012
                     67: };
                     68: 
                     69: // 例外名を返す。
                     70: // Reserved なところは NULL を返す。
                     71: // XXX TODO 114 以降未実装
                     72: /*static*/ const char *
                     73: m88kcpu::GetExceptionName(int vector)
                     74: {
1.1.1.4 ! root       75:        if (0 <= vector && vector < countof(exception_names)) {
1.1.1.3   root       76:                return exception_names[vector];
                     77:        }
                     78: 
1.1.1.4 ! root       79:        // OpenBSD
        !            80:        // XXX 本来は OpenBSD 稼働時に限定すべきだろうけど、そうする意味もない
        !            81:        switch (vector) {
        !            82:         case 450:
        !            83:                return "OpenBSD system call";
        !            84:         case 451:
        !            85:                return "OpenBSD cache flush";
        !            86:         case 503:
        !            87:                return "Division by zero in GCC";
        !            88:         case 504:
        !            89:                return "OpenBSD stepbpt";
        !            90:         case 511:
        !            91:                return "OpenBSD userbpt";
        !            92:         default:
        !            93:                break;
        !            94:        }
        !            95: 
1.1.1.3   root       96:        return NULL;
                     97: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.