X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=include%2Fassemble.h;h=f8faf8108df8e7cd02fc99b684eacf723b19856e;hp=92b7917c84bc8f67137e3269729206a65a4b239e;hb=e8b475a846a6c819b5f7b4afbca67aa072294349;hpb=d9840e592d37c2f0c897cec60eda859b09c959e2 diff --git a/include/assemble.h b/include/assemble.h index 92b7917..f8faf81 100644 --- a/include/assemble.h +++ b/include/assemble.h @@ -1,25 +1,20 @@ #ifndef YACASL2_ASSEMBLE_INCLUDED #define YACASL2_ASSEMBLE_INCLUDED +#include +#include +#include #include +#include +#include +#include +#include "cerr.h" +#include "cmem.h" +#include "exec.h" +#include "hash.h" #include "struct.h" #include "word.h" - -/** - * @brief CASL IIの仕様 - */ -enum { - LABELSIZE = 8, /**<ラベルの最大文字数 */ - OPDSIZE = 40, /**<オペラントの最大数。CASL IIシミュレータの制限 */ -}; - -/** - * @brief YACASL2の制限 - */ -enum { - LINESIZE = 1024, /**<行の最大文字数 */ - TOKENSIZE = 256, /**<トークンの最大文字数 */ -}; +#include "token.h" /** * @brief アセンブルモードを表すデータ型 @@ -65,7 +60,7 @@ typedef struct { */ typedef struct _LABELTAB { struct _LABELTAB *next; /**<リスト次項目へのポインタ */ - LABELARRAY *label; /**ラベル配列 */ + LABELARRAY *label; /**<ラベル配列 */ } LABELTAB; /** @@ -125,39 +120,6 @@ void printlabel(); */ void freelabel(); -/** - * @brief オペランドを表すデータ型 - */ -typedef struct { - int opdc; /**<オペランド数 */ - char *opdv[OPDSIZE]; /**<オペランド配列 */ -} OPD; - -/** - * @brief 命令行を表すデータ型 - */ -typedef struct { - char *label; /**<ラベル */ - char *cmd; /**<コマンド */ - OPD *opd; /**<オペランド */ -} CMDLINE; - -/** - * @brief トークン取得のエラーを追加する - * - * @return なし - */ -void addcerrlist_tok(); - -/** - * @brief 行から、ラベル・コマンド・オペランドを取得する - * - * @return ラベル・コマンド・オペランド - * - * @param *line 行 - */ -CMDLINE *linetok(const char *line); - /** * @brief アセンブルエラーをエラーリストに追加する * @@ -177,6 +139,17 @@ void addcerrlist_assemble(); */ bool assemblefile(const char *file, PASS pass); +/** + * @brief 指定された1つまたは複数のファイルを2回アセンブル + * + * @return なし + * + * @param filec アセンブルするファイルの数 + * @param filev アセンブルするファイル名の配列 + * @param adr アセンブル結果を格納するアドレス + */ +void assemble(int filec, char *filev[], WORD adr); + /** * @brief ファイルにアセンブル結果を書き込む *