Disk Operating System/Hello, World!

Going Deeper
So far we have a working bootloader that just hangs the computer. Obviously, you'd anticipate it to do more than that and it can. By using a BIOS interrupt, we can display a single ASCII character on the screen. Specifically, we'll be using Int 10h, which is the BIOS interrupt that interacts with the screen. There is a list of int 10h functions on Wikipedia if you need further reference.

The code below prints a ASCII character on the screen and hang the computer.

In the above code,  contains the BIOS function,   contains the character to print which, in this case, is A, and   contains the the active page number (you don't need to worry about that right now, just keep it set to zero).

Now that we have a way to print characters onto the screen we can make a string printing function. We'll have to setup some things up and change things around for this to work, though.

Whoa, that's a lot of new code! Let's break it down. clears the direction flag, which only matters to our. We need to move string in  and we need to call. In the function,, we setup the int 10h parameters and then we go into a loop. grabs a byte from  and puts it into. Then depending on the direction flag, know as the DF;  will increase or decrease. clears the DF, which makes  increase , hence why it's in our code. The  function also checks for a null-terminating character and if it finds it, it returns control to the caller. The label  points to the string we want to print. It might sounds a bit complicated, but it really just complex.

Assignments



 * Previous Lesson
 * Next Lesson
 * Course Home Page