projects
/
YACASL2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
命令ハッシュ表の作成方法を変更
[YACASL2.git]
/
include
/
struct.h
diff --git
a/include/struct.h
b/include/struct.h
index
ee59634
..
8f69f20
100644
(file)
--- a/
include/struct.h
+++ b/
include/struct.h
@@
-1,8
+1,13
@@
#ifndef YACASL2_CASL2_INCLUDED
#define YACASL2_CASL2_INCLUDED
#ifndef YACASL2_CASL2_INCLUDED
#define YACASL2_CASL2_INCLUDED
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
#include <time.h>
#include "word.h"
#include <time.h>
#include "word.h"
+#include "cmem.h"
+#include "hash.h"
/**
* @brief COMET IIの規格値
/**
* @brief COMET IIの規格値
@@
-48,6
+53,14
@@
typedef struct {
*/
extern SYSTEM *sys;
*/
extern SYSTEM *sys;
+/**
+ * 命令ハッシュ表のハッシュの種類
+ */
+typedef enum {
+ HASH_CMDTYPE = 0,
+ HASH_CODE = 1,
+} CMDTAB_HASH;
+
/**
* COMET II 命令
* 命令タイプは、オペランドにより5種類に分類
/**
* COMET II 命令
* 命令タイプは、オペランドにより5種類に分類
@@
-80,7
+93,7
@@
typedef enum {
/**
* オペランドなし
*/
/**
* オペランドなし
*/
- NONE = 0
0
,
+ NONE = 0,
} CMDTYPE;
/**
} CMDTYPE;
/**
@@
-106,7
+119,7
@@
typedef struct {
*/
typedef struct _CMDTAB {
struct _CMDTAB *next; /**<リスト次項目へのポインタ */
*/
typedef struct _CMDTAB {
struct _CMDTAB *next; /**<リスト次項目へのポインタ */
-
COMET2CMD *cmd;
/**<命令コード表の項目 */
+
const COMET2CMD *cmd;
/**<命令コード表の項目 */
} CMDTAB;
/**
} CMDTAB;
/**
@@
-120,6
+133,15
@@
typedef struct {
extern EXECPTR *execptr;
extern EXECPTR *execptr;
+/**
+ * @brief 汎用レジスタの番号からレジスタを表す文字列を返す
+ *
+ * @return 汎用レジスタを表す文字列。「GR0」「GR1」・・・「GR7」のいずれか
+ *
+ * @param word レジスタ番号[0-7]を表すWORD値
+ */
+char *grstr(WORD word);
+
/**
* COMET II仮想マシンのリセット
*/
/**
* COMET II仮想マシンのリセット
*/
@@
-131,9
+153,13
@@
void reset(int memsize, int clocks);
void shutdown();
/**
void shutdown();
/**
- * 名前とタイプがキーの命令ハッシュ表を作成する
+ * @brief 命令ハッシュ表を作成する
+ *
+ * @return なし
+ *
+ * @param hash ハッシュ値
*/
*/
-bool create_cmdt
ype_code(
);
+bool create_cmdt
able(CMDTAB_HASH hash
);
/**
* 命令の名前とタイプから、命令コードを返す
/**
* 命令の名前とタイプから、命令コードを返す
@@
-142,9
+168,9
@@
bool create_cmdtype_code();
WORD getcmdcode(const char *cmd, CMDTYPE type);
/**
WORD getcmdcode(const char *cmd, CMDTYPE type);
/**
- * å
\90
\8d
å
\89
\8d
ã
\81
¨ã
\82
¿ã
\82
¤ã
\83
\97
ã
\81
\8c
ã
\82
ã
\83
¼ã
\81
®å
\91
½ä»¤ã
\83
\8f
ã
\83
\83
ã
\82
·ã
\83
¥è¡¨ã
\82
\92
解æ
\94
¾ã
\81
\99
ã
\82
\8b
+ * 命令ハッシュ表を解放する
*/
*/
-void free_cmdt
ype_cod
e();
+void free_cmdt
abl
e();
/**
* コードがキーの命令ハッシュ表を作成する
/**
* コードがキーの命令ハッシュ表を作成する
@@
-166,9
+192,4
@@
CMDTYPE getcmdtype(WORD code);
*/
char *getcmdname(WORD code);
*/
char *getcmdname(WORD code);
-/**
- * コードがキーの命令ハッシュ表を解放する
- */
-void free_code_cmdtype();
-
#endif /* YACASL2_CASL2_INCLUDEDの終端 */
#endif /* YACASL2_CASL2_INCLUDEDの終端 */