X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=misc%2Ftest_vm%2Fsrc%2Fgeekos%2Futil.asm;fp=misc%2Ftest_vm%2Fsrc%2Fgeekos%2Futil.asm;h=0000000000000000000000000000000000000000;hp=dd07dfd0b5f9827bc8614c19a2669e42a2b88c44;hb=a70930549d1b741704dd7af4e6bb0e89f6f8a519;hpb=afb634a80f946634454a5d067a92aa600227bd93 diff --git a/misc/test_vm/src/geekos/util.asm b/misc/test_vm/src/geekos/util.asm deleted file mode 100644 index dd07dfd..0000000 --- a/misc/test_vm/src/geekos/util.asm +++ /dev/null @@ -1,53 +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 16] - -; 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