assume cs:code
code segment
start:
mov ax,0b800h
mov es,ax
mov di,160*12 ;初使化一些参数
mov al,9 ;年
out 70h,al
in al,71h
call time
mov ah,47
mov byte ptr es:[di].4,ah
add di,6
mov al,8 ;月
out 70h,al
in al,71h
call time
mov ah,47
mov byte ptr es:[di].4,ah
add di,6
mov al,7 ;日
out 70h,al
in al,71h
call time
mov ah,0
mov byte ptr es:[di].4,ah
add di,6
mov al,4 ;时
out 70h,al
in al,71h
call time
mov ah,58
mov byte ptr es:[di].4,ah
add di,6
mov al,2 ;分
out 70h,al
in al,71h
call time
mov ah,58
mov byte ptr es:[di].4,ah
add di,6
mov al,0 ;秒
out 70h,al
in al,71h
call time
mov ax,4c00h
int 21h
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
time: ;显示时间的程序
mov ah,al ;参数为ah,十位al个位
mov cl,4 ;es:[di]显示地址
shr ah,cl ;没有返回值
and al,00001111B
add ah,30h
add al,30h
mov byte ptr es:[di],ah
mov byte ptr es:[di].2,al
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
code ends
end start
- [ce54605802] 经过我自己的测试,有问题,调试的时候出现除法溢出。需要改进 10/27 20:49
- [tinyparticle] 功能完成 10/14 18:39
- [tinyparticle] 正确 10/14 18:38
- [tinyparticle] 测试通过 10/14 18:38
- [tinyparticle] 理解没问题 10/11 14:49
- [ce54605802] 。。 “啥” 是东北方言 10/11 14:40
- [tinyparticle] 没啥问题。 10/11 14:26
- [younggay] 不错,加油。 10/10 13:33
- [ce54605802] 上去看了一下,真不错,网站也收藏了 我QQ是54605802 加下QQ吧,方便交流 10/09 23:15
- [tinyparticle] 加密与解密(第三版) 支持网站:http://bbs.pediy.com/index.php 10/09 23:09
- [ce54605802] 呵呵 你给加上0001H 有什么意义啊 加上 00FFH 试试啊 09/15 23:34
- [abob] 物理地址 等于 FFFF*16+FFFF 等于16FFE9,远远超过了20位数字 ------ 08/05 17:10