将段移动到 emu8086 中的 ax 错误

Mov seg to ax error in emu8086

我刚刚安装了 emu8086,但在 mov ax, SEG datahere 上出现了我不明白的奇怪错误。看起来它无法识别 SEG 关键字。为什么?代码在 TASM+DosBox 或 GUI Turbo 汇编程序中编译得很好。

.model small
     ASSUME CS: codehere, DS:datahere, SS:stackhere

datahere segment para public 'DATA'

; data segment goes here

datahere ends   

stackhere segment word stack 'STACK'

     dw 400h dup (00)

stackhere ends

codehere segment para public 'CODE'
     start:

     mov ax, SEG  datahere
     mov ds, ax

     ; code goes here

     ; END
     mov ah, 4ch
     int 21h

codehere ends
     end start

错误:

wrong parameters: MOV  ax, SEG  datahere
probably no zero prefix for hex; or no 'h' suffix; or wrong addressing; or undefined var: (ITSELF) 

删除 SEG。它仅在您需要通常也具有偏移量的变量或标签的段时使用。 datahere 已被识别并作为段地址处理(也在 TASM 中)。