我正在使用针对 8086 CPU 的 NASM 解决大学任务,并且我编写了以下代码:
cpu 8086
segment vectors
resb 1024
segment code
..start mov bx, data
mov ds, bx
mov bx, stack
mov ss, bx
mov sp, bottom
mov dx, mesg
mov ah, 9
int 21h
xor ax, ax
mov cs:[0], ax ; Setting the vector for integer division by zero to div44
mov cs:[2], cs
jmp end3c
div44: xor dx, dx
mov cx, cs
mov [cs:div44], dx
mov [cs:div44+2], cx
iret
segment data
byte0 db ?
word0 dw ?
mesg db 'Division by zero', 0Dh, 0Ah, '$'
segment stack
resb 16
bottom db ?
end3c hlt
但我收到一个错误:
Line #32: error: label 'mesg' changed during code generation [-w+error=label-redef-late]
。第 32 行是
mesg db 'Division by zero', 0Dh, 0Ah, '$'
如何防止此错误发生?
学生,组装有问题吗? :D