汇编网首页登录博客注册
fenglixin70953的学习博客
博客首页博客互动【做检测题】论坛求助

我的博客

个人首页 |  我的文章 |  我的相册 |  我的好友 |  最新访客 |  文章收藏 |  论坛提问 |  友情链接 |  给我留言  

[2008-04-16 22:56] 实验14显示时间

assume cs:code
code segment
 s: db 9,8,7,4,2,0
 start:mov ax,cs
       mov ds,ax
       mov si,offset s
       mov di,0
       mov cx,6
       
    s1:push cx              
       mov al,[si]
       out 70h,al
       in  al,71h
       mov ah,al
       mov cl,4
       shr ah,cl
       and al,0fh
       add ah,30h
       add al,30h
              
       mov bx,0b800h
       mov es,bx
       mov byte ptr es:[160*12+36*2+di],ah
       add di,2
       mov byte ptr es:[160*12+36*2+di],al
       add di,2
       
       cmp byte ptr [si],7
       ja s4                        ;[si]>7
       je s2                        ;[si]=7 
       cmp byte ptr [si],0
       ja s3                         ;[si]>0
    s2:mov dl,0                      ;[si]=0
       jmp short s5
    s3:mov dl,3ah
       jmp short s5
    s4:mov dl,2fh
    s5:mov byte ptr es:[160*12+36*2+di],dl
       add di,2
       inc si
       pop cx
       loop s1
     
       mov ax,4c00h
       int 21h
code ends
end start      
       
刚开始push cx忘 了,add ah,30h也没写,结果弄得满屏方块哈
评论次数(3)  |  浏览次数(547)  |  类型(作业) |  收藏此文  | 

[  wdm   发表于  2008-04-17 10:25  ]

程序OK。
有时候看到那些莫名的界面,感觉还挺兴奋呢。呵呵

[  hychewei   发表于  2008-04-23 22:23  ]

看不懂!!能讲讲不?还有为什么没有那么伪代码?

[  fenglixin70953   发表于  2008-09-28 09:54  ]

assume cs:code ;实验14,显示当前日期,时间
code segment
     list: db 9,8,7,4,2,0
     list2: db '// :: '
     

    start: mov ax,0b800h
           mov es,ax
           mov ax,cs
           mov ds,ax
           mov si,offset list
           mov di,offset list2
           mov bx,160*24+40*2
           mov cx,6
         s:push cx
           mov al,[si]
           out 70h,al
           in al,71h
           mov ah,al
           mov cl,4
           shr ah,cl
           add ah,30h
           and al,00001111b
           add al,30h
           mov byte ptr es:[bx],ah
           mov byte ptr es:[bx+2],al
           mov dl,[di]
           mov byte ptr es:[bx+4],dl
           add bx,6
           inc si
           inc di
           pop cx
           loop s
           
           call delay
            
            in al,60h
            cmp al,10h
            je ok
            jmp start
                   
          ok: mov ax,4c00h
            int 21h
            
    delay:push ax
          push dx
          mov dx,1000h
          mov ax,0
        s5:sub ax,1
          sbb dx,0
          cmp ax,0
          jne s5
          cmp dx,0
          jne s5
          pop dx
          pop ax
          ret
         
            
            code ends
            end start

 
 请输入验证码  (提示:点击验证码输入框,以获取验证码