X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Futil.asm;fp=palacios%2Fsrc%2Fgeekos%2Futil.asm;h=0000000000000000000000000000000000000000;hb=d38e1d6edeee83bfb1e3e3c6e2367faa5055bdfe;hp=86a019bf6296c1e480d3363013a31e5dbb143918;hpb=e70e95962c26832628d586e07f9cd1a2e1852d72;p=palacios.git diff --git a/palacios/src/geekos/util.asm b/palacios/src/geekos/util.asm deleted file mode 100644 index 86a019b..0000000 --- a/palacios/src/geekos/util.asm +++ /dev/null @@ -1,52 +0,0 @@ -; This code is adapted from Kernel Toolkit 0.2 -; and Linux version 2.2.x, so the following copyrights apply: - -; Copyright (C) 1991, 1992 Linus Torvalds -; modified by Drew Eckhardt -; modified by Bruce Evans (bde) -; adapted for Kernel Toolkit by Luigi Sgro - -%ifndef UTIL_ASM -%define UTIL_ASM -%include "defs.asm" -%include "symbol.asm" - -[BITS 32] - -; The following were copied from ktk-0.2 bootsect.asm, and were presumably -; from the Linux bootsect code. I changed them a little so they -; don't clobber the caller's registers. - -EXPORT PrintHex - -[SECTION .text] -; Print the word contained in the dx register to the screen. -align 8 -PrintHex: - pusha - mov cx, 4 ; 4 hex digits -.PrintDigit: - rol dx, 4 ; rotate so that lowest 4 bits are used - mov ax, 0E0Fh ; ah = request, al = mask for nybble - and al, dl - add al, 90h ; convert al to ascii hex (four instructions) - daa ; I've spent 1 hour to understand how it works.. - adc al, 40h - daa - int 10h - loop .PrintDigit - popa - ret - -; Print a newline. -align 8 -PrintNL: ; print CR and NL - push ax - mov ax, 0E0Dh ; CR - int 10h - mov al, 0Ah ; LF - int 10h - pop ax - ret - -%endif