Index: kernel/arch/ia32/src/asm.S
===================================================================
--- kernel/arch/ia32/src/asm.S	(revision efbd09462384e9ff4983ce8e0910168f185076f2)
+++ kernel/arch/ia32/src/asm.S	(revision b539f54db74c6cc40c2db8aff16598ca0210cf86)
@@ -389,11 +389,13 @@
 	 * Save the selector registers.
 	 */
-	movl %gs, %eax
-	movl %fs, %ebx
+	movl %gs, %ecx
+	movl %fs, %edx
+
+	movl %ecx, ISTATE_OFFSET_GS(%esp)
+	movl %edx, ISTATE_OFFSET_FS(%esp)
+
 	movl %es, %ecx
 	movl %ds, %edx
 	
-	movl %eax, ISTATE_OFFSET_GS(%esp)
-	movl %ebx, ISTATE_OFFSET_FS(%esp)
 	movl %ecx, ISTATE_OFFSET_ES(%esp)
 	movl %edx, ISTATE_OFFSET_DS(%esp)
@@ -434,11 +436,13 @@
 		 * Restore the selector registers.
 		 */
-		movl ISTATE_OFFSET_GS(%esp), %eax
-		movl ISTATE_OFFSET_FS(%esp), %ebx
+		movl ISTATE_OFFSET_GS(%esp), %ecx
+		movl ISTATE_OFFSET_FS(%esp), %edx
+
+		movl %ecx, %gs
+		movl %edx, %fs
+
 		movl ISTATE_OFFSET_ES(%esp), %ecx
 		movl ISTATE_OFFSET_DS(%esp), %edx
 		
-		movl %eax, %gs
-		movl %ebx, %fs
 		movl %ecx, %es
 		movl %edx, %ds
@@ -447,8 +451,7 @@
 		 * Restore the scratch registers and the preserved
 		 * registers the handler cloberred itself
-		 * (i.e. EBX and EBP).
+		 * (i.e. EBP).
 		 */
 		movl ISTATE_OFFSET_EAX(%esp), %eax
-		movl ISTATE_OFFSET_EBX(%esp), %ebx
 		movl ISTATE_OFFSET_ECX(%esp), %ecx
 		movl ISTATE_OFFSET_EDX(%esp), %edx
