From b75c10c9d8c7405ba2f89724b485154d5201c404 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Fri, 5 Sep 2014 02:36:33 +0200 Subject: working on bootloaders (lba) --- boot/print_string_16.asm | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) (limited to 'boot/print_string_16.asm') diff --git a/boot/print_string_16.asm b/boot/print_string_16.asm index 92b4ea0..b758725 100644 --- a/boot/print_string_16.asm +++ b/boot/print_string_16.asm @@ -1,5 +1,11 @@ [bits 16] +BLANK: + db 0x12 + +SPACE: + db " ",0 + ;print_string routine ([bx]) ;this routine will print a null terminated string at [bx] to the screen. print_string: @@ -27,19 +33,53 @@ print_string: popa ;pop all registers ret ;return to caller +print_clear: + +pusha + mov ah,0x6 ;func + mov al,0 ;scroll one line + mov bh,[BLANK] ;blank char + + mov ch,0 ;upper left corner + mov cl,0 + mov dh,20 ;lower right corner + mov dl,40 + int 0x10 + + mov ah,0x2 + mov bh,0 + mov dl,0 + mov dh,15 + int 0x10 +popa + print_nextline: pusha + mov ah,0x6 ;func + mov al,1 ;scroll one line + mov bh,[BLANK] ;blank char + + mov ch,0 ;upper left corner + mov cl,0 + mov dh,20 ;lower right corner + mov dl,40 + int 0x10 + + mov ah,0x3 - mov bh,0 + mov bh,0 int 0x10 + mov ah,0x2 - mov bh,0 - inc dh mov dl,0 int 0x10 + + mov bx,SPACE + call print_string + popa ret -- cgit v1.2.3