assembly 执行汇编代码时,出现“此中断尚未定义”错误

zz2j4svz  于 2023-02-23  发布在  其他
关注(0)|答案(1)|浏览(159)

当我运行编写的代码时,在初始化数组时出现错误“此中断尚未定义,它可用于自定义函数。您可以通过修改中断向量表来定义此中断,请参阅支持的中断列表和全局内存表”
此代码在emu8086中运行:

.model tiny 
.code
ORG 100h
begin: 
JMP start
 
start:
   MOV   AH,9          ; output message0
   MOV   DX, offset mess0                                           
   INT   21h
 
   MOV   DI, offset buff       ; we will write STOSB in DI      
   MOV   BX,4          ; line counter
   MOV   DX,4          ; number counter in line
create:         ;<=====; start input and save ================//
   MOV   CX,2          ; limit the number to 2 characters
   DEC   DX            ; decrement the number counter
@1:
   MOV   AH,1          ; input
   INT   21h
   STOSB               ; store the first character in DI
   LOOP  @1            ; ..followed by the second.
   MOV   AL,' '        ; space/separator
   INT   29h
   STOSB               ; its too in DI..
   OR    DX,DX         ; is it the last number in the line?
   JNZ   create        ; no - fill in the line further
   MOV   AH,9          ; line ended.
   MOV   DX,offset crlf       ; new line!                     
   INT   21h
   DEC   BX            ; decrement the line count
   OR    BX,BX         ; is it last line?
   JZ    next          ; yes - exit the input loop
   MOV   DX,4          ; restore the number of numbers in a string
   JMP   create        ; fill in the next line of the array
 
next:           ;<=====; display the result on the screen ================//
   MOV   AH,9         
   MOV   DX, offset mess1                                                
   INT   21h
 
   MOV   CX,4          ; how many pairs of digits to output
   MOV   SI, offset buff       ; source - buffer                        
print:
   LODSB               ; read the first character
   INT   29h           ; display it on the screen
   LODSB               ; second character..
   INT   29h
   LODSB               ; take a space
   INT   29h
   ADD   SI,12         ; move the pointer to 4 triads of characters
   LOOP  print         ; loop until CX > 0
 
exit:                  ; exit
   XOR   AX,AX
   INT   16h
   INT   20h
 
ret 
 
mess0  DB  'CREATE ARRAY...',13,10
       DB  '====================',13,10,'$'
mess1  DB  '====================',13,10
       DB  'RESULT: $'
crlf   DB  13,10,'$'
buff   DB  80 DUP(0)   
end begin


有一页有问题

llew8vvj

llew8vvj1#

您正在尝试使用仿真器未实现的中断:
http://www.ctyme.com/intr/rb-4124.htm
您可能需要扩展模拟器以支持int 29h,或者向模拟器开发人员寻求扩展方面的帮助。或者,您可以将对int 29h的调用更改为int 21h,service 02:
http://www.ctyme.com/intr/rb-2554.htm
例如

mov dl,'A'    ; write 'A' to std out
    mov ah,02h    ; WRITE CHARACTER TO STANDARD OUTPUT
    int 21h

相关问题