com32/chain: make raw handover use total sectors info
[syslinux.git] / core / regdump.inc
blobbdb5172d4dd2a716b27f1f15c0cee172ded9d0cf
1 ;; -----------------------------------------------------------------------
2 ;;
3 ;;   Copyright 2003-2008 H. Peter Anvin - All Rights Reserved
4 ;;
5 ;;   This program is free software; you can redistribute it and/or modify
6 ;;   it under the terms of the GNU General Public License as published by
7 ;;   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 ;;   Boston MA 02111-1307, USA; either version 2 of the License, or
9 ;;   (at your option) any later version; incorporated herein by reference.
11 ;; -----------------------------------------------------------------------
14 ;; regdump.inc
16 ;; Dump as much as possible of the register state; for debugging
19 disk_dumpregs:
20         mov ah,02h
21         call dumpregs
22         int 13h
23         ret
25 dumpregs:
26         push gs
27         push fs
28         push es
29         push ds
30         push ss
31         push cs
32         pushad
33         pushfd
35         push cs
36         pop ds
38         mov bp,sp
39         mov di,regnames
41         mov cx,9                ; 9 32-bit registers
42 .reg8:
43         mov si,[di]
44         inc di
45         inc di
46         call writestr
47         mov eax,[bp]
48         add bp,4
49         call writehex8
50         loop .reg8
52         mov cx,7                ; 6 16-bit registers
53 .reg4:
54         mov si,[di]
55         inc di
56         inc di
57         call writestr
58         mov eax,[bp]
59         inc bp
60         inc bp
61         call writehex4
62         loop .reg4
64         call crlf
66         popfd
67         popad
68         add sp,4                ; Skip CS, SS
69         pop ds
70         pop es
71         pop fs
72         pop gs
73         ret
75 regnames:
76         dw .eflags
77         dw .edi
78         dw .esi
79         dw .ebp
80         dw .esp
81         dw .ebx
82         dw .edx
83         dw .ecx
84         dw .eax
85         dw .cs
86         dw .ss
87         dw .ds
88         dw .es
89         dw .fs
90         dw .gs
91         dw .ip
93 .eflags db 'EFL: ', 0
94 .edi    db 13,10,'EDI: ', 0
95 .esi    db ' ESI: ', 0
96 .ebp    db ' EBP: ', 0
97 .esp    db ' ESP: ', 0
98 .ebx    db 13,10,'EBX: ', 0
99 .edx    db ' EDX: ', 0
100 .ecx    db ' ECX: ', 0
101 .eax    db ' EAX: ', 0
102 .cs     db 13,10,'CS: ',0
103 .ss     db ' SS: ',0
104 .ds     db ' DS: ',0
105 .es     db ' ES: ',0
106 .fs     db ' FS: ',0
107 .gs     db ' GS: ',0
108 .ip     db ' IP: ',0