Index: trunk/src/VBox/Devices/PC/BIOS/rombios.c
===================================================================
--- trunk/src/VBox/Devices/PC/BIOS/rombios.c	(revision 18324)
+++ trunk/src/VBox/Devices/PC/BIOS/rombios.c	(revision 18574)
@@ -336,5 +336,5 @@
 
       mov  cx, 10[bp] ; count
-      cmp  cx, #0x00
+      test cx, cx
       je   memsetb_end
       mov  ax, 4[bp] ; segment
@@ -426,5 +426,5 @@
 
       mov  cx, 12[bp] ; count
-      cmp  cx, #0x0000
+      test cx, cx
       je   memcpyd_end
       mov  ax, 4[bp] ; dsegment
@@ -473,6 +473,5 @@
       mov  bx, 6[bp] ; offset
       mov  ax, [bx]
-      inc  bx
-      inc  bx
+      add  bx, #2
       mov  dx, [bx]
       ;; ax = return value (word)
@@ -503,6 +502,5 @@
       mov  ax, 8[bp] ; data word
       mov  [bx], ax  ; write data word
-      inc  bx
-      inc  bx
+      add  bx, #2
       mov  ax, 10[bp] ; data word
       mov  [bx], ax  ; write data word
@@ -541,5 +539,5 @@
     and eax, #0x0000FFFF
     shl ebx, #16
-    add eax, ebx
+    or  eax, ebx
     shr ebx, #16
     SEG SS
@@ -561,5 +559,5 @@
     and eax, #0x0000FFFF
     shl ebx, #16
-    add eax, ebx
+    or  eax, ebx
     SEG SS
     mul eax, dword ptr [di]
@@ -596,5 +594,5 @@
     and eax, #0x0000FFFF
     shl ebx, #16
-    add eax, ebx
+    or  eax, ebx
     shr ebx, #16
     test eax, eax
@@ -607,5 +605,5 @@
     and  eax, #0x0000FFFF
     shl  ebx, #16
-    add  eax, ebx
+    or   eax, ebx
   lsr_loop:
     shr  eax, #1
@@ -623,5 +621,5 @@
     and  eax, #0x0000FFFF
     shl  ebx, #16
-    add  eax, ebx
+    or   eax, ebx
   lsl_loop:
     shl  eax, #1
@@ -645,5 +643,5 @@
     and  eax, #0x0000FFFF
     shl  ebx, #16
-    add  eax, ebx
+    or   eax, ebx
     xor  edx, edx
     SEG SS
@@ -707,6 +705,5 @@
     Bit8u  removable;    // Removable device flag
     Bit8u  lock;         // Locks for removable devices
-    // Bit8u  lba_capable;  // LBA capable flag - always yes for bochs devices
-    Bit8u  mode;         // transfert mode : PIO 16/32 bits - IRQ - ISADMA - PCIDMA
+    Bit8u  mode;         // transfer mode : PIO 16/32 bits - IRQ - ISADMA - PCIDMA
     Bit16u blksize;      // block size
 
@@ -2421,5 +2418,4 @@
       sc = inb(iobase1+ATA_CB_SC);
       sn = inb(iobase1+ATA_CB_SN);
-
       if ((sc==0x01) && (sn==0x01)) {
         cl = inb(iobase1+ATA_CB_CL);
@@ -2678,5 +2674,5 @@
             write_byte(get_SS(),model+(i*2),read_byte(get_SS(),buffer+(i*2)+54+1));
             write_byte(get_SS(),model+(i*2)+1,read_byte(get_SS(),buffer+(i*2)+54));
-            }
+          }
 
           // Reformat
@@ -3756,5 +3752,5 @@
       write_word(ebda_seg,&EbdaData->cdemu.vdevice.spt,read_byte(boot_segment,446+6)&0x3f);
       write_word(ebda_seg,&EbdaData->cdemu.vdevice.cylinders,
-	      (read_byte(boot_segment,446+6)<<2) + read_byte(boot_segment,446+7) + 1);
+              (read_byte(boot_segment,446+6)<<2) + read_byte(boot_segment,446+7) + 1);
       write_word(ebda_seg,&EbdaData->cdemu.vdevice.heads,read_byte(boot_segment,446+5) + 1);
       break;
@@ -4590,5 +4586,5 @@
     }
 }
-#endif
+#endif // BX_USE_PS2_MOUSE
 
 
@@ -4598,6 +4594,6 @@
      Bit32u start;
      Bit32u end;
-     Bit8u  extra_start;
-     Bit8u  extra_end;
+     Bit8u extra_start;
+     Bit8u extra_end;
      Bit16u type;
 {
@@ -4819,8 +4815,8 @@
                 regs.u.r32.ecx = 0x14;
                 CLEAR_CF();
-	    } else {
-	      // if DX != 0x534D4150)
-	      goto int15_unimplemented;
-	    }
+            } else {
+              // if DX != 0x534D4150)
+              goto int15_unimplemented;
+            }
             break;
 
@@ -4854,6 +4850,6 @@
           regs.u.r16.bx = regs.u.r16.dx;
           break;
-	default:  /* AH=0xE8?? but not implemented */
-	  goto int15_unimplemented;
+        default:  /* AH=0xE8?? but not implemented */
+          goto int15_unimplemented;
        }
        break;
@@ -4966,5 +4962,5 @@
             }
           } while (--count>0);
-	}
+        }
       }
       BX=kbd_code;
@@ -5009,5 +5005,5 @@
     case 0x6F:
       if (GET_AL() == 0x08)
-	SET_AH(0x02); // unsupported, aka normal keyboard
+        SET_AH(0x02); // unsupported, aka normal keyboard
 
     default:
@@ -5236,5 +5232,5 @@
     default:
       if (scancode & 0x80) {
-          break; /* toss key releases ... */
+        break; /* toss key releases ... */
       }
       if (scancode > MAX_SCAN_CODE) {
@@ -5423,5 +5419,5 @@
       if (!VBOX_IS_SCSI_DEVICE(device))
 #endif
-        ata_reset (device);
+      ata_reset (device);
       goto int13_success;
       break;
@@ -6096,5 +6092,5 @@
 
         mov ah, #0x52
-        int 15
+        int #0x15
         mov _int13_cdrom.status + 2[bp], ah
         jnc int13_cdrom_rme_end
@@ -7165,5 +7161,5 @@
     if (hd_type != 0x0f)
       BX_INFO(panic_msg_reg12h,1);
-    hd_type = inb_cmos(0x1a); // HD0: extended type
+    hd_type = inb_cmos(0x1a); // HD1: extended type
     if (hd_type != 47)
       BX_INFO(panic_msg_reg19h,0,0x1a);
@@ -7184,4 +7180,5 @@
 #endif //else BX_USE_ATADRV
 
+#if BX_SUPPORT_FLOPPY
 
 //////////////////////
@@ -7464,5 +7461,4 @@
 }
 
-#if BX_SUPPORT_FLOPPY
   void
 int13_diskette_function(DS, ES, DI, SI, BP, ELDX, BX, DX, CX, AX, IP, CS, FLAGS)
@@ -8764,7 +8760,7 @@
       } else if (regs.u.r8.bl == 0x86) {
         if (regs.u.r8.al == 0x02) {
-        BX_INFO("PCI device %04x:%04x not found at index %d\n", regs.u.r16.dx, regs.u.r16.cx, regs.u.r16.si);
+          BX_INFO("PCI device %04x:%04x not found at index %d\n", regs.u.r16.dx, regs.u.r16.cx, regs.u.r16.si);
         } else {
-        BX_INFO("no PCI device with class code 0x%02x%04x found at index %d\n", regs.u.r8.cl, regs.u.r16.dx, regs.u.r16.si);
+          BX_INFO("no PCI device with class code 0x%02x%04x found at index %d\n", regs.u.r8.cl, regs.u.r16.dx, regs.u.r16.si);
         }
       }
@@ -9070,5 +9066,4 @@
   iret
 
-
 ;----------
 ;- INT18h -
@@ -9103,5 +9098,5 @@
 
   ;; int19 was beginning to be really complex, so now it
-  ;; just calls an C function, that does the work
+  ;; just calls a C function that does the work
   ;; it returns in BL the boot drive, and in AX the boot segment
   ;; the boot segment will be 0x0000 if something has failed
@@ -9717,4 +9712,5 @@
   pop   ax
   iret
+
 
 ;--------------------
@@ -10785,6 +10781,5 @@
   mov  ax, #0x8080
   out  dx, ax ;; reset PIRQ route control
-  inc  dx
-  inc  dx
+  add  dx, #2
   out  dx, ax
   mov  ax, [si+6]
@@ -10863,5 +10858,5 @@
   pop  ds
   ret
-#endif // BX_ROMBIOS32
+#endif // !BX_ROMBIOS32
 #endif // BX_PCIBIOS
 
@@ -10975,5 +10970,5 @@
   dw 0xffff, 0, 0x9b0f, 0x0000 ; 16 bit code segment base=0xf0000 limit=0xffff
   dw 0xffff, 0, 0x9300, 0x0000 ; 16 bit data segment base=0x0 limit=0xffff
-#endif
+#endif // BX_ROMBIOS32
 
 
@@ -11245,9 +11240,7 @@
 post_default_ints:
   mov  [bx], ax
-  inc  bx
-  inc  bx
+  add  bx, #2
   mov  [bx], dx
-  inc  bx
-  inc  bx
+  add  bx, #2
   loop post_default_ints
 
@@ -11474,5 +11467,4 @@
   sti        ;; enable interrupts
   int  #0x19
-
 
 .org 0xe2c3 ; NMI Handler Entry Point
@@ -11708,5 +11700,5 @@
   jmp int09_done
 
-int09_check_pause:  ;; check for pause key
+int09_check_pause: ;; check for pause key
   cmp  al, #0xe1
   jne int09_process_key
