问题描述
我刚开始学习装配。我在下面编写了程序,但编译器向我显示了两条错误消息。第一个是第30行。消息的内容是:操作数类型不匹配。第二条消息的内容是:遇到意外的文件结束。它在行nr。 34.我正在使用TASM编译器。程序的主要任务是找到最小数量的数组。
.MODEL large; 1
; 2
.code; 3
ORG 256h; 4
; 5
ASSUME CS:Dane,DS:Kod,SS :; 6
; 7
开始:; 8
; 9
DL_TABLICA EQU 10; 10
Tablica DB 01h,02h,00h,10h,12h,33h; 11
DB 15h, 09h,11h,08h,0Ah,00h; 12
Najmniejsza DB? ; 13
jmp Poczatek; 15
Poczatek:; 17
mov啊,[si]; 18
mov dx,DL_TABLICA; 19
Petla:; 21
mov bx,SEGMNT Tablica; 22
cmp dl,[bx]; 23
jae Petla; 24
mov al,[di ]; 25
dec bx; 26
Skok:; 27
loop Skok; 28
mov ax,Najmniejsza; 30
mov ax,4C13h; 32
int 21h; 33
Dane END; 34
什么我试过了:
我试图用<$ p $替换
mov ax,Najmniejsza
p> movzx ax,byte ptr Najmniejsza
但它仍然不起作用。
mov ax,OFFSET Najmniejsza
错误遇到意外的文件结束可能是由错误的 END
语句提供的。它必须像
END开始
我建议您获取 Borland Turbo汇编用户指南的副本。它可以在网上找到PDF文件。
I just have started to learn assembly. I made program below but compiler showed two error messages to me. First one is in the line number 30. The content of the message is: Operand types do not match. The content of the second message is: Unexpected end of file encountered. Its in the line nr. 34. I am using TASM compiler. The program main task is find the smallest number of the array.
.MODEL huge ;1 ;2 .code ;3 ORG 256h ;4 ;5 ASSUME CS:Dane, DS:Kod, SS: ;6 ;7 Start: ;8 ;9 DL_TABLICA EQU 10 ;10 Tablica DB 01h, 02h, 00h, 10h, 12h, 33h ;11 DB 15h, 09h, 11h, 08h, 0Ah, 00h ;12 Najmniejsza DB ? ;13 jmp Poczatek ;15 Poczatek: ;17 mov ah, [si] ;18 mov dx, DL_TABLICA ;19 Petla: ;21 mov bx, SEGMNT Tablica ;22 cmp dl, [bx] ;23 jae Petla ;24 mov al, [di] ;25 dec bx ;26 Skok: ;27 loop Skok ;28 mov ax, Najmniejsza ;30 mov ax, 4C13h ;32 int 21h ;33 Dane END ;34
What I have tried:
I tried to replavce
mov ax, Najmniejsza
with
movzx ax, byte ptr Najmniejsza
but its still does not work.
mov ax, OFFSET Najmniejsza
The error "Unexpected end of file encountered" is probably sourced by the wrong END
statement. It must be like
END Start
I recommend to get a copy of the Borland Turbo Assembler User's Guide. It can be found in the web as PDF file.
这篇关于操作数类型与程序集不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!