1
這裏是我編寫的即時通訊編寫的代碼,試圖在程序集8086上寫在常規鍵盤上,但每次我按下輸入它就行了,並在RAM中寫入第二個字母我如何修復它,而無需重置內存讓我們用戶從鍵盤寫入。如何在程序集8086中找到一條線?
data segment
; add your data here!
msg db ?
nxtline db 10,13,'$'
ends
stack segment
dw 128 dup(0)
ends
code segment
start:
; set segment registers:
mov ax, data
mov ds, ax
mov es, ax
; add your code here
xor ax,ax
mov ah,1
xor bx,bx
mov bx,offset msg
ifpressed:
;pusha
mov ah,1
int 21h
cmp al,0Dh ;check when enter is pressed
jz nextline
mov [bx],al
add bx,2
;popa
jmp ifpressed
nextline:
lea dx, nxtline
mov ah, 9
int 21h
jmp ifpressed
reapet:
mov ax, 4c00h ; exit to operating system.
int 21h
ends
end start ; set entry point and stop the assembler.
`
目前尚不清楚你想要什麼,但int21/01是輸入**與回聲**所以也許你想int21/08這是輸入**沒有回聲**。 – Jester
不,我希望它與回聲唯一的問題是,我寫的第二個字母總是返回一個新行的開始 –