請問這ㄍ程式還需要加些什ㄇ?? |
尚未結案
|
ffffff2641
一般會員 發表:2 回覆:0 積分:0 註冊:2005-06-06 發送簡訊給我 |
這是我們微處理機要考ㄉ試題...不之還有哪些部分需要修改ㄉ!!??
.model small
.data
msg0 db 'input a:$'
msg1 db 13,10,'input b:$'
msg2 db 13,10,'input c:$'
msg3 db 13,10,'ouput a+b+c=$'
msg4 db 13,10,'input d:$'
msg5 db 13,10,'output a+b-c+d=$'
msg6 db 13,10,'odd$'
msg7 db 13,10,'even$'
no1 db ?
no2 db ?
no3 db ?
no4 db ?
num db 2
.code
mov ax,@data
mov ds,ax
mov dx,offset msg0
call putstr
call input
mov no1,al
mov dx,offset msg1
call putstr
call input
mov no2,al
mov dx,offset msg2
call putstr
call input
mov no3,al
mov dx,offset msg3
call putstr
mov al,no1
add al,no2
mov dl,al
call outchar
mov ah,0
div [num]
.if(ah!=0)
mov dx,offset msg6
call putstr
.else
mov dx,offset msg7
call putstr
.endif
mov dx,offset msg4
call putstr
call input
mov no4,dl
mov dx,offset msg5
call putstr
mov al,no1
add al,no2
add al,no4
mov dl,al
call outchar1
mov ah,0
div [num]
.if(ah!=0)
mov dx,offset msg6
call putstr
.else
mov dx,offset msg7
call putstr
.endif
mov ah,4ch
int 21h
putstr proc
mov ah,9
int 21h
ret
putstr endp
outchar proc
add dl,no3
sub dl,'0'
sub dl,'0'
mov ah,2
int 21h
ret
outchar endp
outchar1 proc
sub dl,no3
sub dl,'0'
sub dl,'0'
sub dl,'0'
mov ah,2
int 21h
ret
outchar1 endp
input proc
mov ah,1
int 21h
ret
input endp
end
這ㄍ程式動作是輸入a,b,c值,做加法運算在做第一次奇偶數判別
然後再輸入d值做a+b-c+d運算,然後再做第二次奇偶數判別
可是最後ㄉ輸出都會跑出亂碼..不知是出ㄌ什ㄇ問題..請各位高手幫ㄍ忙唄!!
感激不盡..
|
pcboy
版主 發表:177 回覆:1838 積分:1463 註冊:2004-01-13 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |