解释 Dhamdhere 教科书中玩具 ISA 的汇编列表
考虑以下汇编器输出列表:
START 100
MOVER BREG, ONE 101) + 04 2 105
MOVEM BREG, RESULT 102) + 05 2 106
PRINT RESULT 103) + 10 0 106
STOP 104) + 00 0 000
ONE DC '1' 105) + 00 0 001
RESULT DS 1 106)
- 代码前面的 + 符号表示什么?
- 为什么
ONE
的地址是001
? - 为什么最后一个
RESULT DS 1
语句后面的条目留空?
Consider the following assembler output listing:
START 100
MOVER BREG, ONE 101) + 04 2 105
MOVEM BREG, RESULT 102) + 05 2 106
PRINT RESULT 103) + 10 0 106
STOP 104) + 00 0 000
ONE DC '1' 105) + 00 0 001
RESULT DS 1 106)
- What does the + sign before code signifies?
- Why is the address of
ONE
given001
? - Why is the entry after the last
RESULT DS 1
statement left blank?
This listing appears in Systems Programming and Operating Systems
by Dhamdhere (editor's note: as discovered by an answerer).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不知道您正在使用哪个汇编器(在您的问题中提供该信息可能是明智的),因此这些并不是特别消息灵通的答案:
编辑: 汇编程序是一种计算机程序,它获取包含汇编语言的文本并将其转换为机器代码。 它还可以以人类可读的形式生成输出,这就是您发布的代码的样子。 人类可读形式的格式特定于您正在使用的特定汇编器(即程序) - 它并不特定于汇编器为其发出机器代码的机器体系结构。
I don't know which assembler you are using (it might have beem sensible to give that information in your question) so these are not particularly well-informed answers:
Edit: An assembler is a computer program that takes text containing assembly language and turns it into machine code. It can also produce output in human readble form, which is what the code you posted appears to be. The format of the human readble form is specific to the particular assembler (i.e. program) that you are using - it is not specific to the machine architecture the assembler emits machine code for.
这似乎使用了 系统程序和操作。
在操作码输出的描述中,它说:“符号不是指令的一部分。” 快速浏览文本并没有揭示它的组成部分,并且所有示例在该栏中都有“+”。
This appears to be using the simple assembly language in Chapter 4 of Systems Program and Operation.
In the description of the opcode output, it says, "The sign is not a part of the instruction." A quick perusal of the text didn't reveal what it is part of, and all of the examples have "+" in that column.
“+”号不是指令的一部分。 (数字指令那边是机器指令)
ONE 的地址是 105,001 是使用 DC 分配给 ONE 的值,DC 是声明常量的缩写形式。
DC保留内存字空间并分配常量。
RESULT DS 1 的条目留空,因为 DS 保留了给定要求的内存空间,这里只给出了 1,因此它只保留了一个内存字位置。
仅数字部分的另一侧是机器指令,它遵循以下格式
例如,
注意:
它是用于假设计算机的简单汇编语言,用于说明汇编器的功能和技术。
"+" Sign is not part of the instruction. ( That side of numeric instructions are machine instruction )
Address of ONE is 105 and 001 is value assigned to ONE by using DC which is short form of declare constant.
DC reserve memory word space and assign the constant.
The entry of RESULT DS 1 left blank because DS reserves memory space of given requirement here only 1 is given so it only reserves one memory word location.
Other side of only numeric part is machine instruction it follows below format
For example,
Note :
It's simple assembly language for a hypothetical computer which is used to illustrate features and techniques of assemblers.