;很多書都在說顯示頁,就是沒有人說到底顯示頁的概念具體是什么的。
;80x86字符顯示頁有8個(gè)。有對(duì)應(yīng)的BIOS中斷來切換頁的,頁與頁之間沒有直接關(guān)系的。
;當(dāng)程序在多個(gè)頁中寫程序時(shí),可以及時(shí)地在各個(gè)頁中切換。向屏幕寫字符并且想要立刻看到,一定要寫到當(dāng)前顯示的頁中。
;閱讀下面的程序需要有引導(dǎo)程序的知識(shí)
;下面的程序功能是在8個(gè)頁中寫入不同的字符,最后在各個(gè)頁中切換。
;******************************************
;Copy Right Xiaoshuang Wang
;B.F.U
;2005
; 轉(zhuǎn)載請(qǐng)保留此部分
;******************************************
org 0x7c00
bootStart:
xor ax,ax
mov ds,ax
mov ss,ax
mov sp,0x7c00
mov bp,sp
; Init the DRIVE
; Boot drive number is stored in DX(lower part)
mov [drive],dl
again:
mov cx,200
againChar:
call putString
loop againChar
mov al,[page]
inc al
mov [page],al
cmp al,0x8
jne again
mov cx,0x9
xor al,al
mov [page],al
check:
mov ah,0x05
int 0x10
xor ah,ah
int 0x16
mov al,[page]
inc al
mov [page],al
loop check
db 0xea
dw 0x0000, 0xffff
data db '012345678'
putString:
mov si,[page]
mov al,[data+si]
mov ah,0x0a
mov bl,0x07
mov bh,[page]
int 0x10
retn
;************************
; Here are the data part
;************************
drive db 0
page db 0
times 510-($-$$) db 0
dw 0xaa55
posted on 2005-04-28 22:24
小爽 閱讀(819)
評(píng)論(0) 編輯 收藏 所屬分類:
我的經(jīng)驗(yàn) 、
我的操作系統(tǒng)