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