Skip to content

Instantly share code, notes, and snippets.

@ismaell
Created July 9, 2015 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ismaell/00e5e053ecae328f1ae4 to your computer and use it in GitHub Desktop.
Save ismaell/00e5e053ecae328f1ae4 to your computer and use it in GitHub Desktop.
Translate ANSI colors to the default VGA palette.
/**
* Translate ANSI colors to the default VGA palette.
* I.e. 1 <--> 4 and 3 <--> 6
*/
__ansi2vga:
movb %bl, %bh
shrb $2, %bh
xorb %bl, %bh
testb $1, %bh
jz 1f
xorb $5, %bl
1: ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment