From 886b03134f0e5aad0ed3c29ae8d4e7cfa785f808 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Tue, 22 Jan 2013 17:58:11 +0900 Subject: [PATCH] =?utf8?q?Makefile=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- as/call_l2str.casl | 11 +++++++++++ as/casl2lib/l2str2.casl | 41 +++++++++++++++++++++++++++++++++++++++++ doc/.gitignore | 15 ++++++++++++++- doc_inner/Makefile | 28 ++++++++++++++-------------- 4 files changed, 80 insertions(+), 15 deletions(-) create mode 100644 as/call_l2str.casl create mode 100644 as/casl2lib/l2str2.casl diff --git a/as/call_l2str.casl b/as/call_l2str.casl new file mode 100644 index 0000000..4d201a2 --- /dev/null +++ b/as/call_l2str.casl @@ -0,0 +1,11 @@ +MAIN START + LD GR1,VAL + LAD GR2,ADR + CALL L2STR + ST GR3,LEN + OUT ADR,LEN + RET +VAL DC 11 +ADR DS 6 +LEN DS 1 + END diff --git a/as/casl2lib/l2str2.casl b/as/casl2lib/l2str2.casl new file mode 100644 index 0000000..65dc7be --- /dev/null +++ b/as/casl2lib/l2str2.casl @@ -0,0 +1,41 @@ +;;; GR1に格納された値を文字列に変換してメモリに格納。 +;;; GR2に文字列の先頭アドレス、GR3に文字列の長さを返す +;;; 依存プログラム: DIVL, REV +L2STR START + PUSH 0,GR1 + PUSH 0,GR4 + XOR GR0,GR0 ; GR0 <- 0 + LD GR4,GR2 ; GR4 <- GR2 + AND GR1,GR1 ; GR1をテスト + JZE ZERO ; GR1が0の場合、ZEROにジャンプ + PUSH 0,GR2 +STI CPL GR1,GR2 ; ループ先頭。(GR1 < GR2)の場合は、ループ脱出 + JMI STLST ; ↓ + LAD GR2,10 ; GR2に10進数の「10」を格納。 + CALL DIVL ; GR1とGR2の、商をGR0、剰余をGR3に格納 + LD GR1,GR3 ; GR1にGR3をコピー + LD GR1,NCHAR,GR1 ; GR1を文字に変換 + ST GR1,0,GR4 ; (GR4) <- GR1 + LAD GR4,1,GR4 ; GR4 <- GR4 + 1 + LD GR1,GR0 ; GR0をGR1にコピー + JUMP STI ; ループ終端 +STLST POP GR2 + LD GR1,NCHAR,GR1 ; GR1を文字に変換 + ST GR1,0,GR4 ; (GR4) <- GR1 + LAD GR4,1,GR4 ; GR4 <- GR4 + 1 + JUMP PRT ; PRTにジャンプ +ZERO LD GR1,NCHAR ; 「0」をSTR領域に格納 + ST GR1,0,GR4 ; ↓ (GR4) <- GR1 + LAD GR4,1,GR4 ; ↓ GR4 <- GR4 + 1 +PRT LD GR1,GR2 ; GR1に文字列のアドレスを格納 + SUBL GR4,GR2 ; GR2 <- GR4 - GR2 + LD GR2,GR4 ; ↓ + CALL REV ; 文字列を逆順に並べ替え + LD GR3,GR2 ; GR3に文字列の長さを格納 + LD GR2,GR4 ; GR2に文字列のアドレスを格納 + POP GR4 + POP GR1 + RET +LEN DS 1 +NCHAR DC '0123456789' + END diff --git a/doc/.gitignore b/doc/.gitignore index 707286e..6154d47 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,9 +1,22 @@ install.html +install_html install.info install.pdf install.txt manual.html -manual.pdf manual_html +manual.pdf yacasl2.info casl2_spec.html +*.aux +*.cp +*.cps +*.fn +*.ky +*.log +*.pg +*.pgs +*.tmp +*.toc +*.tp +*.vr diff --git a/doc_inner/Makefile b/doc_inner/Makefile index ac2414a..78cda3f 100644 --- a/doc_inner/Makefile +++ b/doc_inner/Makefile @@ -1,13 +1,13 @@ -.PHONY: all clean clean_doxygen clean_gnu_global -CD ?= cd -MV ?= mv -MAKE ?= make -DOXYGEN ?= doxygen -HTAGS ?= htags -RMRF ?= rm -rf -PWD ?= pwd -WHICH ?= which -ECHO ?= echo +.PHONY: all clean doxygen-clean gnu_global-clean + +CD := cd +DOXYGEN := doxygen +ECHO := echo +HTAGS := htags +MAKE := make +MV := mv +RMRF := rm -rf +WHICH := which DOXYGEN_DIR := doxygen GNU_GLOBAL_DIR := gnu_global @@ -18,7 +18,7 @@ all: $(DOXYGEN_DIR) $(GNU_GLOBAL_DIR) # ../Doxyfileで設定された以下のディレクトリーの下のhtmlディレクトリー # OUTPUT_DIRECTORY = doc_inner $(DOXYGEN_DIR): ../Doxyfile - $(WHICH) $(DOXYGEN) && ($(CD) .. && $(DOXYGEN) && $(CD) - && $(MV) html $@) >/dev/null || $(ECHO) "$(DOXYGEN): not found" + @($(WHICH) $(DOXYGEN) && ($(CD) .. && $(DOXYGEN) && $(CD) - && $(MV) html $@) >/dev/null || $(ECHO) "$(DOXYGEN): not found") # htagsのHTMLドキュメント作成先は、 # 引数DIRで指定されたディレクトリーの下のHTMLディレクトリー @@ -26,10 +26,10 @@ $(GNU_GLOBAL_DIR): $(MAKE) -C .. gtags $(WHICH) $(HTAGS) && ($(CD) .. && $(HTAGS) -anosx doc_inner && $(CD) - && $(MV) HTML $@) >/dev/null || $(ECHO) "$(HTAGS): not found" -clean: clean_doxygen clean_gnu_global +clean: doxygen-clean gnu_global-clean -clean_doxygen: +doxygen-clean: @$(RMRF) $(DOXYGEN_DIR) -clean_gnu_global: +gnu_global-clean: @$(RMRF) $(GNU_GLOBAL_DIR) -- 2.18.0