PutChar & GetChar

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.
Tim

Re:PutChar & GetChar!

Post by Tim »

If you don't care about colour or position:

Code: Select all

mov ah, 0Ah
mov al, the_character
xor bx, bx
mov cx, 1
int 10h
If you want to specify the colour:

Code: Select all

mov ah, 09h
mov al, the_character
mov bx, colour_code
mov cx, 1
int 10h
If you want to write a character and increment the cursor (like putch() in C):

Code: Select all

mov ah, 0Eh
mov al, the_character
mor bx, bx
int 10h
All of these methods use the BIOS, so clearly they won't work in protected mode.
Post Reply