+/**
+ * アセンブラ命令
+ */
+static CMD ascmd[] = {
+ { "START", assemble_start },
+ { "END", assemble_end },
+ { "DS", assemble_ds },
+ { "DC", assemble_dc },
+ { "", NULL }
+};
+
+/**
+ * マクロ命令
+ */
+static CMD macrocmd[] = {
+ { "OUT", assemble_out },
+ { "IN", assemble_in },
+ { "RPUSH", assemble_rpush },
+ { "RPOP", assemble_rpop },
+ { "", NULL }
+};
+
+/**
+ * アセンブルのエラーをエラーリストに追加
+ */
+void addcerrlist_assemble()
+{
+ addcerrlist_tok();
+ addcerrlist_word();
+ addcerrlist_label();
+ addcerrlist(ARRAYSIZE(cerr_assemble), cerr_assemble);
+}
+
+/**
+ * ファイルストリームの現在行を番号付きで表示する
+ */
+void printline(FILE *stream, const char *filename, int lineno, char *line)
+{
+ fprintf(stream, "%s:%5d:%s", filename, lineno, line);
+}
+
+/**
+ * アドレスを返す\n
+ * アドレスには、リテラル/10進定数/16進定数/アドレス定数が含まれる
+ */
+WORD getadr(const char *prog, const char *str, PASS pass)
+{
+ WORD adr = 0x0;
+
+ if(*str == '=') {
+ adr = getliteral(str, pass);
+ } else if(isdigit(*str) || *str == '-' || *str == '#') {
+ adr = nh2word(str);
+ } else {
+ if(pass == SECOND) {
+ if((adr = getlabel(prog, str)) == 0xFFFF) {
+ setcerr(103, str); /* label not found */
+ }
+ }
+ }
+ return adr;
+}