微机原理课程设计_钟表显示_汇编课程设计|精品课程网站设计|课程设计网报告总结心得
extrn music:far,gensound:far;******************************************************;* 堆栈段.286;******************************************************STACK_SEG SEGMENT STACKSTACK_BUF DW 120 DUP(?)TOP EQU $-STACK_BUFSTACK_SEG ENDS;******************************************************;* 数据段;******************************************************DATA_SEG SEGMENT PARA;------------------------------------------------------; TODO: 数据的定义及存储器的分配ts1 DB 0quitbuf DB 'welcome you to run this programme. 'quitbuf2 DB 'C: change color; B:extend the colck; S:reduce the clock 'quitbuf3 DB 'press e to sound; Press q to quit ! 'sigle DB 80habsx DW 0absy DW 0sut DW 0erroybz DB 0r0 DW 90x0 DW 320y0 DW 245
count0 db 0count_hour DB 11count_minute DB 11yuanxinx DW 0yuanxiny DW 0
s DB 0s2 DB 0s3 DB 0hour DW 0hour2 DW 0minute DW 0minute2 DW 0second DB 0second2 DB 0sin_x DW 0sin_xx DW 0x DW 0y DW 0x1 DW 0
xminy DW 0yminx DW 0xmax DW 0ymax DW 0ymin DW 0xmin DW 0sjx_xminy DW 0sjx_yminx DW 0sjx_xmax DW 0sjx_ymax DW 0sjx_ymin DW 0sjx_xmin DW 0yuanx DW 0yuany DW 0y1 DW 0x2 DW 0y2 DW 0x3 DW 0y3 DW 0DIancolor DB 0color DB 2color_hour DB 2color_min DB 6color_second DB 9color4 DB 10color5 DB 11color6 DB 12backgroundcolor DB 1page1 DB 0y2y1 DW 0x2x1 DW 0sjx_y2y1 DW 0sjx_x2x1 DW 0
;------------------------------------------------------
DATA_SEG ENDS;******************************************************;* 代码段;******************************************************CODE_SEG SEGMENT PARA;------------------------------------------------------MAIN PROC FARASSUME CS:CODE_SEG,DS:DATA_SEGASSUME SS:STACK_SEGSTART:MOV AX,STACK_SEGMOV SS,AXMOV SP,TOPMOV AX,DATA_SEGMOV DS,AX;------------------------------------------------------; TODO: 从这里开始您的代码;------------------------------------------------------beg: MOV AX,0012hINT 10hMOV DX,0010hCALL b1002LEA BP,quitbufCALL msgMOV DX,010ahLEA BP,quitbuf2CALL msgMOV DX,020ahLEA BP,quitbuf3CALL msg
beg2: CALL skinCALL skin2CALL skin3CALL CLkMOV second,DHMOV second2,DHMOV count_minute,11CALL minute_linXOR DX,DXMOV AX,minute2MOV CX,12DIV CXMOV CX,AX ;minurte2/12POP AXADD AX,CXMOV hour2,AXMOV count_hour,11CALL hour_linCALL CLkMOV DL,DHCALL bcd2XOR AH,AHMOV CL,12DIV CLMOV count_minute,AH ;second%12初始值DEC count_minute
XOR DX,DXMOV AX,minute2MOV CX,12DIV CX ;minurte2%12MOV count_hour,DLDEC count_hourINC second2kk3: CLICALL second_linSTIJMP ks
ks: MOV AH,1INT 16hJZ kk3MOV AH,8INT 21hCMP AL,'q'JE quitCMP AL,'b'JE CHange_rbCMP AL,'s'JE CHange_rsCMP AL,'c'JE CHange_colorcmp al,'e'je a0JMP kk3
CHange_rs: CMP r0,190JA ksADD r0,5
JMP tobeg2CHange_rb: CMP r0,60JB ksSUB r0,5
JMP tobeg2CHange_color: LEA SI,color_hourMOV CX,6CHange_kk1: MOV AL, [SI]INC ALCMP AL,15JC CHange_color_kk2MOV AL,1CHange_color_kk2:MOV [SI],ALINC SILOOP CHange_kk1JMP tobeg2a0: call musiccall musiccall musictobeg2: CALL CLearJMP beg2quit: MOV AX,4C00HINT 21H;*************************************
hour_lin PROC NEARPUSHaCMP count_hour,11JB tohour_ylJMP hour_lin_nexttohour_yl: MOV SIgle,3JMP hour_ylhour_lin_next:MOV count_hour,0MOV SIgle,5CALL CLkMOV DL,CHCALL bcd2CMP AL,12JB hour_kk1SUB AL,12hour_kk1: MOV CL,30MUL CLPUSH AXXOR DX,DXMOV AX,minute2MOV CX,12DIV CXMOV CX,AX ;minurte2/12POP AXADD AX,CX
MOV hour2,AX;擦掉MOV Color,0MOV AX,hourMOV BX,r0ADD BX,20CALL renovate
MOV DX,yuanxMOV x3,DXMOV DX,yuanyMOV y3,DXADD AX,270ADD BX,400 ;90
CALL renovate
MOV DX,yuanx ;擦掉MOV x2,DXMOV DX,yuanyMOV y2,DX
MOV DX,x0MOV x1,DXMOV DX,y0 ;擦掉MOV y1,DXCALL sjx
ADD AX,180CALL renovateMOV DX,yuanx ;擦掉MOV x2,DXMOV DX,yuanyMOV y2,DX
SUB BX,100CALL renovateMOV DX,yuanxMOV x3,DXMOV DX,yuanyMOV y3,DX ;擦掉CALL sjx
MOV SIgle,4
;***************************;; ;重写hour_yl: MOV AL,color_hourMOV color,ALMOV AX,hour2MOV BX,r0ADD BX,70CALL renovate
MOV DX,yuanxMOV x3,DXMOV DX,yuanyMOV y3,DXADD AX,90ADD BX,600 ;90
CALL renovate
MOV DX,yuanxMOV x2,DXMOV DX,yuanyMOV y2,DX ;重写
ADD AX,180
CALL renovate
MOV DX,yuanxMOV x1,DXMOV DX,yuanyMOV y1,DXCALL sjxxCALL sjxy
ADD AX,270SUB BX,100CALL renovateMOV DX,yuanxMOV x3,DX ;重写MOV DX,yuanyMOV y3,DXCALL sjxCALL sjxxCALL sjxy
MOV CX,hour2MOV hour,CXhour_quit: POPaREThour_lin ENDP
;********************************
minute_lin PROC NEARPUSHaCMP count_minute,11JB tominute_yl ;仍是原来的一个JMP minute_lin_nexttominute_yl: MOV SIgle,0JMP minute_ylminute_lin_next:INC count_hourCALL CLkMOV DL,CLCALL bcd2 ;bcd->16MOV CL,6MUL CL ;al*clPUSH AXMOV DL,second2CALL bcd2XOR AH,AHMOV CL,12DIV CLMOV CL,AL ;second2/12POP AXMOV CH,0ADD AX,CX
MOV minute2,AX
AAAa1:
MOV SIgle,2MOV Color,0MOV AX,minuteMOV BX,r0ADD BX,10CALL renovate
MOV DX,yuanxMOV x3,DXMOV DX,yuanyMOV y3,DXADD AX,268ADD BX,800 ;90
CALL renovate
MOV DX,yuanxMOV x2,DXMOV DX,yuanyMOV y2,DX
MOV DX,x0MOV x1,DXMOV DX,y0MOV y1,DXCALL sjx
ADD AX,180CALL renovate
MOV DX,yuanxMOV x2,DXMOV DX,yuanyMOV y2,DX
ADD AX,90SUB BX,200CALL renovateMOV DX,yuanxMOV x3,DXMOV DX,yuanyMOV y3,DXCALL sjxinc count0cmp count0,5jnz minute_ylmov count0,0call musiccall musiccall music;**********************************重写
minute_yl: MOV sigle,1MOV AL,color_minMOV color,ALMOV AX,minute2MOV BX,r0ADD BX,30CALL renovate
MOV DX,yuanxMOV x3,DXMOV DX,yuanyMOV y3,DXADD AX,90ADD BX,900 ;90
CALL renovate
MOV DX,yuanxMOV x2,DXMOV DX,yuanyMOV y2,DX
ADD AX,180CALL renovate
MOV DX,yuanxMOV x1,DXMOV DX,yuanyMOV y1,DXCALL sjxxCALL sjxy
ADD AX,270SUB BX,200CALL renovateMOV DX,yuanxMOV x3,DXMOV DX,yuanyMOV y3,DXCALL sjxxCALL sjxy
MOV CX,minute2MOV minute,CXCALL hour_lin
minute_kk1:minute_quit: POPaRETminute_lin ENDP
;******************in dh秒数*********************second_lin PROC NEARPUSHaCALL CLkCMP second2,DHJE to_second_quitJMP second_lin_nextto_second_quit:JMP second_quitsecond_lin_next:
MOV SIgle,80hMOV second2,DHMOV Color,0MOV DL,second ;eraseCALL bcd2MOV AH,0MOV CL,6MUL CLMOV BX,r0ADD BX,10CALL renovate
MOV DX,yuanxMOV x1,DXMOV DX,yuanyMOV y1,DXADD AX,180ADD BX,300
CALL renovate
MOV DX,yuanxMOV x2,DXMOV DX,yuanyMOV y2,DXCALL linexCALL liney
;重写MOV SIgle,80hMOV AL,color_secondMOV color,ALMOV DL,second2CALL bcd2MOV AH,0MOV CL,6MUL CL
MOV BX,r0ADD BX,10CALL renovateMOV DX,yuanxMOV x1,DXMOV DX,yuanyMOV y1,DX
ADD AX,180ADD BX, 300CALL renovate
MOV DX,yuanxMOV x2,DXMOV DX,yuanyMOV y2,DXCALL linexCALL liney
CALL yuanxinMOV DL,second2MOV second,DLCALL minute_linCALL skin2MOV CL,second2MOV second,CL
CMP count_minute,11JE second_kk1INC count_minuteJMP second_quitsecond_kk1: MOV count_minute,0second_quit: POPaRETsecond_lin ENDP
;******bxbbx*********in ax度数***bx长度,*********;OUT x2->ax,y2->dx ;**renovate PROC NEARPUSHaADD AX,270PUSH AXCALL SInMOV DX,0MOV CX,BXDIV CXCMP SI,1JE hjianADD AX,y0JMP renovate_kk1hjian: MOV CX,y0SUB CX,AXMOV AX,CXrenovate_kk1: MOV yuany,AXPOP AXCALL cos
MOV DX,0MOV CX,BXDIV CXCMP SI,1JE hjian2ADD AX,x0JMP renovate_kk2hjian2: MOV CX,x0SUB CX,AXMOV AX,CXrenovate_kk2: MOV yuanx,AXPOPaRETrenovate ENDP;**************************Clk PROCMOV AH,2INT 1ahRETCLk ENDP
;*****************cosx in ax out ax ,si符号******************cos PROC NEAR
ADD AX,90cos_kk1: CALL SInRETcos ENDP;*********Sinx in ax out ax ,si符号*******************************SIn PROC NEAR ;out ax
PUSH CXPUSH DXPUSH BXsin360: CMP AX,90JA dy90sto0_90: MOV SI,0JMP pp1dy90: CMP AX,180JBE z91to180JMP dy180z91to180: MOV CX,180SUB CX,AXMOV AX,CXMOV SI,0JMP pp1z181to270: SUB AX,180MOV SI,1JMP pp1z271to360: CMP AX,359JA zdy359MOV CX,360SUB CX,AXMOV AX,CXMOV SI,1JMP pp1zdy359: SUB AX,360JMP SIn360
dy180: CMP AX,270JBE z181to270JMP z271to360
pp1: MOV CX,175XOR DX,DXMUL CXMOV sin_x,AXXOR DX,DXMOV CX,AXMUL CXMOV CX,10000DIV CXMOV sin_xx,AXXOR DX,DXMOV CX,120DIV CXMOV BX,1677;1667CALL SUBabMOV CX,sin_xxXOR DX,DXMUL CXMOV CX,10000DIV CX ;xx(xx/120-10000/6)MOV CX,10000MOV DL,0CMP DL,sJE jiaSUB CX,AXMOV AX,CXJMP kk1jia: ADD AX,CXkk1: MOV CX,sin_xXOR DX,DXMUL CXMOV CX,10000DIV CXPOP BXPOP DXPOP CXMOV s,0RETSIn ENDP
;**************;绝对值在ax中符号在S中ax-bx*****s要定义db*************subab PROCCMP AX,BXJAE goabXOR s,1XCHG AX,BXgoab:SUB AX,BXRETsubab ENDP
;***************************linex***y=(y2-y1)*(x-x1)/(x2-x1)+y1;****in (x1,y1),(x2,y2)******************x++linex PROC NEARPUSH x1PUSH x2PUSH y1PUSH y2pusha
CALL xymaxminMOV AX,y2MOV BX,y1CALL subabMOV y2y1,AXMOV AX,x2MOV BX,x1CALL subabMOV SI,0CMP SI,AXJE zhixianJMP lopxzhixian: JMP zhixianxslopx: MOV x2x1,AXMOV AX,xminMOV x,AXline0x: SUB AX,xminMOV DX,0MOV CX,y2y1MUL CXMOV CX,x2x1DIV CXMOV DX,0CMP DL,s
JE zhengxMOV CX,AXMOV AX,xminySUB AX,CXJMP kk2xzhengx: ADD AX,xminykk2x: MOV y,AXCALL DIan
INC xMOV AX,xCMP AX,xmaxJBE line0xJMP quit12
zhixianxs: MOV AX,xminMOV x,AXMOV AX,yminMOV y,AXlopxx: CALL DIan
INC yMOV AX,ymaxCMP AX,yJAE lopxxquit12: MOV s,0POPaPOP y2POP y1POP x2POP x1RETlinex ENDP
;**************************liney x=(x2-x1)(y-y1)/(y2-y1)+x1;*****************y++
sjx PROC NEARPUSH x1PUSH x2PUSH y1PUSH y2pushaCALL xymaxminMOV AX,y2MOV BX,y1CALL subabMOV y2y1,AXMOV SI,0CMP SI,AXJE to_sjxxsjx_lop1: MOV AX,x2MOV BX,x1CALL subabMOV x2x1,AXMOV SI,0CMP SI,AXJE to_sjxyMOV DX,0MOV AX,y2y1MOV CX,x2x1DIV CXCMP AX,1JE to_sjxxCMP AX,0JE to_sjxxJMP to_sjxyto_sjxx: MOV s,0CALL sjxxJMP sjx_quitto_sjxy: MOV s,0CALL sjxysjx_quit: POPaPOP y2POP y1POP x2POP x1MOV s,0RETsjx ENDP
liney PROC NEARPUSH x1PUSH x2PUSH y1PUSH y2pushaCALL xymaxminMOV AX,y2MOV BX,y1CALL subabMOV y2y1,AXMOV SI,0CMP SI,AXJE hengJMP lop1heng: JMP hengxianlop1: MOV AX,x2MOV BX,x1CALL subabMOV x2x1,AXMOV AX,yminMOV y,AX
line0y: SUB AX,yminMOV DX,0MOV CX,x2x1MUL CXMOV CX,y2y1DIV CXMOV DX,0CMP DL,sJE zhengyMOV CX,AXMOV AX,yminxSUB AX,CXJMP kkyzhengy: ADD AX,yminxkky: MOV x,AX
CALL DIanINC yMOV AX,yCMP AX,ymaxJBE line0yJMP quityhengxian: MOV AX,yminMOV y,AXMOV AX,xminMOV x,AXlopy: CALL DIanINC xMOV AX,xmaxCMP AX,xJAE lopy
quity: MOV s,0POPaPOP y2POP y1POP x2POP x1RETliney ENDP
;***************************linex***y=(y2-y1)*(x-x1)/(x2-x1)+y1;****in (x1,y1),(x2,y2)******************x++sjxx PROC NEARpushaPUSH x1PUSH x2PUSH x3PUSH y1PUSH y2PUSH y3
CALL xymaxminMOV AX,xminMOV sjx_xmin,AXMOV AX,yminMOV sjx_ymin,AXMOV AX,xmaxMOV sjx_xmax,AXMOV AX,ymaxMOV sjx_ymax,AXMOV AX,xminyMOV sjx_xminy,AX
MOV AX,y2MOV BX,y1CALL subabMOV sjx_y2y1,AXMOV AX,x2MOV BX,x1CALL subabMOV DL,sMOV s2,DLMOV s,0MOV SI,0CMP SI,AXJE sjx_zhixianJMP sjx_lopxsjx_zhixian:MOV x1,AXMOV AX,x3MOV x2,AXMOV AX,y3MOV y2,AXJMP sjx_zhixianxssjx_lopx: MOV sjx_x2x1,AXMOV AX,x3MOV x2,AXMOV AX,y3MOV y2,AXMOV AX,sjx_xminMOV x1,AX
sjx_line0x: SUB AX,sjx_xminMOV DX,0 ;***y=(y2-y1)*(x-x1)/(x2-x1)+y1MOV CX,sjx_y2y1MUL CXMOV CX,sjx_x2x1DIV CXMOV DX,0CMP DL,s2JE sjx_zhengxMOV CX,AXMOV AX,sjx_xminySUB AX,CXJMP sjx_kk2sjx_zhengx:ADD AX,sjx_xminysjx_kk2:MOV y1,AXCALL linexCALL lineyINC x1MOV AX,x1CMP AX,sjx_xmaxJBE sjx_line0xJMP sjx_quit12
sjx_zhixianxs: MOV AX,sjx_xminMOV x1,AXMOV AX,sjx_yminMOV y1,AXsjx_lopxx:CALL linexCALL lineyINC y1MOV AX,sjx_ymaxCMP AX,y1JAE sjx_lopxxsjx_quit12: MOV s,0POP y3POP y2POP y1POP x3POP x2POP x1POPaRETsjxx ENDP
;**************************liney x=(x2-x1)(y-y1)/(y2-y1)+x1;*****************y++
sjxy PROC NEARPUSH x1PUSH x2PUSH x3PUSH y1PUSH y2PUSH y3pushaCALL xymaxminMOV AX,xminMOV sjx_xmin,AXMOV AX,yminMOV sjx_ymin,AXMOV AX,xmaxMOV sjx_xmax,AXMOV AX,ymaxMOV sjx_ymax,AXMOV AX,yminxMOV sjx_yminx,AXMOV AX,y2MOV BX,y1CALL subabMOV sjx_y2y1,AXMOV SI,0CMP SI,AXJE sjxy_hengJMP sjxy_lop1sjxy_heng:MOV DL,sMOV s2,DLMOV s,0MOV AX,x3MOV x2,AXMOV AX,y3MOV y2,AXJMP sjxy_hengxiansjxy_lop1: MOV AX,x2MOV BX,x1 ;x=(x2-x1)(y-y1)/(y2-y1)+x1CALL subabMOV DL,sMOV s2,DLMOV s,0MOV sjx_x2x1,AXMOV AX,x3MOV x2,AXMOV AX,y3MOV y2,AXMOV AX,sjx_yminMOV y1,AX
sjxy_line0y: SUB AX,sjx_yminMOV DX,0MOV CX,sjx_x2x1MUL CXMOV CX,sjx_y2y1DIV CXMOV DX,0CMP DL,s2JE sjxy_zhengyMOV CX,AXMOV AX,sjx_yminxSUB AX,CXJMP sjxy_kky3sjxy_zhengy:ADD AX,sjx_yminxsjxy_kky3:MOV x1,AXCALL linex
CALL lineyINC y1MOV AX,y1CMP AX,sjx_ymaxJBE sjxy_line0yJMP sjxy_quitysjxy_hengxian: MOV AX,sjx_yminMOV y1,AXMOV AX,sjx_xminMOV x1,AXsjxy_lopy: CALL lineyCALL linexINC x1MOV AX,sjx_xmaxCMP AX,x1JAE sjxy_lopy
sjxy_quity: MOV s,0POPaPOP y3POP y2POP y1POP x3POP x2POP x1RETsjxy ENDP
;xymaxmin PROC NEARPUSHaPUSH x1PUSH x2PUSH y1PUSH y2MOV AX,x1CMP AX,x2JAE x1dyx2MOV xmin,AX ;x1
DIan PROC NEAR ;画一点x,yPUSHaMOV AH,sMOV s3,AHMOV AH,SIgleAND AH,80hCMP AH,0JE puanduanpaint:MOV AL,colorMOV BH,page1MOV DX,yMOV CX,x ;列号MOV AH,0chINT 10hJMP DIanquitpuanduan:CALL readerdianMOV DIancolor,ALMOV AH,SIgle
AND AH,7fhCMP AH,0JE NEw0CMP AH,1JE NEw1CMP AH,2JE NEw2CMP AH,3JE NEw3CMP AH,4JE NEw4CMP AH,5JE NEw5CMP AH,6JE NEw6JMP DIanquit
NEw0: CMP DIancolor,0JE topaintJMP DIanquitNEw1: CMP DIancolor,0JE topaintMOV AH,color_hourCMP DIancolor,AHJE topaintJMP DIanquittopaint: JMP paint
NEw2: MOV AH,color_minCMP DIancolor, AHJE topaintJMP DIanquitNEw3: JMP NEw0NEw4: JMP NEw0NEw5: MOV AH,color_hourCMP DIancolor,AHJE topaintJMP DIanquitNEw6: CMP DIancolor,0JE topaintJMP DIanquitMOV AX,xMOV BX,x0CALL SUBabCMP AX,5JA topaintMOV AX,yMOV BX,y0CALL SUBabCMP AX,5JA topaint
DIanquit: MOV AH,s3MOV s,AHPOPaRETDIan ENDP
yuanxin PROCMOV AL,color_secondADD AL,1MOV BH,PAGE1MOV DX,y0MOV CX,x0MOV AH,0chINT 10hDEC DXMOV AH,0chINT 10hDEC CXMOV AH,0chINT 10hINC DXMOV AH,0chINT 10hINC DXMOV AH,0chINT 10hINC CXMOV AH,0chINT 10hINC CXMOV AH,0chINT 10hSUB DX,1MOV AH,0chINT 10hDEC DXMOV AH,0chINT 10h
RETyuanxin ENDP
readerdian PROCMOV BH,page1MOV DX,yMOV CX,x ;列号MOV AH,0dhINT 10hRETreaderdian ENDP
b1002 PROC NEAR ;入口DX-光标定位MOV BH,0MOV AH,02hINT 10hRETb1002 ENDP
CLear PROCMOV DX,0410hCALL b1002MOV CX,6000MOV BH,PAGE1MOV AL,' 'MOV AH,0ahINT 10hRETCLear ENDP
; 12根******************************skin2 PROCPUSHaMOV AL,color6MOV color,AL
MOV CX,12MOV AX,0skin2_kk1: PUSH CX
PUSH AXMOV BX,r0MOV CX,y0MOV DX,x0
CALL enovateMOV AX,xMOV x1,AXMOV AX,yMOV y1,AXPOP AXPUSH AX
MOV BX,r0ADD BX,10MOV CX,y0MOV DX,x0
CALL enovateMOV AX,xMOV x2,AXMOV AX,yMOV y2,AXCALL linexCALL lineyPOP AXADD AX,30
POP CXLOOP skin2_kk1MOV CX,4MOV AX,0skin2_kk2: PUSH CX
PUSH AXMOV BX,r0MOV CX,y0MOV DX,x0
CALL enovateMOV AX,xMOV x1,AXMOV AX,yMOV y1,AXPOP AXPUSH AX
MOV BX,r0ADD BX,20MOV CX,y0MOV DX,x0
CALL enovateMOV AX,xMOV x2,AXMOV AX,yMOV y2,AXCALL linexCALL lineyPOP AXADD AX,90
POP CXLOOP skin2_kk2
POPaRETskin2 ENDP;60根**********************************88
skin3 PROCPUSHaMOV AL,color5MOV color,ALMOV CX,60MOV AX,0skin2_kk3: PUSH CX
PUSH AXMOV BX,r0MOV CX,y0MOV DX,x0
CALL enovateMOV AX,xMOV x1,AXMOV AX,yMOV y1,AXPOP AXPUSH AX
MOV BX,r0ADD BX,3MOV CX,y0MOV DX,x0
CALL enovateMOV AX,xMOV x2,AXMOV AX,yMOV y2,AXCALL linexCALL lineyPOP AXADD AX,6
POP CXLOOP skin2_kk3POPaRETskin3 ENDP
;数字加圆**************************************88skin PROC NEARMOV AL,color4MOV color,ALMOV BX,r0CALL yuanMOV BX,r0MOV DH,7MOV DL,39CALL b1002MOV DL,'1'MOV AH,2INT 21hMOV DH,7MOV DL,40CALL b1002MOV DL,'2'MOV AH,2INT 21h
MOV DH,8MOV DL,47CALL b1002MOV DL,'1'MOV AH,2INT 21h
MOV DH,11MOV DL,53CALL b1002MOV DL,'2'MOV AH,2INT 21h
MOV DH,19MOV DL,53CALL b1002MOV DL,'4'MOV AH,2INT 21h
MOV DH,22MOV DL,47CALL b1002MOV DL,'5'MOV AH,2INT 21h
MOV DH,22MOV DL,32CALL b1002MOV DL,'7'MOV AH,2INT 21h
MOV DH,19MOV DL,26CALL b1002MOV DL,'8'MOV AH,2INT 21h
MOV DH,11MOV DL,25CALL b1002MOV DL,'1'MOV AH,2INT 21hMOV DH,11MOV DL,26CALL b1002MOV DL,'0'MOV AH,2INT 21h
MOV DH,8MOV DL,30CALL b1002MOV DL,'1'MOV AH,2INT 21hMOV DH,8MOV DL,31CALL b1002MOV DL,'1'MOV AH,2INT 21h
MOV DH,15MOV DL,55CALL b1002MOV DL,'3'MOV AH,2INT 21hMOV DH,23MOV DL,40CALL b1002MOV DL,'6'MOV AH,2INT 21hMOV DH,15MOV DL,24CALL b1002MOV DL,'9'MOV AH,2INT 21hRET
skin ENDP
msg PROC NEAR ;in bp为输出字符串地址PUSH ESPUSH DSPOP ESMOV CX,40hMOV AL,0MOV BX,2MOV AH,13hINT 10hPOP ESRETmsg ENDP
;*****************in dl out albcd2 PROC NEARMOV AH,0MOV AL,DLSHR AL,4AND AL,0fhMOV CL,10MUL CLMOV CL,ALMOV AL,DLAND AL,0fhADD AL,CL;;;;; bcd转16进制RETbcd2 ENDP
;r0=bx 圆心cx 行 dx列********************yuan PROCPUSHaMOV CX,360MOV AX,0yuan_kk1: PUSH CXPUSH AXMOV CX,y0MOV DX,x0CALL enovateCALL dianPOP AXADD AX,1POP CXLOOP yuan_kk1
POPaRETyuan ENDP
;*****************in ax度数 bx=半径r长度,cx 列 dx行 圆心 out x,y************enovate PROC NEARPUSHaPUSH DXPUSH AXPUSH CXCALL SInMOV DX,0MOV CX,BXDIV CXPOP CXCMP SI,1JE ian
ADD AX,CXJMP enovate_kk1ian: SUB CX,AXMOV AX,CXenovate_kk1: MOV y,AXPOP AXCALL cosMOV DX,0MOV CX,BXDIV CXPOP DXCMP SI,1JE ian2ADD AX,DXJMP enovate_kk2ian2: MOV CX,DXSUB CX,AXMOV AX,CXenovate_kk2: MOV x,AXPOPaRETenovate ENDP
MAIN ENDP;------------------------------------------------------CODE_SEG ENDS;******************************************************END START ;程序结束 微机原理课程设计_钟表显示