X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fassemble.c;h=563431c4086a112382858858265936f682054982;hb=bb429bb66ef15895f3a389954bf4c864624219f1;hp=272f2f8b001a84a8241e15e14a98c761b15e64d5;hpb=d1f82970bf7d41db2fea11b08cd8e308f6cb8138;p=YACASL2.git diff --git a/src/assemble.c b/src/assemble.c index 272f2f8..563431c 100644 --- a/src/assemble.c +++ b/src/assemble.c @@ -13,7 +13,7 @@ ASMODE asmode = {false, false, false, false, false}; /** - * アセンブルのプロパティ + * アセンブルのプロパティ: ptr, lptr, *prog */ ASPROP *asprop; @@ -24,8 +24,6 @@ static CERR cerr_assemble[] = { { 101, "label already defined" }, { 102, "label table is full" }, { 103, "label not found" }, - { 104, "label length is too long" }, - { 105, "no command in the line" }, { 106, "operand mismatch in assemble command" }, { 107, "no label in START" }, { 108, "not command of operand \"r\"" }, @@ -34,48 +32,42 @@ static CERR cerr_assemble[] = { { 111, "not command of operand \"adr[,x]\"" }, { 112, "not command of no operand" }, { 113, "operand too many in COMET II command" }, - { 117, "operand too many in DC" }, - { 118, "operand length too long" }, { 119, "out of COMET II memory" }, { 120, "GR0 in operand x" }, - { 121, "cannot get operand token" }, { 122, "cannot create hash table" }, - { 123, "unclosed quote" }, { 124, "more than one character in literal" }, { 125, "not GR in operand x" }, }; -#ifndef UNITTEST -static WORD getadr(const char *prog, const char *str, PASS pass); +WORD getadr(const char *prog, const char *str, PASS pass); -static WORD getgr(const char *str, bool is_x); +WORD getgr(const char *str, bool is_x); -static WORD getliteral(const char *str, PASS pass); +WORD getliteral(const char *str, PASS pass); -static bool assemblecmd(const CMDLINE *cmdl, PASS pass); +bool assemblecmd(const CMDLINE *cmdl, PASS pass); -static bool macrocmd(const CMDLINE *cmdl, PASS pass); +bool macrocmd(const CMDLINE *cmdl, PASS pass); -static bool writeIN(const char *ibuf, const char *len, PASS pass); +bool writeIN(const char *ibuf, const char *len, PASS pass); -static bool writeOUT(const char *obuf, const char *len, PASS pass); +bool writeOUT(const char *obuf, const char *len, PASS pass); -static bool writeRPUSH(PASS pass); +bool writeRPUSH(PASS pass); -static bool writeRPOP(PASS pass); +bool writeRPOP(PASS pass); -static bool cometcmd(const CMDLINE *cmdl, PASS pass); +bool cometcmd(const CMDLINE *cmdl, PASS pass); -static bool writememory(WORD word, WORD adr, PASS pass); +bool writememory(WORD word, WORD adr, PASS pass); -static void writestr(const char *str, bool literal, PASS pass); +void writestr(const char *str, bool literal, PASS pass); -static void writeDC(const char *str, PASS pass); +void writeDC(const char *str, PASS pass); -static bool assembleline(const CMDLINE *cmdl, PASS pass); +bool assembleline(const CMDLINE *cmdl, PASS pass); -static void printline(FILE *stream, const char *filename, int lineno, char *line); -#endif +void printline(FILE *stream, const char *filename, int lineno, char *line); /** * 汎用レジスタを表す文字列「GR[0-7]」から、レジスタ番号[0-7]をWORD値で返す