d918c7afac9a627b211f27aa17b72532be7264ab
[YACASL2.git] / src / struct.c
1 #include "casl2.h"
2
3 /* COMET IIのメモリ */
4 WORD *memory;
5
6 /* COMET IIのCPUレジスタ */
7 WORD GR[REGSIZE], SP, PR, FR;
8
9 CERRARRAY cerr[] = {
10     { 101, "label already defined" },
11     { 102, "label table is full" },
12     { 103, "label not found" },
13     { 104, "label length is too long" },
14     { 105, "no command in the line" },
15     { 106, "operand count mismatch" },
16     { 107, "no label in START" },
17     { 108, "not command of operand \"r\"" },
18     { 109, "not command of operand \"r1,r2\"" },
19     { 110, "not command of operand \"r,adr[,x]\"" },
20     { 111, "not command of operand \"adr[,x]\"" },
21     { 112, "not command of no operand" },
22     { 113, "command not defined" },
23     { 114, "not integer" },
24     { 115, "not hex" },
25     { 116, "out of hex range" },
26     { 117, "operand is too many" },
27     { 118, "operand length is too long" },
28     { 119, "out of COMET II memory" },
29     { 120, "GR0 in operand x" },
30     { 121, "cannot get operand token" },
31     { 122, "cannot create hash table" },
32     { 201, "execute - out of COMET II memory" },
33     { 202, "SVC input - out of Input memory" },
34     { 203, "SVC output - out of COMET II memory" },
35     { 204, "Program Register (PR) - out of COMET II memory" },
36     { 205, "Stack Pointer (SP) - cannot allocate stack buffer" },
37     { 206, "Address - out of COMET II memory" },
38     { 207, "Stack Pointer (SP) - out of COMET II memory" },
39     { 0, NULL },
40 };
41
42 /* レジストリの内容を表示する場合はtrue */
43 bool tracemode = false;
44
45 /* レジストリの内容を論理値(0〜65535)で表示する場合はtrue */
46 bool logicalmode = false;
47
48 /* メモリの内容を表示する場合はtrue */
49 bool dumpmode = false;
50
51 /* ソースを表示する場合はtrue */
52 bool srcmode = false;
53
54 /* ラベル表を表示する場合はtrue */
55 bool labelmode = false;
56
57 /* ラベル表を表示して終了する場合はtrue */
58 bool onlylabelmode = false;
59
60 /* アセンブラ詳細結果を表示する場合はtrue */
61 bool asdetailmode = false;
62
63 /* アセンブルだけを行う場合はtrue */
64 bool onlyassemblemode = false;
65
66 /* メモリーサイズ */
67 int memsize = DEFAULT_MEMSIZE;
68
69 /* クロック周波数 */
70 int clocks = DEFAULT_CLOCKS;
71
72 /* 実行開始番地 */
73 WORD startptr = 0x0;
74
75 /* 実行終了番地 */
76 WORD endptr = 0x0;