赋值指令未为 emu8086 中的符号分配新值

Assignment directive not assigning new value to a symbol in emu8086

为什么以下代码不使用 emu8086 中的赋值指令(=)为符号 X 赋新值:

.model small
.data

        X = 8

.code
.startup

       mov ax, @data
       mov ds, ax

       mov bx, X

       X = 6      

       mov bx, X 

       mov ah, 02h
       mov dx, bx   
       add dx, 48
       int 21h     ; It should display 6 but instead it display 8. 

       mov ah, 04ch
       int 21h

end

EMU8086有一个bug/deficiency。您对 = 指令如何工作的解释是 correct:

Integers defined with the = directive can be redefined with another value in your source code, but those defined with EQU cannot.

如果您使用 MASMTASM 编译此代码,代码应按预期工作,显示 6 而不是 8.

EMU8086 多年未更新,我不认为它目前正在维护。似乎没有错误报告系统或与产品相关的错误相关电子邮件地址。

如果您正在寻找不使用 EMU8086 的理由,那就是缺乏维护;已知错误;有限的 BIOS 和 DOS Int 21h 兼容性应该是寻找其他工具来完成这项工作的原因。为您所在的 OS 编写本机的 32 位和 64 位代码是一种更理想的方法。 EMU8086 是一个很好的教学工具,但不应该用于任何严肃的工作。