Files
x86-bare-metal-examples/bios_color.S

32 lines
582 B
ArmAsm
Raw Normal View History

2015-09-20 10:59:36 +02:00
/*
Write a character N times with given color.
TODO: is this the only way? How to set the current color for ah = 0E?
Color codes: https://en.wikipedia.org/wiki/BIOS_color_attributes
*/
#include "common.h"
BEGIN
/* ID, character to print. */
mov $0x0961, %ax
/* Page, color, */
mov $0x0034, %bx
/*
How many times to write.
If too big, wraps around screen.
*/
mov $0x0001, %cx
int $0x10
/*
The new color is reused only for character that overwrite the writen region.
Cursor is not moved by the previous interrupt, so this produces a colored 'A'.
*/
2015-09-20 15:51:38 +02:00
PUTC($0x62)
PUTC($0x63)
2015-09-20 10:59:36 +02:00
hlt