Support %ebp register in 'struct bregs'.

Save/restore %ebp on irq entry.
Support saving and restoring %ebp on call16.
Enable display of %ebp in register dumps.
diff --git a/src/asm-offsets.c b/src/asm-offsets.c
index c3c3bc6..ea49296 100644
--- a/src/asm-offsets.c
+++ b/src/asm-offsets.c
@@ -16,6 +16,7 @@
     OFFSET(BREGS_ebx, bregs, ebx);
     OFFSET(BREGS_ecx, bregs, ecx);
     OFFSET(BREGS_edx, bregs, edx);
+    OFFSET(BREGS_ebp, bregs, ebp);
     OFFSET(BREGS_esi, bregs, esi);
     OFFSET(BREGS_edi, bregs, edi);
     OFFSET(BREGS_flags, bregs, flags);
diff --git a/src/bregs.h b/src/bregs.h
index e420bbe..e59a7f4 100644
--- a/src/bregs.h
+++ b/src/bregs.h
@@ -37,6 +37,7 @@
     u16 es;
     UREG(edi, di, di_hi, di_lo);
     UREG(esi, si, si_hi, si_lo);
+    UREG(ebp, bp, bp_hi, bp_lo);
     UREG(ebx, bx, bh, bl);
     UREG(edx, dx, dh, dl);
     UREG(ecx, cx, ch, cl);
diff --git a/src/entryfuncs.S b/src/entryfuncs.S
index 96a2fcf..65218e3 100644
--- a/src/entryfuncs.S
+++ b/src/entryfuncs.S
@@ -67,6 +67,7 @@
         pushl %ecx
         pushl %edx
         pushl %ebx
+        pushl %ebp
         pushl %esi
         pushl %edi
         pushw %es
@@ -82,6 +83,7 @@
         popw %es
         popl %edi
         popl %esi
+        popl %ebp
         popl %ebx
         popl %edx
         popl %ecx
@@ -95,6 +97,7 @@
         pushl %ecx
         pushl %edx
         pushl %ebx
+        pushl %ebp
         pushl %esi
         pushl %edi
         pushw %es
@@ -103,8 +106,8 @@
         movw %cx, %ds
         movl %esp, %ebx         // Backup %esp, then zero high bits
         movzwl %sp, %esp
-        movl 24(%esp), %ecx     // Get calling function
-        movl %eax, 24(%esp)     // Save %eax
+        movl 28(%esp), %ecx     // Get calling function
+        movl %eax, 28(%esp)     // Save %eax
         movl %esp, %eax         // First arg is pointer to struct bregs
         calll *%ecx
         movl %ebx, %esp         // Restore %esp (including high bits)
@@ -112,6 +115,7 @@
         popw %es
         popl %edi
         popl %esi
+        popl %ebp
         popl %ebx
         popl %edx
         popl %ecx
@@ -126,6 +130,7 @@
         pushl %ecx
         pushl %edx
         pushl %ebx
+        pushl %ebp
         pushl %esi
         pushl %edi
         pushw %es
@@ -138,6 +143,7 @@
         popw %es
         popl %edi
         popl %esi
+        popl %ebp
         popl %ebx
         popl %edx
         popl %ecx
diff --git a/src/output.c b/src/output.c
index 9cebf95..a316626 100644
--- a/src/output.c
+++ b/src/output.c
@@ -322,11 +322,12 @@
         dprintf(1, "  NULL\n");
         return;
     }
-    dprintf(1, "   a=%08x  b=%08x  c=%08x  d=%08x si=%08x di=%08x\n"
+    dprintf(1, "   a=%08x  b=%08x  c=%08x  d=%08x ds=%04x es=%04x ss=%04x\n"
             , regs->eax, regs->ebx, regs->ecx, regs->edx
-            , regs->esi, regs->edi);
-    dprintf(1, "  ds=%08x es=%08x ip=%08x cs=%08x  f=%08x  r=%08x\n"
-            , regs->ds, regs->es, regs->ip, regs->cs, regs->flags, (u32)regs);
+            , regs->ds, regs->es, GET_SEG(SS));
+    dprintf(1, "  si=%08x di=%08x bp=%08x  r=%08x cs=%04x ip=%04x  f=%04x\n"
+            , regs->esi, regs->edi, regs->ebp, (u32)regs
+            , regs->cs, regs->ip, regs->flags);
 }
 
 // Report entry to an Interrupt Service Routine (ISR).
diff --git a/src/romlayout.S b/src/romlayout.S
index f354c74..eca4240 100644
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -157,6 +157,7 @@
         // Load calling registers.
         movl BREGS_edi(%eax), %edi
         movl BREGS_esi(%eax), %esi
+        movl BREGS_ebp(%eax), %ebp
         movl BREGS_ebx(%eax), %ebx
         movl BREGS_edx(%eax), %edx
         movl BREGS_ecx(%eax), %ecx
@@ -184,6 +185,7 @@
         movw %es, BREGS_es(%eax)
         movl %edi, BREGS_edi(%eax)
         movl %esi, BREGS_esi(%eax)
+        movl %ebp, BREGS_ebp(%eax)
         movl %ebx, BREGS_ebx(%eax)
         movl %edx, BREGS_edx(%eax)