0

このコードをアセンブルしようとしていますが、エラーが返されます。修正するのを手伝ってくれませんか?ありがとう。

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
4

1 に答える 1

1

DGROUPは16ビットの概念であるため、pmodのリンク(16ビットコードです。DGROUPは16ビットの概念です。必ず16ビットのリンカーを使用してください)の説明は正しいです。

それでも解決しない場合は、メモリモデル(.model)で遊んでください。Dosは16年前のことですが、IIRCの一部のセグメントは一部のメモリモデルにしか存在しませんでした。

于 2011-11-18T08:12:16.910 に答える