YACAL2: CASL2処理系
[YACASL2.git] / src / struct.c
1 #include "casl2.h"
2
3 /* COMET IIのメモリ */
4 WORD memory[MEMSIZE];
5
6 /* COMET IIのCPUレジスタ */
7 WORD GR[REGSIZE], SP, PR, FR;
8
9 /* エラーメッセージ */
10 int cerrno = 0;
11 char *cerrmsg;
12
13 /* レジストリの内容を表示する場合はtrue */
14 bool tracemode = false;
15
16 /* レジストリの内容を論理値(0〜65535)で表示する場合はTRUE */
17 bool logicalmode = false;
18
19 /* メモリの内容を表示する場合はtrue */
20 bool dumpmode = false;
21
22 /* ソースを表示する場合はtrue */
23 bool srcmode = false;
24
25 /* ラベル表を表示する場合はtrue */
26 bool labelmode = false;
27
28 /* アセンブラ詳細結果を表示する場合はtrue */
29 bool asdetailmode = false;
30
31 /* アセンブルだけを行う場合はtrue */
32 bool onlyassemblemode = false;
33
34 /* 実行開始番地 */
35 WORD startptr = 0x0;
36
37 /* 実行終了番地 */
38 WORD endptr = 0x0;
39
40 /* ハッシュ値を取得する */
41 unsigned hash(const char *key, int size){
42     unsigned hashval;
43
44     for(hashval = 0; *key != '\0'; key++){
45         hashval = *key + 31 * hashval;
46     }
47     return hashval % size;
48 }