You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dumpregs.c 740B

1234567891011121314151617181920212223
  1. #include <stdio.h>
  2. #include <realmode.h>
  3. void __asmcall _dump_regs ( struct i386_all_regs *ix86 ) {
  4. __asm__ __volatile__ (
  5. TEXT16_CODE ( ".globl dump_regs\n\t"
  6. "\ndump_regs:\n\t"
  7. "pushl $_dump_regs\n\t"
  8. "pushw %%cs\n\t"
  9. "call prot_call\n\t"
  10. "addr32 leal 4(%%esp), %%esp\n\t"
  11. "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. }