YACASL2
Loading...
Searching...
No Matches
struct.h File Reference
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <time.h>
#include "word.h"
#include "cmem.h"
#include "hash.h"
Include dependency graph for struct.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CPU
 COMET IIのCPUを表すデータ型 More...
struct  SYSTEM
 COMET IIの仮想実行マシンシステムを表すデータ型 More...
struct  CMD
struct  COMET2CMD
struct  _CMDTAB
struct  EXECPTR
struct  EXECMODE
 実行モードを表すデータ型 More...

Typedefs

typedef struct _CMDTAB CMDTAB

Enumerations

enum  { CMDSIZE = 4 , GRSIZE = 8 , DEFAULT_MEMSIZE = 512 , DEFAULT_CLOCKS = 5000000 }
 COMET IIの規格値 More...
enum  { OF = 0x4 , SF = 0x2 , ZF = 0x1 }
 COMET II フラグのマスク値 More...
enum  CMDTAB_HASH { HASH_CMDTYPE , HASH_CODE , HASH_MAX }
enum  CMDTYPE {
  R_ADR_X = 01 , R1_R2 = 02 , ADR_X = 03 , R_ = 04 ,
  NONE = 0
}

Functions

char * grstr (WORD word)
 汎用レジスタの番号からレジスタを表す文字列を返す
void comet2_init (int memsize, int clocks)
void comet2_reset ()
void comet2_resetall ()
void comet2_shutdown ()
bool create_cmdtable (CMDTAB_HASH hash)
 命令ハッシュ表を作成する
void free_cmdtable (CMDTAB_HASH hash)
WORD getcmdcode (const char *cmd, CMDTYPE type)
const void * getcmdptr (WORD code)
CMDTYPE getcmdtype (WORD code)
char * getcmdname (WORD code)

Variables

SYSTEMsys
 COMET IIの仮想実行マシンシステム
EXECPTRexecptr
EXECMODE execmode
 実行モード: trace, logical, dump, monitor, step

Typedef Documentation

◆ CMDTAB

typedef struct _CMDTAB CMDTAB

命令コードのハッシュ表

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

COMET II フラグのマスク値

Enumerator
OF 

Overflow Flag

SF 

Sign Flag

ZF 

Zero Flag

Definition at line 25 of file struct.h.

◆ anonymous enum

anonymous enum

COMET IIの規格値

Enumerator
CMDSIZE 

命令の最大文字数

GRSIZE 

汎用レジスタの数。COMET II規格では、8(0から7)

DEFAULT_MEMSIZE 

デフォルトのメモリ容量。COMET II規格では、65535語(word)

DEFAULT_CLOCKS 

デフォルトのクロック周波数。COMET II規格では、未定義

Definition at line 15 of file struct.h.

◆ CMDTAB_HASH

命令ハッシュ表のハッシュの種類

Enumerator
HASH_CMDTYPE 
HASH_CODE 
HASH_MAX 

Definition at line 59 of file struct.h.

◆ CMDTYPE

enum CMDTYPE

COMET II 命令 命令タイプは、オペランドにより5種類に分類

Enumerator
R_ADR_X 

オペランド数2または3

  • 第1オペランド: 汎用レジスタ。必須
  • 第2オペランド: アドレス。必須
  • 第3オペランド: 指標レジスタとして用いる汎用レジスタ。任意
R1_R2 

オペランド数2

  • 第1オペランド: 汎用レジスタ。必須
  • 第2オペランド: 汎用レジスタ。必須
ADR_X 

オペランド数1または2

  • 第1オペランド: アドレス。必須
  • 第2オペランド: 指標レジスタとして用いる汎用レジスタ。任意
R_ 

オペランド数1

  • 第1オペランド: 汎用レジスタ。必須
NONE 

オペランドなし

Definition at line 69 of file struct.h.

Function Documentation

◆ comet2_init()

void comet2_init ( int memsize,
int clocks )

COMET II仮想マシンのリセット

COMET II仮想マシンの初期化

Definition at line 267 of file struct.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ comet2_reset()

void comet2_reset ( )

COMET II仮想マシンのCPUをリセット

COMET II仮想マシンのCPUリセット

Definition at line 286 of file struct.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ comet2_resetall()

void comet2_resetall ( )

COMET II仮想マシンのCPUとメモリをリセット

Definition at line 295 of file struct.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ comet2_shutdown()

void comet2_shutdown ( )

COMET II仮想マシンのシャットダウン

Definition at line 306 of file struct.c.

Here is the caller graph for this function:

◆ create_cmdtable()

bool create_cmdtable ( CMDTAB_HASH hash)

命令ハッシュ表を作成する

Parameters
hashハッシュ値

命令ハッシュ表を作成する

Definition at line 113 of file struct.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_cmdtable()

void free_cmdtable ( CMDTAB_HASH hash)

命令ハッシュ表を解放する

Definition at line 135 of file struct.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcmdcode()

WORD getcmdcode ( const char * cmd,
CMDTYPE type )

命令の名前とタイプから、命令コードを返す 無効な場合は0xFFFFを返す

命令の名前とタイプから、命令コードを返す
無効な場合は0xFFFFを返す

Definition at line 153 of file struct.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcmdname()

char * getcmdname ( WORD code)

命令コードから命令の名前を返す

Definition at line 222 of file struct.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcmdptr()

const void * getcmdptr ( WORD code)

命令コードから命令の関数ポインタを返す

Definition at line 188 of file struct.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcmdtype()

CMDTYPE getcmdtype ( WORD code)

命令コードから命令のタイプを返す

Definition at line 205 of file struct.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grstr()

char * grstr ( WORD word)

汎用レジスタの番号からレジスタを表す文字列を返す

Returns
汎用レジスタを表す文字列。「GR0」「GR1」・・・「GR7」のいずれか
Parameters
wordレジスタ番号[0-7]を表すWORD値

汎用レジスタの番号からレジスタを表す文字列を返す

Definition at line 240 of file struct.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ execmode

EXECMODE execmode
extern

実行モード: trace, logical, dump, monitor, step

実行モード: trace, logical, dump, monitor, step

Definition at line 88 of file exec.c.

◆ execptr

EXECPTR* execptr
extern

プログラム実行時の開始と終了のアドレス

Definition at line 12 of file struct.c.

◆ sys

SYSTEM* sys
extern

COMET IIの仮想実行マシンシステム

COMET IIの仮想実行マシンシステム

Definition at line 7 of file struct.c.