操作的基本原理:
1,将获取BIOS端口的程序入口地址放入中断向量表中
2,更新相应的中断向量表(改变了默认的中断程序)
3,将中断的入口地址载入程序PC中,通过调用中断获取对BIOS的操作
;用int 7ch 中断来封装BIOS端口得到的时间
assume cs:code
code segment
start:
;将程序导入到相应的中断地址中去
mov ax, cs
mov ds, ax
mov si, offset show
mov ax, 0
mov es, ax
mov di, 200h
mov cx, offset o - offset show
cld
rep movsb
;更新中断向量表
mov ax, 0
mov es, ax
mov word ptr es:[7ch*4], 200h
mov word ptr es:[7ch*4+2], 0
mov ax, 4c00h
int 21h
show:
jmp short s0
db 9,8,7,4,2,0
db 'yy/mm/dd hh:MM:ss'
s0:
mov ax, cs
mov es, ax
mov ax, 0b800h
mov ds, ax
mov di, 202h