¡¡¡¡¡¡datarea ¡¡¡¡¡¡segment
¡¡¡¡¡¡¡¡thirty ¡¡¡¡¡¡db ¡¡¡¡¡¡30
¡¡¡¡¡¡; ÐÅÏ¢±í
¡¡¡¡¡¡msg0 db 'I like my IBM-PC---------------------------------------'
¡¡¡¡¡¡msg1 db '8088 programming is fun--------------------------------'
¡¡¡¡¡¡msg2 db 'Time to buy more diskettes-----------------------------'
¡¡¡¡¡¡msg3 db 'This program works-------------------------------------'
¡¡¡¡¡¡msg4 db 'Turn off that printer----------------------------------'
¡¡¡¡¡¡msg5 db 'I have more memory than you----------------------------'
¡¡¡¡¡¡msg6 db 'The PSP can be useful----------------------------------'
¡¡¡¡¡¡msg7 db 'BASIC was easier than this-----------------------------'
¡¡¡¡¡¡msg8 db 'DOS is indispensable-----------------------------------'
¡¡¡¡¡¡msg9 db 'Last massage of the day--------------------------------'
¡¡¡¡¡¡; ´íÎóÐÅÏ¢
¡¡¡¡¡¡errmsg db 'error!!! invalid parameter!! '
¡¡¡¡¡¡datarea ends

¡¡¡¡¡¡stack ¡¡¡¡segment
¡¡¡¡¡¡¡¡db ¡¡¡¡¡¡256 ¡¡¡¡¡¡¡¡dup(0)
¡¡¡¡¡¡¡¡tos¡¡¡¡¡¡label ¡¡¡¡¡¡word
¡¡¡¡¡¡stack ¡¡¡¡ends

¡¡¡¡prognam ¡¡segment
¡¡¡¡¡¡¡¡main ¡¡¡¡proc ¡¡¡¡¡¡ far
¡¡¡¡¡¡¡¡assume ¡¡cs:prognam,ds:datarea,ss:stack
¡¡¡¡start:
¡¡¡¡¡¡¡¡mov ¡¡¡¡ ax,stack
¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡ss,ax
¡¡¡¡¡¡¡¡mov ¡¡¡¡ sp,offset ¡¡tos

¡¡¡¡¡¡¡¡push ¡¡¡¡ds
¡¡¡¡¡¡¡¡sub ¡¡¡¡ ax,ax
¡¡¡¡¡¡¡¡push¡¡¡¡ ax
¡¡¡¡¡¡¡¡mov ¡¡¡¡ ax,datarea
¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡ds,ax

¡¡begin:mov ¡¡¡¡ ah,1
¡¡¡¡¡¡¡¡int ¡¡¡¡ 21h ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡; ´Ó¼üÅÌÊäÈëÒ»¸ö×Ö·û
¡¡¡¡¡¡; ´íÎóÊäÈëתerror
¡¡¡¡¡¡¡¡sub ¡¡¡¡ al,'0'
¡¡¡¡¡¡¡¡jc ¡¡¡¡¡¡error
¡¡¡¡¡¡¡¡cmp ¡¡¡¡ al,9
¡¡¡¡¡¡¡¡ja¡¡¡¡¡¡ error
¡¡¡¡¡¡; ÕýÈ·ÊäÈë
¡¡¡¡¡¡¡¡mov ¡¡¡¡ bx,offset msg0 ¡¡¡¡ ; ÐÅÏ¢±íÊ×µØÖ·ËÍbx
¡¡¡¡¡¡¡¡mul ¡¡¡¡ thirty ¡¡¡¡¡¡¡¡¡¡¡¡ ; (ax)=(al)*30
¡¡¡¡¡¡¡¡add ¡¡¡¡ bx,ax ¡¡¡¡¡¡¡¡¡¡¡¡¡¡; bxÖ¸ÏòÏàӦλÖÃ
¡¡¡¡¡¡¡¡call ¡¡¡¡display ¡¡¡¡¡¡¡¡¡¡¡¡; ÏÔʾÏàÓ¦±àºÅÐÅÏ¢
¡¡¡¡¡¡¡¡jmp ¡¡¡¡ begin
¡¡error:mov ¡¡¡¡ bx,offset ¡¡errmsg
¡¡¡¡¡¡¡¡call ¡¡¡¡display ¡¡¡¡¡¡¡¡¡¡¡¡; ÏÔʾ´íÎóÐÅÏ¢
¡¡¡¡¡¡¡¡ret

¡¡¡¡¡¡¡¡display¡¡proc ¡¡¡¡¡¡ near
¡¡¡¡¡¡¡¡mov ¡¡¡¡ cx,30
¡¡disp1:mov ¡¡¡¡ dl,[bx]
¡¡¡¡¡¡¡¡call ¡¡¡¡dispchar ¡¡¡¡¡¡¡¡¡¡ ; ÏÔʾһ¸ö×Ö·û
¡¡¡¡¡¡¡¡inc ¡¡¡¡ bx
¡¡¡¡¡¡¡¡loop ¡¡¡¡disp1 ¡¡¡¡¡¡¡¡¡¡¡¡¡¡; Ñ­»·
¡¡¡¡¡¡¡¡mov ¡¡¡¡ dl,0dh
¡¡¡¡¡¡¡¡call¡¡¡¡ dispchar ¡¡¡¡¡¡¡¡¡¡ ; ÏÔʾ»Ø³µ
¡¡¡¡¡¡¡¡mov ¡¡¡¡ dl,0ah
¡¡¡¡¡¡¡¡call¡¡¡¡ dispchar ¡¡¡¡¡¡¡¡¡¡ ; ÏÔʾ»»ÐÐ
¡¡¡¡¡¡¡¡ret
¡¡¡¡¡¡¡¡display¡¡endp

¡¡¡¡¡¡¡¡dispchar proc ¡¡¡¡¡¡ near
¡¡¡¡¡¡¡¡mov ¡¡¡¡ ah,2
¡¡¡¡¡¡¡¡int ¡¡¡¡ 21h
¡¡¡¡¡¡¡¡ret
¡¡¡¡¡¡¡¡dispchar endp
¡¡¡¡¡¡¡¡main ¡¡¡¡endp
prognam ends
end ¡¡¡¡start