由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
CS版 - 相对于machine code, assembly到底有啥改进?
相关主题
Assembly Language速成machine learning?
问几句汇编指令(assembly language) (转载)大家给推荐个machine learning方面的经典书或电子文档吧
问个compiler/assembler/disassembler的问题[转载] tester面试
问一个.Net的问题who can write a voting machine??
[Job Opening] Mainframe Operating System Developer (IBM CST (转载)a question about ASP.NET
这两门课先学哪一个?machine translation
包子现金求助关于68k assembly问题PhD做Machine learning方向怎么样?
微软最近行不行啊machine learning到底怎么归类呢
相关话题的讨论汇总
话题: machine话题: code话题: assembly话题: machines话题: language
进入CS版参与讨论
1 (共1页)
j*****I
发帖数: 2626
1
assembler好像就是一对一的把assembly language翻译成machine code. 如果是酱紫的话,相
对于machine code,assembly language能解决的问题就是相同的architecture的机器,但是指
令代码不一样的情况。这样的情形有点无聊啊。
是不是我对这个machine architecture理解的还是不够?
z*****n
发帖数: 7639
2

的话,相
,但是指
你觉得是
mov ax,0000
好理解还是
B80000
好理解?

【在 j*****I 的大作中提到】
: assembler好像就是一对一的把assembly language翻译成machine code. 如果是酱紫的话,相
: 对于machine code,assembly language能解决的问题就是相同的architecture的机器,但是指
: 令代码不一样的情况。这样的情形有点无聊啊。
: 是不是我对这个machine architecture理解的还是不够?

j*****I
发帖数: 2626
3
软工的教科书上说的是,assembly相对于machine code减少了machine dependence.
易读性当然也是一个好处,但不是我这里问的。

【在 z*****n 的大作中提到】
:
: 的话,相
: ,但是指
: 你觉得是
: mov ax,0000
: 好理解还是
: B80000
: 好理解?

z*****n
发帖数: 7639
4
你自己已经下了个结论说assembly无聊了。我反驳
说不无聊,现在你又开始扯别的,你无不无聊?
机器码那是百分百的machine dependent, 汇编语言
是有一定的移植性的。比如8086的汇编你完全
可以做很小的修改移植到z80或者其他机器上去。
至少模块功能可以完全一致。

【在 j*****I 的大作中提到】
: 软工的教科书上说的是,assembly相对于machine code减少了machine dependence.
: 易读性当然也是一个好处,但不是我这里问的。

j*****I
发帖数: 2626
5
我有说assembly无聊么? 不过你这里提到的移植性倒是有点意思。 对于machine dependent
language,这样已经够革新的了。看来我理解的有点死。
我就把我看得贴在这八。
The late 1940s and the late 1950s saw the introduction of the first
general-purpose electronic computers for defense purposes. These
machines could run code that addressed any problem, not just a single
predetermined task. The downside was that the code executed on those
computers was in a machine-specific "language" with the program coupled
to the hardware itself. Code developeed for one machine could not run on
another. Initially this was not a cause for concern since there were
only a handful of computers in the world anyway. As machines become more
prolific, in the early 1960s the emergence of assembly language
decoupled the code from specific machines, and enabled code to run on
multiple machines.
However, the code was now coupled to the machine architecture. Code
written for an 8-bit machine could not run on a 16-bit machine, let
alone withstand differences in the registers or available memory and
memory layout. As a result, the cost of owning and maintaining a program
began to escalate. This coincided more or less with the widespread
adoption of computers in the civilian and government sectors, where the
more limited resources and budgets necessitated a better solution.
最让我不明白的一句就是,"in the early 1960s the emergence of assembly
language decoupled the code from specific machines, and enabled code to
run on multiple machines. " 这里说的意思应该是,有那么一些机器,用同一份
machine code不行,但是用同一份assembly program就可以。我就纳闷,这些个机器到
底是怎
么个差别,这种差别使得他们不能用同一份 machine code,但是可以用同一份
assembly code?
如果按照你的移植性来看,如果都是8位机,那么换台机器,把同一份assembly code改改
register的名字就可以。而且instruction set即便有差别,改起来应该也不麻烦。

【在 z*****n 的大作中提到】
: 你自己已经下了个结论说assembly无聊了。我反驳
: 说不无聊,现在你又开始扯别的,你无不无聊?
: 机器码那是百分百的machine dependent, 汇编语言
: 是有一定的移植性的。比如8086的汇编你完全
: 可以做很小的修改移植到z80或者其他机器上去。
: 至少模块功能可以完全一致。

z*****n
发帖数: 7639
6
这句话说得很清楚:汇编语言是可以移植的。不同的
处理器内部结构指令解码器等等都不一样,当然机器
代码也不一样。同样一个寄存器写入指令,机器A可能
是3E, 机器B可以是A6。但是汇编语言都可以写成
load A,x。
不可移植性是指的如果机器的总线宽度,内存空间不
一样,移植起来就很困难。一个16位的加法在16位总
线的机器上可以用一条指令完成,但是移植到一个8位
机器上就需要至少10几条指令,还需要其他寄存器辅助
才能完成。

dependent

【在 j*****I 的大作中提到】
: 我有说assembly无聊么? 不过你这里提到的移植性倒是有点意思。 对于machine dependent
: language,这样已经够革新的了。看来我理解的有点死。
: 我就把我看得贴在这八。
: The late 1940s and the late 1950s saw the introduction of the first
: general-purpose electronic computers for defense purposes. These
: machines could run code that addressed any problem, not just a single
: predetermined task. The downside was that the code executed on those
: computers was in a machine-specific "language" with the program coupled
: to the hardware itself. Code developeed for one machine could not run on
: another. Initially this was not a cause for concern since there were

1 (共1页)
进入CS版参与讨论
相关主题
machine learning到底怎么归类呢[Job Opening] Mainframe Operating System Developer (IBM CST (转载)
哪一本machine learning 的书好这两门课先学哪一个?
machine learning方向工业界的应用多么包子现金求助关于68k assembly问题
在machine learning 里, clustering 和 classification 有什么区别?微软最近行不行啊
Assembly Language速成machine learning?
问几句汇编指令(assembly language) (转载)大家给推荐个machine learning方面的经典书或电子文档吧
问个compiler/assembler/disassembler的问题[转载] tester面试
问一个.Net的问题who can write a voting machine??
相关话题的讨论汇总
话题: machine话题: code话题: assembly话题: machines话题: language