Skip to content

Commit

Permalink
major update
Browse files Browse the repository at this point in the history
  • Loading branch information
kg68k committed Apr 23, 2023
1 parent ac1089a commit b9e4111
Show file tree
Hide file tree
Showing 171 changed files with 23,771 additions and 15,665 deletions.
17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ U8TOSJ = u8tosj

SRC_DIR = src
DOC_DIR = docs
INC_DIR = include
BLD_DIR = build


Expand All @@ -15,27 +16,31 @@ SJ_SRCS = $(subst $(SRC_DIR)/,$(BLD_DIR)/,$(SRCS))
DOCS = $(wildcard $(DOC_DIR)/*)
SJ_DOCS = $(addprefix $(BLD_DIR)/,$(DOCS))

INCS = $(wildcard $(INC_DIR)/*)
SJ_INCS = $(addprefix $(BLD_DIR)/,$(INCS))

.PHONY: all directories clean

all: directories $(SJ_DOCS) $(SJ_SRCS)
all: directories $(SJ_DOCS) $(SJ_INCS) $(SJ_SRCS)

directories: $(BLD_DIR) $(BLD_DIR)/docs $(BLD_DIR)/avl
directories: $(BLD_DIR) $(BLD_DIR)/avl $(BLD_DIR)/docs $(BLD_DIR)/include

$(BLD_DIR) $(BLD_DIR)/docs $(BLD_DIR)/avl:
$(BLD_DIR) $(BLD_DIR)/avl $(BLD_DIR)/$(DOC_DIR) $(BLD_DIR)/$(INC_DIR):
$(MKDIR_P) $@

$(BLD_DIR)/$(DOC_DIR)/%: $(DOC_DIR)/%
$(U8TOSJ) < $^ >! $@

$(BLD_DIR)/docs/%: $(DOC_DIR)/%
$(BLD_DIR)/$(INC_DIR)/%: $(INC_DIR)/%
$(U8TOSJ) < $^ >! $@

$(BLD_DIR)/%: $(SRC_DIR)/%
$(U8TOSJ) < $^ >! $@


clean:
-rm -f $(SJ_DOCS) $(SJ_SRCS)
-rmdir $(BLD_DIR)/docs $(BLD_DIR)/avl $(BLD_DIR)
-rm -f $(SJ_INCS) $(SJ_DOCS) $(SJ_SRCS)
-rmdir $(BLD_DIR)/$(INC_DIR) $(BLD_DIR)/$(DOC_DIR) $(BLD_DIR)/avl $(BLD_DIR)


# EOF
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ UTF-8のままでは正しくビルドできませんので注意してくださ


## License
GNU General Public License version 2 or later.
GNU General Public License version 3 or later.


## Author
Expand Down
340 changes: 0 additions & 340 deletions docs/GPL.TXT

This file was deleted.

1,891 changes: 970 additions & 921 deletions docs/README.txt

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions docs/analysis.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

コード解析パターン

───────────────────────────────────────


 以下の命令パターンを相対オフセットテーブルとして検出する。

 最後の命令が JMP|JSR の場合は、テーブルの宛先は奇数アドレスに限られる。

 *s はスケールファクタで*1。68020以降の場合は*2も受け付ける。

ADD Dm,Dm はコードを分かりやすくするために書いているだけで、解析対象ではない
(スケールファクタが2の場合はこの命令は不要)。


・MOVE + JMP|JSR

ADD Dm,Dm
MOVE (table,PC,Dm.[wl]*s),Dn
JMP|JSR (table,PC,Dn.w)


・LEA + MOVE + JMP|JSR

ADD Dm,Dm
LEA (table,pc),An
MOVE (An,Dm.[wl]*s),Dn
JMP|JSR (An,Dn.w)


・LEA + MOVE + PEA

ADD Dm,Dm
LEA (table,pc),An
MOVE (An,Dm.[wl]*s),Dn
PEA (An,Dn.w)


・LEA + ADDA

ADD Dm,Dm
LEA (table,pc),An
ADDA (table,pc,Dm.w*s),An


・MOVE + LEA

ADD Dm,Dm
MOVE (table,PC,Dm.[wl]*s),Dn
LEA (table,PC,Dn.w),An


・MOVE + PEA

ADD Dm,Dm
MOVE (table,PC,Dm.[wl]*s),Dn
PEA (table,PC,Dn.w)


───────────────────────────────────────
Loading

0 comments on commit b9e4111

Please sign in to comment.