YACASL2
Loading...
Searching...
No Matches
assemble.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <ctype.h>
#include <assert.h>
#include <errno.h>
#include "cerr.h"
#include "struct.h"
#include "token.h"
Include dependency graph for assemble.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ASMODE
 アセンブルモードを表すデータ型 More...
struct  ASPTR
 アセンブル時の現在およびリテラルのアドレスとプログラム入口名を表すデータ型 More...
struct  LABELARRAY
 ラベル配列を表すデータ型 More...
struct  _LABELTAB
 ラベル表を表すデータ型 More...

Typedefs

typedef struct _LABELTAB LABELTAB
 ラベル表を表すデータ型

Enumerations

enum  { LABELTABSIZE = 251 }
enum  PASS { FIRST = 0 , SECOND = 1 }
 アセンブラが、1回目か2回目かを表す数値 More...

Functions

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 ()
 ラベル表を解放する
void addcerrlist_assemble ()
 アセンブルエラーをエラーリストに追加する
bool assemblefile (const char *file, PASS pass)
 指定された名前のファイルをアセンブル

bool assemble (int filec, char *filev[], WORD adr)
 指定された1つまたは複数のファイルを2回アセンブル
void outassemble (const char *file)
 ファイルにアセンブル結果を書き込む

Variables

ASMODE asmode
 アセンブルモード: src, label, onlylabel, asdetail, onlyassemble
ASPTRasptr
 アセンブル時の、現在およびリテラルのアドレスとプログラム入口名: ptr, lptr, prog

Typedef Documentation

◆ LABELTAB

typedef struct _LABELTAB LABELTAB

ラベル表を表すデータ型

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

ラベル表のサイズ

Enumerator
LABELTABSIZE 

ラベル表のサイズ

Definition at line 65 of file assemble.h.

◆ PASS

enum PASS

アセンブラが、1回目か2回目かを表す数値

Enumerator
FIRST 

アセンブラ1回目

SECOND 

アセンブラ2回目

Definition at line 72 of file assemble.h.

Function Documentation

◆ addcerrlist_assemble()

void addcerrlist_assemble ( )

アセンブルエラーをエラーリストに追加する

Definition at line 773 of file assemble.c.

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

◆ 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:

◆ assemble()

bool assemble ( int filec,
char * filev[],
WORD adr )

指定された1つまたは複数のファイルを2回アセンブル

Returns
アセンブル完了時はtrue、エラー発生時はfalseを返す
Parameters
filecアセンブルするファイルの数
filevアセンブルするファイル名の配列
adrアセンブル結果を格納するアドレス

Definition at line 727 of file assemble.c.

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

◆ assemblefile()

bool assemblefile ( const char * file,
PASS pass )

指定された名前のファイルをアセンブル

1回目ではラベルを登録し、2回目ではラベルからアドレスを読み込む

Returns
アセンブル完了時はtrue、エラー発生時はfalseを返す
Parameters
*fileファイル名
passアセンブラが何回目かを表す数

指定された名前のファイルをアセンブル
アセンブル完了時はtrue、エラー発生時はfalseを返す

Definition at line 699 of file assemble.c.

Here is the call graph for this function:
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:

◆ outassemble()

void outassemble ( const char * file)

ファイルにアセンブル結果を書き込む

Parameters
*fileファイル名

Definition at line 781 of file assemble.c.

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

◆ asmode

ASMODE asmode
extern

アセンブルモード: src, label, onlylabel, asdetail, onlyassemble

Definition at line 288 of file assemble.c.

◆ asptr

ASPTR* asptr
extern

アセンブル時の、現在およびリテラルのアドレスとプログラム入口名: ptr, lptr, prog

Definition at line 286 of file assemble.c.