1 ; This code is adapted from Kernel Toolkit 0.2
2 ; and Linux version 2.2.x, so the following copyrights apply:
4 ; Copyright (C) 1991, 1992 Linus Torvalds
5 ; modified by Drew Eckhardt
6 ; modified by Bruce Evans (bde)
7 ; adapted for Kernel Toolkit by Luigi Sgro
16 ; The following were copied from ktk-0.2 bootsect.asm, and were presumably
17 ; from the Linux bootsect code. I changed them a little so they
18 ; don't clobber the caller's registers.
23 ; Print the word contained in the dx register to the screen.
27 mov cx, 4 ; 4 hex digits
29 rol dx, 4 ; rotate so that lowest 4 bits are used
30 mov ax, 0E0Fh ; ah = request, al = mask for nybble
32 add al, 90h ; convert al to ascii hex (four instructions)
33 daa ; I've spent 1 hour to understand how it works..
43 PrintNL: ; print CR and NL