Improve set_code_fail/floppy_ret/disk_ret code generation.

Encode lineno and return code into one u32 parameter.  This reduces
    the number of functions arguments to 3 - which gcc does a better
    job of scheduling.
Also, consistently place *regs parameter in the first arg.
diff --git a/src/bregs.h b/src/bregs.h
index 490fd13..4d6a699 100644
--- a/src/bregs.h
+++ b/src/bregs.h
@@ -8,8 +8,9 @@
 #define __BREGS_H
 
 // CPU flag bitdefs
-#define F_ZF (1<<6)
 #define F_CF (1<<0)
+#define F_ZF (1<<6)
+#define F_IF (1<<9)
 
 // CR0 flags
 #define CR0_PG (1<<31) // Paging
@@ -88,14 +89,14 @@
     set_cf(regs, 1);
 }
 
-#define set_fail(regs) \
-    __set_fail(__func__, __LINE__, (regs))
-#define set_code_fail(regs, code)               \
-    __set_code_fail(__func__, __LINE__, (regs), (code))
+#define set_fail(regs)                          \
+    __set_fail((regs), __LINE__, __func__)
+#define set_code_fail(regs, code)                               \
+    __set_code_fail((regs), (code) | (__LINE__ << 8), __func__)
 
 // output.c
-void __set_fail(const char *fname, int lineno, struct bregs *regs);
-void __set_code_fail(const char *fname, int lineno, struct bregs *regs, u8 code);
+void __set_fail(struct bregs *regs, int lineno, const char *fname);
+void __set_code_fail(struct bregs *regs, u32 linecode, const char *fname);
 
 #endif // !__ASSEMBLY__
 
diff --git a/src/disk.c b/src/disk.c
index 87ccdde..f63a833 100644
--- a/src/disk.c
+++ b/src/disk.c
@@ -20,24 +20,25 @@
  ****************************************************************/
 
 void
-__disk_ret(const char *fname, int lineno, struct bregs *regs, u8 code)
+__disk_ret(struct bregs *regs, u32 linecode, const char *fname)
 {
+    u8 code = linecode;
     SET_BDA(disk_last_status, code);
     if (code)
-        __set_code_fail(fname, lineno, regs, code);
+        __set_code_fail(regs, linecode, fname);
     else
         set_code_success(regs);
 }
 
 static void
-__disk_stub(const char *fname, int lineno, struct bregs *regs)
+__disk_stub(struct bregs *regs, int lineno, const char *fname)
 {
-    __debug_stub(fname, lineno, regs);
-    __disk_ret(fname, lineno, regs, DISK_RET_SUCCESS);
+    __debug_stub(regs, lineno, fname);
+    __disk_ret(regs, DISK_RET_SUCCESS | (lineno << 8), fname);
 }
 
-#define DISK_STUB(regs) \
-    __disk_stub(__func__, __LINE__, (regs))
+#define DISK_STUB(regs)                         \
+    __disk_stub((regs), __LINE__, __func__)
 
 static int
 __send_disk_op(struct disk_op_s *op_p, u16 op_s)
diff --git a/src/disk.h b/src/disk.h
index 6c69dca..5e7d0fb 100644
--- a/src/disk.h
+++ b/src/disk.h
@@ -98,9 +98,9 @@
 
 // Helper function for setting up a return code.
 struct bregs;
-void __disk_ret(const char *fname, int lineno, struct bregs *regs, u8 code);
+void __disk_ret(struct bregs *regs, u32 linecode, const char *fname);
 #define disk_ret(regs, code) \
-    __disk_ret(__func__, __LINE__, (regs), (code))
+    __disk_ret((regs), (code) | (__LINE__ << 8), __func__)
 
 
 /****************************************************************
diff --git a/src/floppy.c b/src/floppy.c
index da812ba..3e78214 100644
--- a/src/floppy.c
+++ b/src/floppy.c
@@ -188,15 +188,16 @@
     return 0;
 }
 
-#define floppy_ret(regs, code) \
-    __floppy_ret(__func__, __LINE__, (regs), (code))
+#define floppy_ret(regs, code)                                  \
+    __floppy_ret((regs), (code) | (__LINE__ << 8), __func__)
 
 void
-__floppy_ret(const char *fname, int lineno, struct bregs *regs, u8 code)
+__floppy_ret(struct bregs *regs, u32 linecode, const char *fname)
 {
+    u8 code = linecode;
     SET_BDA(floppy_last_status, code);
     if (code)
-        __set_code_fail(fname, lineno, regs, code);
+        __set_code_fail(regs, linecode, fname);
     else
         set_code_success(regs);
 }
diff --git a/src/output.c b/src/output.c
index 6a56d45..356f2e5 100644
--- a/src/output.c
+++ b/src/output.c
@@ -271,6 +271,7 @@
             , regs->ds, regs->es, regs->ip, regs->cs, regs->flags, regs);
 }
 
+// Report entry to an Interrupt Service Routine (ISR).
 void
 __debug_isr(const char *fname)
 {
@@ -280,30 +281,38 @@
 
 // Function called on handler startup.
 void
-__debug_enter(const char *fname, struct bregs *regs)
+__debug_enter(struct bregs *regs, const char *fname)
 {
     dprintf(1, "enter %s:\n", fname);
     dump_regs(regs);
 }
 
+// Send debugging output info.
 void
-__debug_stub(const char *fname, int lineno, struct bregs *regs)
+__debug_stub(struct bregs *regs, int lineno, const char *fname)
 {
     dprintf(1, "stub %s:%d:\n", fname, lineno);
     dump_regs(regs);
 }
 
+// Report on a handler returning a failure notification to the caller.
 void
-__set_fail(const char *fname, int lineno, struct bregs *regs)
+__set_fail(struct bregs *regs, int lineno, const char *fname)
 {
     dprintf(1, "fail %s:%d:\n", fname, lineno);
     dump_regs(regs);
     set_fail_silent(regs);
 }
 
+// Report on a handler returning a failure code to the caller.  Note,
+// the lineno and return code are encoded in the same parameter as gcc
+// does a better job of scheduling function calls when there are 3 or
+// less parameters.
 void
-__set_code_fail(const char *fname, int lineno, struct bregs *regs, u8 code)
+__set_code_fail(struct bregs *regs, u32 linecode, const char *fname)
 {
+    u8 code = linecode;
+    u32 lineno = linecode >> 8;
     dprintf(1, "fail %s:%d(%x):\n", fname, lineno, code);
     dump_regs(regs);
     set_code_fail_silent(regs, code);
diff --git a/src/util.h b/src/util.h
index acd5d0c..c448aef 100644
--- a/src/util.h
+++ b/src/util.h
@@ -95,19 +95,19 @@
         if (CONFIG_DEBUG_LEVEL && (lvl) <= CONFIG_DEBUG_LEVEL)  \
             __dprintf((fmt) , ##args );                         \
     } while (0)
-void __debug_enter(const char *fname, struct bregs *regs);
-void __debug_stub(const char *fname, int lineno, struct bregs *regs);
+void __debug_enter(struct bregs *regs, const char *fname);
+void __debug_stub(struct bregs *regs, int lineno, const char *fname);
 void __debug_isr(const char *fname);
 #define debug_enter(regs, lvl) do {                     \
         if ((lvl) && (lvl) <= CONFIG_DEBUG_LEVEL)       \
-            __debug_enter(__func__, (regs));            \
+            __debug_enter((regs), __func__);            \
     } while (0)
 #define debug_isr(lvl) do {                             \
         if ((lvl) && (lvl) <= CONFIG_DEBUG_LEVEL)       \
             __debug_isr(__func__);                      \
     } while (0)
-#define debug_stub(regs) \
-    __debug_stub(__func__, __LINE__, (regs))
+#define debug_stub(regs)                        \
+    __debug_stub((regs), __LINE__, __func__)
 
 // kbd.c
 void kbd_setup();