微机原理课程设计_电子表显示_汇编课程设计|精品课程网站设计|课程设计网报告总结心得
data segment;*****定义please等提示信息*****str db 20db 50h,7,0,0db 6ch,7,0,1db 65h,7,0,1db 61h,7,0,1db 73h,7,0,1db 65h, 7,0,1db 70h,7,1,-10db 72h,7,0,1db 65h,7,0,1db 73h,7,0,1db 73h,7,0,1db 53h,7,0,2db 6bh,7,0,2db 65h,7,0,1db 79h,7,0,1db 65h,7,0,2db 78h,7,0,1db 69h,7,0,1db 74h,7,0,1db 21h,7,0,1;*****定义0-9十个图形数字*****s0 db 6db 5fh,7,0,0db 7ch,7,1,-1db 7ch,7,1,0db 5fh,7,0,1db 7ch,7,0,1db 7ch,7,-1,0sy db 2db 7ch,7,1,0db 7ch,7,1,0s2 db 5db 5fh,7,0,0db 7ch,7,1,1db 5fh,7,0,-1db 7ch,7,1,-1db 5fh,7,0,1s3 db 5db 5fh,7,0,0db 7ch,7,1,1db 5fh,7,0,-1db 7ch,7,1,1db 5fh,7,0,-1s4 db 4db 7ch,7,1,0db 5fh,7,0,1db 7ch,7,1,1db 7ch,7,-1,0s5 db 5db 5fh,7,0,0db 7ch,7,1,-1db 5fh,7,0,1db 7ch,7,1,1db 5fh,7,0,-1s6 db 6db 5fh,7,0,0db 7ch,7,1,-1db 5fh,7,0,1db 7ch,7,1,1db 5fh,7,0,-1db 7ch,7,0,-1s7 db 3db 5fh,7,0,0db 7ch,7,1,1db 7ch,7,1,0s8 db 7db 7ch,7,1,0db 5fh,7,-1,1db 7ch,7,1,1db 5fh,7,0,-1db 7ch,7,1,1db 5fh,7,0,-1db 7ch,7,0,-1s9 db 6db 7ch,7,1,0db 5fh,7,-1,1db 7ch,7,1,1db 5fh,7,0,-1db 7ch,7,1,1db 5fh,7,0,-1s11 db 2db 03h,7,1,0db 03h,7,1,0
data endsstack segmentdb 200 dup (0)stack endscode segmentassume cs:code,ss:stack,ds:data
start:mov ax,datamov ds,axmov ah,0 ;设置显示方式mov al,4int 10hmov ah,0bh ;置彩色调板mov bh,0mov bl,1int 10hmov ah,0bh ;置彩色调板mov bh,1mov bl,4int 10h
mov ah,2 ;取系统时间int 1ahmov ax,0mov bx,0mov ah,ch ;取系统时间mov al,cl ;保存分钟mov bh,dh ;保存秒mov bl,dl ;保存百分之一秒
tt:push axpush bxmov ah,0mov al,4int 10hmov ah,0bhmov bh,0mov bl,1int 10hmov ah,0bhmov bh,1mov bl,4int 10h
MOV AH,1 ;读键盘缓冲区字符INT 16hJZ wwMOV AH,8 ;从键盘输入字符INT 21hCMP AL,'s' ;输入s,结束程序JE tuww: pop bxpop ax
call xian ;调用显示子程序push ax
qu: mov ah,2 ;取系统时间int 1ahcmp bh,dhje qupop axinc bh ;对时间进行加1cmp bh,100jl ttmov bh,0inc alcall beepcmp al,100
jl ttmov al,0inc ahcmp ah,24jl ttmov ah,0
jmp tttu: mov ah,4chint 21hretxian proc ;对时间值进行处理并显示的子程序push sipush dipush dxpush cxpush bxpush axpop axpush axmov bx,axmov ax,0mov al,bh
mov cl,4shr al,clmov bl,almov dh,10mov dl,2call ffpop axpush axmov bx,axmov ax,0mov al, bhand al,0fhmov bl,almov dh,10mov dl,6call ffmov dh,10mov dl,10mov bl,10call ffpop axpush axmov cl,4shr al,clmov bl,almov dh,10mov dl,14call ffpop axpush axand al ,0fh
mov bl,almov dh,10mov dl,18call ffmov dh,10mov dl,22mov bl,10call ffpop axpop bxpush bxpush ax
mov ax,0mov al,bhmov cl,4shr al,cl
mov bl,almov dh,10mov dl,26call ffpop axpop bxpush bxpush axmov al,bhand al,0fh
mov bl,almov dh,10mov dl,30call ffmov dh,0mov dl,15mov bl,22call ffpop axpop bxpop cxpop dxpop dipop siretxian endpff proc ;显示具体数值push axpush bxpush cxpush dx
cmp bl,0je l0cmp bl,1je l1cmp bl,2je l2cmp bl,3je l3cmp bl,4je l4cmp bl,5je l5cmp bl,6je l6cmp bl,7je l7cmp bl,8je l8cmp bl,9je l9cmp bl,10je l10cmp bl,22je ldl0: lea di,s0jmp tyl1 : lea di,syjmp tyl2: lea di,s2jmp tyl3: lea di,s3jmp tyl4: lea di,s4jmp tyl5: lea di,s5jmp tyl6: lea di,s6jmp tyl7: lea di,s7jmp tyl8: lea di,s8jmp tyl9: lea di,s9jmp tyl10: lea di,s11jmp tyld : lea di,strty: mov ah,0fh ;示方式int 10hsub cx,cxmov cl,[di]inc diplot_next: add dh,[di+2]add dl,[di+3]mov ah,2int 10hmov al,[di]mov bl,[di+1]push cxmov cx,1mov ah,09int 10hpop cxadd di,4loop plot_next
pop dxpop cxpop bxpop axmov cx,100gg: dec cxloop gg
retff endpclear procpush axpush bxpush cxpush dxmov ah,6mov al,0mov bh,1int 10hpop dxpop cxpop bxpop axretclear endpbeep procpush axpush bxpush cxpush dxmov al ,10110110bout 43h,almov ax,533hout 42h,almov al,ahout 42h,alin al,61hmov ah,alor al,03out 61h,alsub cx,cxmov bl,28hg7: loop g7dec bljnz g7mov al,ahout 61h,alpop dxpop cxpop bxpop ax
retbeep endp
code endsend start