王爽汇编——实验十四

这是个一直循环,一直刷新的代码

assume cs:code,ds:data
data segment
  db '00/00/00 00:00:00','$'
  db 9,8,7,4,2,0
data ends
code segment
 start:
        ;初始化一些数据
       mov ax,data
       mov ds,ax
       mov si,0
       mov cx,6
       mov bx,18

        ;循环取出时间放入data
   s1: push cx
       mov ax,[bx]
       out 70h,al
       in al,71h

       mov ah,al
       mov cl,4
       shr al,cl
       add al,30h
       and ah,00001111b
       add ah,30h

       mov ds:[si],ax       ;注意别前后颠倒

       inc bx
       add si,3
       pop cx
       loop s1
       
        ;白嫖系统自带的定位光标
       mov ah,2
       mov bh,0
       mov dh,12
       mov dl,40
       int 10h

        ;输出
       mov ax,data
       mov ds,ax
       mov dx,0
       mov ah,9
       int 21h
    
       jmp short start              

       mov ax,4c00h
       int 21h
code ends
end start

猜你喜欢

转载自blog.csdn.net/aixiaoxiao13/article/details/120580140