错误A2006:未定义的符号:DGROUP

时间:2011-11-12 19:15:02

标签: assembly x86 masm irvine16

我正在尝试汇编此代码,但它返回错误。你能帮我解决一下吗?感谢。

INCLUDE irvine16.inc
.data
    array db 31h,32h,33h,34h    ;use db to define array
    COUNT = ($-array)       ;The $ operator gives the value of the location counter.
.code
main proc
    mov ax, @data       ;copy the address of the data segment  
    mov ds, ax      ;@data into the DS register
    mov bx, offset array    ;the offset operator returns the 16-bit offset of a label
    mov cx, COUNT   ;set up cx register as a counter register.  
    mov ah, 02      ;use function 2 of int 21h - display char stored in dl on screen
LP1: mov    dl, [bx]        ;LP1 is a label
    int 21h
    inc bx
    loop    LP1     ;decrement cx;  if cx not =0,loop back to label LP1.  
    mov ax, 4c00h
    int 21h
main endp
end main

1 个答案:

答案 0 :(得分:0)

DGROUP是一个16位的概念,因此pmod链接中的注释(它是16位代码,DGROUP是16位概念,确保使用16位链接器)是真的。

如果不解决它,请使用你的内存模型(.model),Dos是16年前的,但IIRC的某些段只存在于某些内存模型中。