输出年月日 时分秒
assume cs:code , ds:data
data segment
db 0
data ends
code segment
start:
mov ax,data
mov ds,ax
mov cx,3
mov di,100
mov bl,0
mov ah,0
mov byte ptr ds:[0],0
st1:
mov al,bl
out 70h,al
in al,71h
call showptr
sub di,2
add bl,2
add byte ptr ds:[0],1
loop st1
mov cx,3
mov bl,7
st2:mov al,bl
out 70h,al
in al,71h
call showptr
sub di,2
add bl,1
add byte ptr ds:[0],1
loop st2
jmp start
mov ax,4c00h
int 21h
showptr:
push cx
push bx
mov bx,0b800h
mov es,bx
s:
mov dl,al
and dl,0fh
add dl,30h
mov dh,02h
mov word ptr es:[160*12+di],dx
sub di,2
shr al,4
mov dl,al
and dl,0fh
add dl,30h
mov dh,02h
mov word ptr es:[160*12+di],dx
;mov byte ptr ds:[160*24+si+1],02h
sub di,2h
mov bh,02h
mov bl,0h
cmp byte ptr ds:[0],2
je outp
cmp byte ptr ds:[0],5
je outp
cmp byte ptr ds:[0],2
jnb tp2
mov bl,':'
jmp outp
tp2:mov bl,'/'
outp:mov word ptr es:[160*12+di],bx
e:pop bx
pop cx
ret
code ends
end start