0

我刚刚安装了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) 
4

1 回答 1

0

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

于 2015-10-17T15:58:07.563 回答