Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I'm just starting my very own OS, but I have a question. I've been searching everywhere, but I can't find any way to display the contents of a register on the screen. Anyone know how to do that? I'm in Real Mode now, but I also would like to know how to do it in protected mode.
I already know how to print a character from a memory location like this...
One technique that you can use (I think I am the only one who uses this though lol), let's say you have a 32-bit value in EAX and you want to print it as hexadecimal letters. Instead of shifting to the right and left, just ROL EAX 4 bits. So the most significant nibble in EAX will be placed in the least significant nibble. Then do a simple MOV to move EAX to another 32-bit register. AND that register with 0x0000000F and then print that character into the string (convert it to a character first). That way, for the next nibble, you will continue with the same operation (ROL EAX , 4). Then when all the ROLs are done (8 ROLs because we have 8 nibbles in a 32-bit value), you will have your original EAX back in EAX. That's the good thing about rotation in comparison to shifting.