YACASL2
Loading...
Searching...
No Matches
label.c File Reference
#include "assemble.h"
Include dependency graph for label.c:

Go to the source code of this file.

Functions

HKEYlabel_hashkey (const char *value)
unsigned labelhash (const char *prog, const char *label)
int compare_adr (const void *a, const void *b)
void addcerrlist_label ()
 ラベルのエラーをエラーリストに追加する
WORD getlabel (const char *prog, const char *label)
 プログラム名とラベルに対応するアドレスをラベル表から検索する
bool addlabel (const char *prog, const char *label, WORD adr)
 プログラム名、ラベル、アドレスをラベル表に追加する
void printlabel ()
 ラベル表を表示する
void freelabel ()
 ラベル表を解放する

Variables

static int labelcnt = 0
 ラベル数
static LABELTABlabels [LABELTABSIZE]
 ラベル表
static CERR cerr_label []
 ラベルのエラー

Function Documentation

◆ addcerrlist_label()

void addcerrlist_label ( )

ラベルのエラーをエラーリストに追加する

Definition at line 84 of file label.c.

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

◆ addlabel()

bool addlabel ( const char * prog,
const char * label,
WORD adr )

プログラム名、ラベル、アドレスをラベル表に追加する

Returns
追加に成功した時はtrue、失敗した時はfalse
Parameters
*progプログラム名
*labelラベル
adrアドレス

Definition at line 106 of file label.c.

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

◆ compare_adr()

int compare_adr ( const void * a,
const void * b )

ラベルを比較した結果を返す。qsort内で使われる関数

Returns
ラベルが同一の場合は0、異なる場合は0以外
Parameters
*aラベルa
*bラベルb

Definition at line 78 of file label.c.

Here is the caller graph for this function:

◆ freelabel()

void freelabel ( )

ラベル表を解放する

Definition at line 158 of file label.c.

Here is the caller graph for this function:

◆ getlabel()

WORD getlabel ( const char * prog,
const char * label )

プログラム名とラベルに対応するアドレスをラベル表から検索する

Returns
プログラム名とラベルに対応するアドレス
Parameters
*progプログラム名
*labelラベル

Definition at line 89 of file label.c.

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

◆ label_hashkey()

HKEY * label_hashkey ( const char * value)

ラベルのハッシュ値をセットしたキーを返す

Returns
ハッシュ値をセットしたキー
Parameters
value

Definition at line 51 of file label.c.

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

◆ labelhash()

unsigned labelhash ( const char * prog,
const char * label )

プログラム名とラベルに対応するハッシュ値を返す

Returns
ハッシュ値
Parameters
progプログラム名
labelラベル

Definition at line 60 of file label.c.

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

◆ printlabel()

void printlabel ( )

ラベル表を表示する

Definition at line 135 of file label.c.

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

Variable Documentation

◆ cerr_label

CERR cerr_label[]
static
Initial value:
= {
{ 101, "label already defined" },
{ 102, "label table is full" },
{ 103, "label not found" },
}

ラベルのエラー

Definition at line 45 of file label.c.

◆ labelcnt

int labelcnt = 0
static

ラベル数

Definition at line 35 of file label.c.

◆ labels

LABELTAB* labels[LABELTABSIZE]
static

ラベル表

Definition at line 40 of file label.c.