嗨,我在编译 x86 汇编代码时遇到问题,我使用 nasm 进行编译,但编译器告诉我语法错误。我不明白,因为我使用了一个简单的标签并跳转到它?有人可以给我解释一下吗..
; reads character and prints ascii code in console
[BITS 16]
SEGMENT code
..start:
mov ax, pile
mov ss, ax
mov ax, topofstack
mov sp, ax
loop: ; gives syntax error
mov ah, 00h
int 16h
cmp ax, 1c0dh ; user pressed enter, jump to end
je end
mov ah, 09h ; write character and attribute at cursor position
mov bh, 0h ; flags...
mov bl, 08h
mov cx, 01h
int 10h
jmp loop ; gives syntax error
end:
mov ax, 04c00h
int 21h
SEGMENT pile stack
resb 64
topofstack: