Magellan Linux

Contents of /trunk/mkinitrd-magellan/isolinux/writehex.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (show annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 8 months ago) by niro
File size: 1212 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

1 ;; $Id: writehex.inc,v 1.1 2007-09-01 22:44:06 niro Exp $
2 ;; -----------------------------------------------------------------------
3 ;;
4 ;; Copyright 1994-2002 H. Peter Anvin - All Rights Reserved
5 ;;
6 ;; This program is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9 ;; Boston MA 02111-1307, USA; either version 2 of the License, or
10 ;; (at your option) any later version; incorporated herein by reference.
11 ;;
12 ;; -----------------------------------------------------------------------
13
14 ;;
15 ;; writehex.inc
16 ;;
17 ;; Write hexadecimal numbers to the console
18 ;;
19
20 section .text
21 ;
22 ; writehex[248]: Write a hex number in (AL, AX, EAX) to the console
23 ;
24 writehex2:
25 pushfd
26 pushad
27 rol eax,24
28 mov cx,2
29 jmp short writehex_common
30 writehex4:
31 pushfd
32 pushad
33 rol eax,16
34 mov cx,4
35 jmp short writehex_common
36 writehex8:
37 pushfd
38 pushad
39 mov cx,8
40 writehex_common:
41 .loop: rol eax,4
42 push eax
43 and al,0Fh
44 cmp al,10
45 jae .high
46 .low: add al,'0'
47 jmp short .ischar
48 .high: add al,'A'-10
49 .ischar: call writechr
50 pop eax
51 loop .loop
52 popad
53 popfd
54 ret
55