Files
low-level-programming/x86_vram.asm
greg 35238cff2d Bare-metal gamarjoba munde
just clears the screen
2015-09-17 00:16:55 -07:00

34 lines
800 B
NASM

; x86 video stuff
; each character cell is a 16 bit word
; upper attribute byte is (upper 4 bits) - bg color, (lower 4 bits) fg color
; lower byte is ascii char
%define X86_COLS 80
%define X86_ROWS 25
%define X86_VRAM 0xb8000
; these values are already shifted to accomodate xor-ing
; with the lower ascii char byte
%define FG.BLACK 0 << 8
%define FG.BLUE 1 << 8
%define FG.GREEN 2 << 8
%define FG.CYAN 3 << 8
%define FG.RED 4 << 8
%define FG.MAGENTA 5 << 8
%define FG.YELLOW 6 << 8
%define FG.GRAY 7 << 8
%define FG.BRIGHT 8 << 8
%define BG.BLACK 0 << 12
%define BG.BLUE 1 << 12
%define BG.GREEN 2 << 12
%define BG.CYAN 3 << 12
%define BG.RED 4 << 12
%define BG.MAGENTA 5 << 12
%define BG.YELLOW 6 << 12
%define BG.GRAY 7 << 12
%define BG.BRIGHT 8 << 12