在emu8086中Mov seg to ax错误

时间:2015-10-17 15:39:24

标签: assembly tasm emu8086

我刚刚安装了emu8086,我得到了一些奇怪的错误,我不在线mov ax, SEG datahere上理解。看起来它无法识别SEG关键字。为什么?代码在TASM + DosBox或GUI Turbo Assembler中编译得很好。

.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) 

1 个答案:

答案 0 :(得分:0)

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