請組合語言高手幫我解釋每一行的意思!
不會的就大概跳過解釋就好......
老師要考每一行的解釋,
需要一位好心人幫我解釋!
.listall
.model tiny
.code
.386
org 100h
main: jmp begin
;-----------------------------------------------
ten db 0AH
hightemp equ 30
lowtemp equ 10
nowtemp db 20H
intnum db 2 Dup(?)
PROMP db "please enter now tempareture"
airmess db 0DH,OAH,"air conditioner on$"
heatmess db 0DH,OAH,"heater on$"
NICEDAY db 0DH,OAH,"have a nice day"'$'
;-------------------------------------------------
begin
PROC FAR
CALL READ_IN
CALL PACK_DEG
CALL ACTION
CALL WAITING
;-------------------------------------------------
READ_DEC PROC NEAR
XOR AL,AL
XOR BX,BX
.WHILE AL != 0DH
MOV AH,01H
INT 21H
.IF AL >= '0' && AL <= '9'
SUB AL,30H
MOV NUMBER[BX],AL
INC BX
.ENDIF
.ENDW
RET
READ_DEC ENDP
;----------------------------------------------
PACK_DEC PROC NEAR
.IF BX == 0
MOV DEC_NO,0H
RET
.ENDIF
.IF BX == 1
MOVZX AX,NUMBER
MOV DEC_NO,AX
RET
.ENDIF
DEC BX
XOR DI,DI
MOVZX AX,NUMBER[DI]
TO_DEC: MUL TEN
INC DI
ADD AL,NUMBER[DI]
ADC AH,0H
CMP BX,DI
JNZ TO_DEC
MOV DEC_NO,AX
RET
PACK_DEC ENDP
;--------------------------------------------------
ACTION
start:
mov ah,nowtemp
cmp ah,hightemp
ja airon
jmp finish
airon:
lea dx,airmess
mov ah,09h
int 21h
finish:
.exit
end main
2007-11-24 01:12:05 · 1 個解答 · 發問者 ? 5 in 電腦與網際網路 ➔ 程式設計
我寫好了,但文字太多這裡無法貼,我放在網路空間你去下載來看,我寫的滿清楚了,希望你說話算話唷^^
http://www.badongo.com/file/5266020
你點進去 輸入要你輸入的識別碼 ,再點此處下載你的文件,然後會開新的一頁 ,其中右下角會倒數15秒後才會出現此處下載你的文件 這按鈕給你點,你就下載吧
說話不算話 下次就列入黑名單= =
2007-11-24 03:41:43 · answer #1 · answered by eric 7 · 0⤊ 0⤋