0
我在大會寫了這個程序。我正在爲8086處理器使用MALM編譯器。該程序是爲了表明3個消息和採取3個值。我只是beginnier並有問題,以確定做的錯誤。計劃顯示隨機的符號代替文字
dane1 segment
a db 30,0
db 31 dup(?)
db '$'
d db ?
db'$'
b db 30,0
db 31 dup(?)
db '$'
tx1 db "Enter the first number (max 30 characters) :",10,13,"$"
db ?
tx2 db "Enter the symbol *,+,-,/: ",10,13,"$"
db ?
tx3 db "Enter the second number (max 30 characters): ",10,13,"$"
db ?
nline db 10,13,"$"
db ?
dane1 ends
code1 segment
start1:
mov sp,offset wstosu ;stack initzialization
mov ax,seg wstosu
mov ss,ax
;showing the first message
mov dx, offset tx1
mov ax, seg tx1
mov ds, ax
mov ah,9
int 21h
;getting input
mov ax, seg dane1
mov ds,ax
mov dx,offset a
mov ah,0AH
;loading input to a
mov bh,0
mov bl,byte ptr ds:[a+1]
add bx,offset a+2
mov byte ptr ds:[bx],'$'
int 21h
mov dx, offset nline
mov ax, seg nline
mov ds,ax
mov ah,9
int 21h
;showing the second message
mov dx, offset tx2
mov ax, seg tx2
mov ds, ax
mov ah,9
int 21h
;getting input
mov ax, seg dane1
mov ds, ax
mov dx, offset d
mov ah, 0AH
;loading input to d
mov bh, 0
mov bl, byte ptr ds:[d+1]
add bx, offset d+2
mov byte ptr ds:[bx],'$'
int 21h
;new line
mov dx, offset nline
mov ax, seg nline
mov ds, ax
mov ah, 9
int 21h
;showing third message
mov dx, offset tx3
mov ax, seg tx3
mov ds, ax
mov ah,9
int 21h
mov ah,4ch
int 21h
code1 ends
stos1 segment stack
dw 200 dup(?)
wstosu dw ?
stos1 ends
end start1
EDIT1: 我更改代碼爲@Micheal建議,但仍然得到隨機的符號時,我儘量表現TX2。
EDIT2: 我設法以某種方式顯示信息,而不是隨機的符號,但現在程序不等待第二次輸入。我會很樂意提供任何幫助。
我改變如你所說的代碼,但仍然得到隨機符號。你知道問題在哪裏嗎? –
我改變了代碼,但現在程序不等待輸入。我會很樂意提供任何幫助。 –