dumpwordコマンドで10進数/16進数を表す文字列が引数になるよう仕様変更
[YACASL2.git] / include / casl2.h
index fde1207..c269710 100644 (file)
@@ -1,14 +1,21 @@
+#ifndef YACASL2_CASL2_INCLUDED
+#define YACASL2_CASL2_INCLUDED
+
 #include <stdio.h>
 #include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 #include <malloc.h>
 #include <malloc.h>
-#include <ctype.h>
-#include <assert.h>
 #include <stdbool.h>
 #include <time.h>
 #include <stdbool.h>
 #include <time.h>
+#include <assert.h>
+#include <ctype.h>
+#include <string.h>
+
+#include "word.h"
 #include "hash.h"
 #include "hash.h"
+#include "cerr.h"
 
 
+#ifndef ARRAYSIZE
 #define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
 #define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
+#endif
 
 /* COMET IIの規格 */
 enum {
 
 /* COMET IIの規格 */
 enum {
@@ -18,9 +25,6 @@ enum {
     DEFAULT_CLOCKS = 5000000, /* デフォルトのクロック周波数。COMET II規格では、未定義 */
 };
 
     DEFAULT_CLOCKS = 5000000, /* デフォルトのクロック周波数。COMET II規格では、未定義 */
 };
 
-/* COMET IIの基本データサイズ */
-typedef unsigned short WORD;
-
 /* COMET IIのメモリ */
 extern WORD *memory;
 
 /* COMET IIのメモリ */
 extern WORD *memory;
 
@@ -34,12 +38,6 @@ enum {
     ZF = 0x1,    /* Zero Flag */
 };
 
     ZF = 0x1,    /* Zero Flag */
 };
 
-/* エラー番号 */
-extern int cerrno;
-
-/* エラーメッセージ */
-extern char *cerrmsg;
-
 /* レジストリの内容を表示する場合はTRUE */
 extern bool tracemode;
 
 /* レジストリの内容を表示する場合はTRUE */
 extern bool tracemode;
 
@@ -139,26 +137,7 @@ void print_code_type();
 /* 命令コードがキーのハッシュ表を解放する */
 void free_code_type();
 
 /* 命令コードがキーのハッシュ表を解放する */
 void free_code_type();
 
-/* エラー番号とエラーメッセージを設定 */
-void setcerr(int num, const char *val);
-
-/* エラー番号からメッセージを返す */
-char *getcerrmsg(int num);
-
-/* WORD値を文字列に変換 */
-char *wtoa(WORD word);
-
-/* エラーを解放する */
-void freecerr();
-
 /* 指定されたファイルにアセンブル結果を書込 */
 void outassemble(char *file);
 
 /* 指定されたファイルにアセンブル結果を書込 */
 void outassemble(char *file);
 
-/* WORD値を2進数表記に変換 */
-char *word2bit(const WORD word);
-
-/* COMET IIのメモリを表示 */
-void dumpmemory();
-
-/* COMET IIのレジスタを表示 */
-void dspregister();
+#endif