作业帮 > 英语 > 作业

英语翻译用google翻译的不是很正确Critical Expressions_____________________

来源:学生作业帮 编辑:神马作文网作业帮 分类:英语作业 时间:2024/10/05 11:21:56
英语翻译
用google翻译的不是很正确
Critical Expressions
________________________________________
A limitation of NASM is that it is a two-pass assembler; unlike TASM and others,it will always do exactly two assembly passes.Therefore it is unable to cope with source files that are complex enough to require three or more passes.
The first pass is used to determine the size of all the assembled code and data,so that the second pass,when generating all the code,knows all the symbol addresses the code refers to.So one thing NASM can't handle is code whose size depends on the value of a symbol declared after the code in question.For example,
times (label-$) db 0
label:db 'Where am '
The argument to TIMES in this case could equally legally evaluate to anything at all; NASM will reject this example because it cannot tell the size of the TIMES line when it first sees it.It will just as firmly reject the slightly paradoxical code
times (label-$+1) db 0
label:db 'NOW where am '
in which any value for the TIMES argument is by definition wrong!
NASM rejects these examples by means of a concept called a critical expression,which is defined to be an expression whose value is required to be computable in the first pass,and which must therefore depend only on symbols defined before it.The argument to the TIMES prefix is a critical expression; for the same reason,the arguments to the RESB family of pseudo-instructions are also critical expressions.
Critical expressions can crop up in other contexts as well:consider the following code.
mov ax,symbol1
symbol1 equ symbol2
symbol2:
On the first pass,NASM cannot determine the value of symbol1,because symbol1 is defined to be equal to symbol2 which NASM hasn't seen yet.On the second pass,therefore,when it encounters the line mov ax,symbol1,it is unable to generate the code for it because it still doesn't know the value of symbol1.On the next line,it would see the EQU again and be able to determine the value of symbol1,but by then it would be too late.
NASM avoids this problem by defining the right-hand side of an EQU statement to be a critical expression,so the definition of symbol1 would be rejected in the first pass.
英语翻译用google翻译的不是很正确Critical Expressions_____________________
紧要关头的表达
________________________________________
NASM 的限制是它是一个二个途径的组合器;不像 TASM 和其他人,它将会总是完全地做二个集会途径. 因此它是不能控制 的够复杂来需要三或较多的途径来源文件.
第一途径用来决定所有的被装配的密码和数据的大小, 所以第二途径,当产生所有的密码时候,知道密码提交到所有的符号住址.因此事物 NASM 不能处理是估计的密码仰赖在问题的密码之后被宣布的符号价值. 举例来说,
次 (标签-$) 分贝 0
标签: 分贝 '我在哪里?'
因为当它最初看见它的时候 , 它不能够看得出泰晤士报线的大小 , 所以对泰晤士报的争论在这情况可以相等地法律上全然评估到任何事; NASM 将会拒绝这个例子. 它决意正如坚固被拒之人那些微地似非而是的密码
次 (标签-$+1) 分贝 0
标签: 分贝 '现在我在哪里?'
任何的价值为泰晤士报争论是藉着定义错误的!
NASM 不良品这些例子经由一项观念呼叫了紧要关头的表达, 被定义是表达谁的价值要在第一途径中可计算,和一定因此只有仰赖在它之前被定义的符号. 对泰晤士报前缀的争论是紧要关头的表达;因为相同的理由,对假的- 指令的 RESB 家庭的争论也是紧要关头的表达.
紧要关头的表达能在其他的上下文中也冒出 : 考虑接着的密码.
因为 symbol1 被定义相等到 NASM 没有看到的 symbol2, 所以在第一途径上, NASM 不能够决定 symbol1 的价值. 在第二途径上,因此,当它遇到线 mov 斧头 , symbol1 的时候, 它是不能为它产生密码的因为它仍然不 知道 symbol1 的价值. 在下个行上,它再一次会看见 EQU 并且可以 决定 symbol1 的价值,但是到时候它会很太晚.
NASM 藉由定义 EQU 陈述的用右手的边是紧要关头的表达避免这个问题,如此 symbol1 的定义会在第一途径中被拒绝.