วันพฤหัสบดีที่ 29 กรกฎาคม พ.ศ. 2553

num

;program add_num;Jirayu Yawut 5204101319
.model small.datanum1 byte ? ;first numnum2 byte ? ;second num
msg1 byte 0ah,0dh,"INPUT NUMBER>$"msg2 byte 0ah,0dh,"SUM IS>"result byte "*$"
.codemain proc mov ax,@data ;data segment mov ds,ax mov cx,1 mov bx,0
mov ah,9 mov dx,offset msg1 ;show msg1 int 21h mov ah,1 ;wait from keyboard int 21h mov num1[bx],al sub al,30h inc bx
mov ah,9 mov dx,offset msg1 ;show msg1 int 21h
mov ah,1 ;wait from keyboard int 21h mov num2[bx],bl sub bl,30h inc bx
add bl,al mov result,bl
mov ah,9 mov dx,offset msg2 ;show msg2 int 21h
add bl,30h mov result,bl
mov ah,9 mov dx,offset msg2 ;show msg2 int 21h
mov ah,4ch ;exit to DOS int 21h
main endpend

ไม่มีความคิดเห็น:

แสดงความคิดเห็น