Page 3 of 3

Re:PutChar & GetChar!

Posted: Tue Dec 31, 2002 7:09 am
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.