2 ak520ak ak520ak 于 2014.10.22 22:19 提问

汇编实验题出现的一些错误

datarea segment
mess1 db 'stock number?',13,10,'$'
stoknin label byte
max db 3
act db ?
stokn db 3 dup(?)
stoktab db '05',' Excavators '
db '08',' F Lifters '
db '09',' Presses '
db '12',' Valves '
db '23',' Processors '
db '27',' Pumps '
descrn db 14 dup(20h),13,10,'$'
mess db 'Not in table!','$'
datarea ends
code segment
assume cs:code,ds:datarea,es:datarea
main proc far
push ds
sub ax,ax
push ax
mov ax,datarea
mov ds,ax

mov es,ax
start: lea dx,mess1
mov ah,09
int 21h
lea dx,stoknin
mov ah,0ah
int 21h
cmp act,0
Je exit
Mov al,stokn
Mov ah,mess1
Mov cx,06
Lea si,stoktab
a20: cmp ax,word ptr[si]
je a30
add si,14
loop a20
lea dx,mess
mov ah,09h
int 21h
jmp exit
a30: mov cx,07
lea di,descrn
rep movsw
lea dx,descrn
mov ah,09h
int 21h
jmp start
exit: ret
main endp
code ends
end main

我这段代码里面 为什么后面输入stoktab里面的几个编号都显示Not in table
是哪里错了?
用的编译工具是MASM 2012.5的
求各位大神解答

Csdn user default icon
上传中...
上传图片
插入图片