|
发表于 2011-10-11 21:11:49
|
显示全部楼层
- assume cs:code
-
- ds1 segment
- db '/',':'
- ds1 ends
-
- code segment
- start:
- mov si,160*12+40*2
- mov ax,0b800h
- mov es,ax
-
- mov ax,ds1
- mov ds,ax
-
- mov bx,0
- mov cx,3
- mov al,9
-
- ;取日期
- call s
-
- mov al,4
-
- mov cx,3
-
- call s1
-
- mov ah,1
-
- int 21h
-
- mov ax,4c00h
-
- int 21h
-
- s: push cx
- push ax
- 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 es:[si].0,ah
- mov es:[si].2,al
-
- pop ax
- add si,6
- dec al
- pop cx
- dec cx
-
- jcxz s_end
-
- jmp s
-
- s_end:
- mov al,ds:[bx]
-
- ;因为直接写入显存中,一个字符占两个字节。
- ;y y / m m / d d
- ;01 23 45 67 89 AB CD EF
- mov es:[si-14],al
- mov es:[si-8],al
- ;这里用ax相当于把“/”的高位也传进显存中。“/”的颜色受ah影响
- ret
-
- s1:
- push cx
- push ax
-
- 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 es:[si].0,ah
- mov es:[si].2,al
-
- pop ax
- add si,6
-
- sub al,2
-
- pop cx
-
- dec cx
-
- jcxz s1end
-
- jmp s1
-
- s1end:
- mov al,ds:[bx+1]
- mov es:[si-14],al
- mov es:[si-10].2,al
- ret
- code ends
- end start
复制代码 修改好了,你自己对比吧! |
|