§ 瀏覽學位論文書目資料
  
系統識別號 U0002-1601200622194300
DOI 10.6846/TKU.2006.00422
論文名稱(中文) Java正反組譯器
論文名稱(英文) Java Assembler and Disassembler
第三語言論文名稱
校院名稱 淡江大學
系所名稱(中文) 資訊管理學系碩士班
系所名稱(英文) Department of Information Management
外國學位學校名稱
外國學位學院名稱
外國學位研究所名稱
學年度 94
學期 1
出版年 95
研究生(中文) 凃冠名
研究生(英文) Kuan-Ming Twu
學號 689520327
學位類別 碩士
語言別 繁體中文
第二語言別
口試日期 2006-01-07
論文頁數 82頁
口試委員 指導教授 - 廖賀田(htliaw@mail.im.tku.edu.tw)
委員 - 張昭憲
委員 - 高明達
委員 - 莊庭瑞
關鍵字(中) Java
組合語言
組譯
反組譯
關鍵字(英) Java
Assembly
Assemble
Disassemble
第三語言關鍵字
學科別分類
中文摘要
Java語言具有完整的跨平台特性,也就是說它的程式碼既與電腦廠牌無關,也與作業系統無關。由Java原始程式碼經過編譯後的Java位元組碼可以在各種平台的Java虛擬機上執行。Java程式在執行上比C/C++語言稍慢,在保持跨平台特性的前提下,我們可以藉由直接撰寫位元組碼來提昇Java程式的效能。

Java虛擬機的規格書只定義出稱為位元組碼的機器語言,而未定義Java組合語言。本論文分析Java虛擬機的位元組碼,定義出一套Java組合語言,並為它製作正組譯器與反組譯器。正組譯器負責讀入程式員撰寫的Java組合語言檔,將它組譯成位元組碼。而反組譯器負責讀入位元組碼,將它反組譯成Java組合語言檔。

本論文的Java組合語言在功能上比目前網路上流傳的各種Java組合語言都完整。本論文的正組譯器與反組譯器不但可以用來增進程式效能,更可以用來作為學習Java虛擬機與位元組碼的優良工具。
英文摘要
Java is a completely Platform-Independent programming language. In other words, we don’t have to concern about what brand or Operating System our computers are. The Java Bytecode, compiled from the source code, can be executed on the Java Virtual Machines implemented for various platforms. The executing speed of Java is slightly slower than that of C/C++. With the prerequisite in maintaining the capability of platform-independency, we can improve the performance of the Java programs by rewriting the Bytecodes.

The Java Virtual Machine Specification only defines the machine language called Bytecode, but no definition about Java Assembly Language. In this thesis, we analyze the Bytecode of the Java Virtual Machine, bring up a Java Assembly Language, and implement a supporting Assembler/ Disassembler. The Assembler reads in the Java Assembly files written by the programmers and outputs the Java Bytecodes. The Disassembler reads in the Java Bytecodes and Disassemble them to the Java Assembly files as its output.

The functions of the Assembly Language we bring up in this thesis are much more complete than other existing Assembly. The Assembler/ Disassembler implemented in this thesis can be used not only to improve the performance of the applications but also as an excellent tool for learning the Java Virtual Machine and the Bytecode.
第三語言摘要
論文目次
第壹章 緒論	1
一、 研究背景與動機	1
二、 論文組織	4
第貳章 Java虛擬機器與組合語言簡介	5
一、 Java虛擬機架構	5
二、 Java機器語言	9
三、 各種組合語言與組譯器	10
四、 本論文的組合語言	11
第參章 正組譯	14
一、 組譯器架構	15
二、 正組譯流程及結構	16
1、 讀入轉換為類別結構	16
2、 截取組合JAsm指令參數	17
3、 生成JAsm Code Array	21
4、 寫回代換Code Array	35
第肆章 反組譯	36
一、 反組譯器架構	36
二、 反組譯流程及結構	37
1、 讀入轉換為類別結構	37
2、 輸出組合語言	40
 

第伍章 本系統用法	42
一、 反組譯與編輯	42
二、 正組譯與執行	43
第陸章 總結	44
一、 結論	44
二、 後續發展	45
1、 簡化JAsm語言	45
2、 直接生成機器碼	45
參考文獻	46
附錄A  JAsm指令規格書	47
一、 虛指令	47
1、 變數宣告指令	47
2、 標籤定位指令	48
3、 方法結束指令	48
二、 JAsm指令	49
1、 區域變數操作指令	49
2、 算術與邏輯運算指令	51
3、 型別轉換指令	52
4、 物件生成與操作指令	54
5、 運算元堆疊管理指令	55
6、 控制權移轉指令	57
7、 方法呼叫與回傳指令	59
 

附錄B  JVM指令集	61
一、 區域變數操作指令	61
二、 算術與邏輯運算指令	64
三、 型別轉換指令	68
四、 物件生成與操作指令	70
五、 運算元堆疊管理指令	73
六、 控制權移轉指令	76
七、 方法呼叫與回傳指令	80
參考文獻
[1]  Benji Jasik, “dis - A Fast and Simple Disassembler”, <http://www.cs.princeton.edu/~benjasik/dis/>.
[2]  Chris Rathman, “Jasper 1.0”, Aug. 2000, <http://www.angelfire.com/tx4/cus/jasper/>.
[3]  Ian Kaplan, “Javad: A Java Class File Disassembler”, Jan. 2000, <http://www.bearcave.com/software/java/javad/>.
[4]  Jason Hunt, “JavaA: Java Bytecode Assembler”, 1996, <http://www.cs.rpi.edu/~moorthy/Courses/compiler99/Assembler/>
[5]  Jonathan Meyer, “Jasmin-1.1”, 2004, <http://jasmin.sourceforge.net/>.
[6]  K. K. A. Kumar and P. Norp, “JReversePro 1.4.1”, Oct. 2002, <http://sourceforge.net/projects/jrevpro/>.
[7]  Quest Software Inc., “JProbe Suite 6.0”, <http://www.quest.com/jprobe/>.
[8]  Red Hat Inc., “Fedora Core 4”, <https://www.redhat.com/fedora/>.
[9]  Sun Microsystems, inc., “Java 2 Platform, Standard Edition.”, <http://java.sun.com/j2se/>.
[10] Jonathan Meyer and Troy Downing, “JAVA Virtual Machine”, O’Reilly, 2000.
[11] T. Lindholm and F. Yellin, “The Java Virtual Machine Specification 2nd Edition”, Addison-Wesley, 1999.
[12] K.B.Sriram, “JAS – Java Bytecode Assembler”, <http://www.ooware.com/mirrors/kb/jas.html>.
[13] Sun Microsystems, inc., “javap – The Java Class Disassembler”, <http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javap.html>.
[14] Dan Stone, “IJVM – modified(integer-only) subset of Sun’s JVM”, Prentice-Hall, 1998, <http://www.ontko.com/mic1/> <http://www.ontko.com/mic1/jas.html>
論文全文使用權限
校內
紙本論文於授權書繳交後2年公開
同意電子論文全文授權校園內公開
校內電子論文於授權書繳交後2年公開
校外
同意授權
校外電子論文於授權書繳交後2年公開

如有問題,歡迎洽詢!
圖書館數位資訊組 (02)2621-5656 轉 2487 或 來信