【发布时间】:2016-11-27 15:44:12
【问题描述】:
在 GNU as(GNU 汇编器)中,以下代码可以正确汇编:
mov $(80 * 24 + 4), %cx
但是,这段代码没有:
mov $(80 * 24 / 4), %cx
发出高度意外的错误:
example.S: Assembler messages:
example.S:42: Error: unbalanced parenthesis in operand 1.
唯一的区别是后者使用除法,而不是加法。这应该是有效的,according to the manual。
($<expression> 将立即数嵌入到汇编输出中;即常量。算术是在“编译时”执行的。我可以计算出数学,但它的扩展形式更有意义。)
【问题讨论】: