Go to the documentation of this file.
1 #include <stdio.h>
2 #include <realmode.h>
4 void __asmcall _dump_regs ( struct i386_all_regs *ix86 ) {
7  TEXT16_CODE ( ".globl dump_regs\n\t"
8  "\ndump_regs:\n\t"
10  "ret\n\t" ) : );
12  printf ( "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n"
13  "ESI=%08x EDI=%08x EBP=%08x ESP=%08x\n"
14  "CS=%04x SS=%04x DS=%04x ES=%04x FS=%04x GS=%04x\n",
15  ix86->regs.eax, ix86->regs.ebx, ix86->regs.ecx,
16  ix86->regs.edx, ix86->regs.esi, ix86->regs.edi,
17  ix86->regs.ebp, ix86->regs.esp,
18  ix86->segs.cs, ix86->segs.ss, ix86->segs.ds,
19  ix86->segs.es, ix86->segs.fs, ix86->segs.gs );
20 }
struct i386_seg_regs segs
Definition: registers.h:175
uint32_t ebp
Definition: registers.h:73
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
uint32_t esp
Definition: registers.h:77
#define VIRT_CALL(function)
Call C function from real-mode code.
Definition: librm.h:78
uint16_t es
Definition: registers.h:142
uint16_t cs
Definition: registers.h:139
uint16_t fs
Definition: registers.h:143
uint32_t eax
Definition: registers.h:109
A full register dump.
Definition: registers.h:174
void __asmcall _dump_regs(struct i386_all_regs *ix86)
Definition: dumpregs.c:4
#define __asmcall
Declare a function with standard calling conventions.
Definition: compiler.h:15
uint32_t edi
Definition: registers.h:65
uint32_t esi
Definition: registers.h:69
struct i386_regs regs
Definition: registers.h:176
uint16_t ds
Definition: registers.h:141
__asm__ __volatile__("\n1:\n\t" "movb -1(%3,%1), %%al\n\t" "stosb\n\t" "loop 1b\n\t" "xorl %%eax, %%eax\n\t" "mov %4, %1\n\t" "rep stosb\n\t" :"=&D"(discard_D), "=&c"(discard_c), "+m"(*value) :"r"(data), "g"(pad_len), "0"(value0), "1"(len) :"eax")
uint16_t ss
Definition: registers.h:140
uint32_t ecx
Definition: registers.h:101
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
uint16_t gs
Definition: registers.h:144
uint32_t ebx
Definition: registers.h:85
uint32_t edx
Definition: registers.h:93
#define TEXT16_CODE(asm_code_str)
Definition: libkir.h:217