我有以下asm代码(x86).
.input:
mov ah, 00h ; get key from keyboard buffer
int 16h ; interrupt 16h
mov dl, al ; move ASCII code into dl
mov ah, 02h ; function 02
int 21h ; interrupt 21h
mov ah, 0Eh ; tell the BIOS to print the character in the AL register
mov al, dl ; copy dl into al
int 10h ; print al
sub al,0Dh ; check if it's carriage return
jz 01h ; jump relative 1 (to skip newLine)
call newLine ; add CR LF
jmp .input ; loop
Run Code Online (Sandbox Code Playgroud)
但是,如果零指令的跳转没有按预期工作(希望),即jz 01h.
我想跳过相对1指令(或加一个IP),跳过调用newLine子程序.
目前,当我按下回车键并调用jz指令时,我相信该程序在程序运行的早期就像一段代码一样跳跃.
有任何想法吗?
谢谢,史蒂夫
归档时间: |
|
查看次数: |
583 次 |
最近记录: |