MIX 发表于 2018-2-14 13:01:30

为什么只有8个数字???

assume cs:code,ss:stack

stack segment
        db 10h dup (0)
stack ends

code segment
        start:        mov al, 9
                        mov bx, 0b878h
                        mov es, bx
                        mov bx, 0
                        mov cx, 3
       
        s1:                push cx                        ;年月日的输出
                        mov dl, al
                        out 70h, al
                        in al, 71h
                        mov ah, al
                        mov cl, 4
                        shr ah, cl
                        and al, 00001111b
                        add ah, 30h
                        add al, 30h
                        mov byte ptr es:, ah
                        mov byte ptr es:, al
                        mov al, dl
                        dec al
                        add bx, 2
                        pop cx
                        loop s1
                       
                        mov al, 4
                        mov bx, 12
                        mov cx, 3
               
        s2:                push cx                                        ;时分秒的输出
                        mov dl, al
                        out 70h, al
                        in al, 71h
                        mov ah, al
                        mov cl, 4
                        shr ah, cl
                        and al, 00001111b
                        add ah, 30h
                        add al, 30h
                        mov byte ptr es:, ah
                        mov byte ptr es:, al
                        mov al, al
                        sub al, 2
                        add bx, 2
                        pop cx
                        loop s2
                       
                        mov ax, 4c00h
                        int 21h
code ends
end start
                       
                       
                       
                       
                       
                       
                       

人造人 发表于 2018-2-14 20:39:22

assume cs:code,ss:stack

stack segment
      db 10h dup (0)
stack ends

code segment
      start:      mov al, 9
                        mov bx, 0b878h
                        mov es, bx
                        mov bx, 0
                        mov cx, 3
      
      s1:                push cx                        ;年月日的输出
                        mov dl, al
                        out 70h, al
                        in al, 71h
                        mov ah, al
                        mov cl, 4
                        shr ah, cl
                        and al, 00001111b
                        add ah, 30h
                        add al, 30h
                        mov byte ptr es:, ah
                        mov byte ptr es:, al
                        mov al, dl
                        dec al
                        add bx, 2
                        pop cx
                        loop s1
                        
                        mov al, 4
                        mov bx, 12
                        mov cx, 3
               
      s2:                push cx                                        ;时分秒的输出
                        mov dl, al
                        out 70h, al
                        in al, 71h
                        mov ah, al
                        mov cl, 4
                        shr ah, cl
                        and al, 00001111b
                        add ah, 30h
                        add al, 30h
                        mov byte ptr es:, ah
                        mov byte ptr es:, al
                        mov al, al
                        sub al, 2
                      add bx, 2 ; add bx, 4
                        pop cx
                        loop s2
                        
                        mov ax, 4c00h
                        int 21h
code ends
end start
页: [1]
查看完整版本: 为什么只有8个数字???