-1

这是我的代码(我知道这是错误的):

org 100h

sert dw 1 
 
mov si, 1
shl si, 1
lea ax,[si]   
 
jmp ax

1:
PRINTN "Number 1"
jmp end

2:
PRINTN "Number 2"
jmp end

3:
PRINTN "Number 3"
jmp end

4:
PRINTN "Number 4"
jmp end

end:


mov ah, 0 
int 16h
ret 
4

1 回答 1

2

尝试这样的事情:

        mov si, 1
        shl si, 1        ; adjust index for table entry size
        jmp [table+si]   ; branch to the destination found in the table

l1:     PRINTN "Number 1"
        jmp end

l2:     PRINTN "Number 2"
        jmp end

l3:     PRINTN "Number 3"
        jmp end

l4:     PRINTN "Number 4"
        jmp end

end:    ...

        ; jump table
        ; place this outside of your control flow
table   dw l1, l2, l3, l4
于 2020-11-16T10:31:51.590 回答