alright..so i took a look at those tutorials, and i wrote a bootloader that is -supposed- to clear the screen and print a line..i took a lot of the code from the tutorial but it's not working [for some reason]. it worked before i wrote the clear screen function too, if that helps in debugging it.
CODE
[BITS 16] ;Tells the assembler that its a 16 bit code
[ORG 0x7C00] ;Origin, tell the assembler that where the code will
;be in memory after it is been loaded
CALL ClearScreen
MOV SI, setA20 ;Store string pointer to SI
CALL PrintString ;Call print string procedure
JMP $ ;Infinite loop
ClearScreen:
XOR AL, AL ;Set AL to 0
MOV AH, 0x06 ;Function 06 of int 10h [scroll window up, if al = 0 clrscr]
MOV CX, 0x00 ;Clear from 0,0
MOV DX, 0x174f ;To 23,79
MOV BH, 0x00 ;Background color
INT 0x10 ;Call video interrupt
RET
PrintCharacter: ;Procedure to print character on screen
;Assume that ASCII value is in register AL
MOV AH, 0x0E ;Function 0E of int 10h [print character]
MOV BH, 0x00 ;Page no.
MOV BL, 0x07 ;Text attribute 0x07 is lightgrey font on black background
INT 0x10 ;Call video interrupt
RET
PrintString: ;Procedure to print string on screen
;Assume that string starting pointer is in register SI
next_character: ;Lable to fetch next character from string
MOV AL, [SI] ;Get a byte from string and store in AL
INC SI ;Increment SI pointer
OR AL, AL ;Check if value in AL is zero (end of string)
JZ exit_function ;If AL equals 0 then LET'S GET OUT OF HERE!
CALL PrintCharacter;Otherwise print the character in AL
JMP next_character;Fetch next character from string
exit_function: ;End label
RET ;Return from procedure
setA20 db 'Setting the A20 line..', 0
TIMES 510 - ($ - $$) db 0;Fill the rest of sector with 0, otherwise it won't boot
DW 0xAA55 ;Add boot signature at the end of bootloader
This post has been edited by Apples: 4 Oct, 2007 - 06:46 PM