Glauber Costa 3afbf09
diff --git a/bios/rombios.c b/bios/rombios.c
Glauber Costa 3afbf09
index c4f6ccd..c4bfe60 100644
Glauber Costa 3afbf09
--- a/bios/rombios.c
Glauber Costa 3afbf09
+++ b/bios/rombios.c
Glauber Costa 3afbf09
@@ -10196,22 +10196,43 @@ no_serial:
Glauber Costa 3afbf09
   ret
Glauber Costa 3afbf09
 
Glauber Costa 3afbf09
 rom_checksum:
Glauber Costa 3afbf09
-  push ax
Glauber Costa 3afbf09
-  push bx
Glauber Costa 3afbf09
-  push cx
Glauber Costa 3afbf09
+  pusha
Glauber Costa 3afbf09
+  push ds
Glauber Costa 3afbf09
+
Glauber Costa 3afbf09
   xor  ax, ax
Glauber Costa 3afbf09
   xor  bx, bx
Glauber Costa 3afbf09
   xor  cx, cx
Glauber Costa 3afbf09
+  xor  dx, dx
Glauber Costa 3afbf09
+
Glauber Costa 3afbf09
   mov  ch, [2]
Glauber Costa 3afbf09
   shl  cx, #1
Glauber Costa 3afbf09
+
Glauber Costa 3afbf09
+  jnc checksum_loop
Glauber Costa 3afbf09
+  xchg dx, cx
Glauber Costa 3afbf09
+  dec  cx
Glauber Costa 3afbf09
+
Glauber Costa 3afbf09
 checksum_loop:
Glauber Costa 3afbf09
   add  al, [bx]
Glauber Costa 3afbf09
   inc  bx
Glauber Costa 3afbf09
   loop checksum_loop
Glauber Costa 3afbf09
+
Glauber Costa 3afbf09
+  test dx, dx 
Glauber Costa 3afbf09
+  je checksum_out
Glauber Costa 3afbf09
+
Glauber Costa 3afbf09
+  add  al, [bx]
Glauber Costa 3afbf09
+  mov  cx, dx
Glauber Costa 3afbf09
+  mov  dx, ds
Glauber Costa 3afbf09
+  add  dh, #0x10
Glauber Costa 3afbf09
+  mov  ds, dx
Glauber Costa 3afbf09
+  xor  dx, dx 
Glauber Costa 3afbf09
+  xor  bx, bx
Glauber Costa 3afbf09
+
Glauber Costa 3afbf09
+  jmp  checksum_loop
Glauber Costa 3afbf09
+
Glauber Costa 3afbf09
+checksum_out:
Glauber Costa 3afbf09
   and  al, #0xff
Glauber Costa 3afbf09
-  pop  cx
Glauber Costa 3afbf09
-  pop  bx
Glauber Costa 3afbf09
-  pop  ax
Glauber Costa 3afbf09
+  pop  ds
Glauber Costa 3afbf09
+  popa 
Glauber Costa 3afbf09
   ret