怎么办汇编地图x86指令助记符为二进制的机器指令? [英] How Do Assemblers Map x86 Instruction Mnemonics to Binary Machine Instructions?

查看:129
本文介绍了怎么办汇编地图x86指令助记符为二进制的机器指令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣写一个x86汇编。我想知道什么是(使用英特尔的语法)转换成相应的二进制机器code的说明图x86汇编指令助记符一个很好的方式。

I'm interested in writing an x86 assembler. I'm wondering what is a good way to map x86 assembly mnemonic instructions (using an Intel-like syntax) into the corresponding binary machine code instructions.

推荐答案

你想了解助记符机器code的物理图谱?如果是这样的体积2A和在该英特尔IA32 / IA64参考手册2B 描述x86机器$ C $的二进制格式角

Do you want to understand the physical mapping of mnemonics to machine code? If so volume 2A & 2B of the the Intel IA32/IA64 reference manuals describe the binary format of x86 machine code .

这是维基百科的 x86指令集页面有介绍,当他们被分类的所有指令一个紧凑的上市,​​这可以帮助你确定需要优先实施的。

The x86 instruction set page on Wikipedia has a compact listing of all the instructions categorized by when they were introduced, which might help you prioritize what to implement first.

不过,如果你是问如何去分析一个组装code文本文件中去的地步,你的程序可能会开始写了机code,那么你基本上需要了解如何编写点编译器。这些工具lex和yacc的好地方开始,但如果你不知道如何建立一个编译器,你还需要得到一本书。我觉得龙书是目前最好的之一,但也有任意数量的其他书籍,你可以使用,所以有很多的建议。

However, if you are asking about how to go about parsing an assembly code text file to get to the point where your program could start writing out machine code then you basically need to understand how to write a compiler. The tools lex and yacc are good places to start but if you don't know how build a compiler you'll also need to get a book. I think the Dragon book is the best one out there but there are any number of other books you could use, SO has plenty of recommendations.

这篇关于怎么办汇编地图x86指令助记符为二进制的机器指令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆