diff -Nur -x '*.trace' -x '*.rej' -x '*.orig' -x sbcl.h -x ldso-stubs.S -x Config -x target -x CVS -x 'target-*.h' -x output -x genesis -x '*.o' -x '*.nm' -x '*.core' -x '*.map' -x '*.d' -x '*~' -x '*.lisp-obj' -x '*.fasl' -x '*.lisp-temp' -x systems -x '*.tmp' -x local-target-features.lisp-expr -x a.out -x '*.so' -x foo.c -x sbcl -x grovel-headers -x customize-target-features.lisp -x external-format-test.txt -x test-status.lisp-expr sbcl-1.0.18-reserve-ebx-3/src/assembly/x86/assem-rtns.lisp sbcl-1.0.18-reserve-ebx-4/src/assembly/x86/assem-rtns.lisp
--- sbcl-1.0.18-reserve-ebx-3/src/assembly/x86/assem-rtns.lisp	2008-07-01 09:48:50.537416000 -0400
+++ sbcl-1.0.18-reserve-ebx-4/src/assembly/x86/assem-rtns.lisp	2008-07-01 20:51:05.519949120 -0400
@@ -42,7 +42,7 @@
     (inst jmp :e three-values))
 
   ;; Save the count, because the loop is going to destroy it.
-  (inst mov edx ecx)
+  (inst push ecx)
 
   ;; Blit the values down the stack. Note: there might be overlap, so
   ;; we have to be careful not to clobber values before we've read
@@ -53,24 +53,31 @@
   (inst shr ecx 2)                      ; fixnum to raw word count
   (inst std)                            ; count down
   (inst sub esi 4)                      ; ?
-  (inst lea edi (make-ea :dword :base ebx :disp (- n-word-bytes)))
+  (inst lea edi (make-ea :dword :base #!-x86-reserve-ebx ebx #!+x86-reserve-ebx edx :disp (- n-word-bytes)))
   (inst rep)
   (inst movs :dword)
   (inst cld)
 
   ;; Restore the count.
-  (inst mov ecx edx)
+  (inst pop ecx)
+
+  #!+x86-reserve-ebx
+  (inst mov esi edx)
 
   ;; Set the stack top to the last result.
   (inst lea esp-tn (make-ea :dword :base edi :disp n-word-bytes))
 
   ;; Load the register args.
-  (loadw edx ebx -1)
-  (loadw edi ebx -2)
-  #!-x86-two-arg-passing-regs
-  (loadw esi ebx -3)
+  #!-x86-reserve-ebx
+  (progn
+    (loadw edx ebx -1)
+    (loadw edi ebx -2)
+    #!-x86-two-arg-passing-regs
+    (loadw esi ebx -3))
   #!+x86-reserve-ebx
-  (inst mov esi ebx)
+  (progn
+    (loadw edx esi -1)
+    (loadw edi esi -2))
 
   ;; And back we go.
   (inst stc)
@@ -78,31 +85,40 @@
 
   ;; Handle the register arg cases.
   ZERO-VALUES
-  (move esp-tn ebx)
+  (move esp-tn #!-x86-reserve-ebx ebx #!+x86-reserve-ebx edx)
   (inst mov edx nil-value)
   (inst mov edi edx)
   #!-x86-two-arg-passing-regs
   (inst mov esi edx)
   #!+x86-reserve-ebx
-  (inst mov esi ebx)
+  (inst mov esi esp-tn)
   (inst stc)
   (inst jmp eax)
 
   ONE-VALUE ; Note: we can get this, because the return-multiple vop
             ; doesn't check for this case when size > speed.
-  (loadw edx esi -1)
-  (inst mov esp-tn ebx)
+  #!-x86-reserve-ebx
+  (progn
+    (loadw edx esi -1)
+    (inst mov esp-tn ebx))
+  #!+x86-reserve-ebx
+  (progn
+    (loadw esi esi -1)
+    (inst mov esp-tn edx)
+    (inst mov edx esi))
   (inst clc)
   (inst jmp eax)
 
   TWO-VALUES
+  #!+x86-reserve-ebx
+  (inst push edx)
   (loadw edx esi -1)
   (loadw edi esi -2)
   #!-x86-two-arg-passing-regs
   (inst mov esi nil-value)
   #!+x86-reserve-ebx
-  (inst mov esi ebx)
-  (inst lea esp-tn (make-ea :dword :base ebx :disp (* -2 n-word-bytes)))
+  (inst pop esi)
+  (inst lea esp-tn (make-ea :dword :base #!-x86-reserve-ebx ebx #!+x86-reserve-ebx esi :disp (* -2 n-word-bytes)))
   (inst stc)
   (inst jmp eax)
 
@@ -134,6 +150,7 @@
      (:return-style :none))
 
     ((:temp eax unsigned-reg eax-offset)
+     #!-x86-reserve-ebx
      (:temp ebx unsigned-reg ebx-offset)
      (:temp ecx unsigned-reg ecx-offset)
      (:temp edx unsigned-reg edx-offset)
@@ -151,7 +168,10 @@
   ;; Save the OLD-FP and RETURN-PC because the blit it going to trash
   ;; those stack locations. Save the ECX, because the loop is going
   ;; to trash it.
+  #!+x86-reserve-ebx
+  (pushw ebp-tn -2)
   (pushw ebp-tn -1)
+  #!-x86-reserve-ebx
   (loadw ebx ebp-tn -2)
   (inst push ecx)
 
@@ -173,6 +193,10 @@
   (inst pop ecx)
   (popw ebp-tn -1)                      ; overwrites a0
 
+  ;; And move the return-pc to safety.
+  #!+x86-reserve-ebx
+  (inst pop esi)
+
   ;; Blow off the stack above the arguments.
   (inst lea esp-tn (make-ea :dword :base edi :disp n-word-bytes))
 
@@ -182,7 +206,10 @@
   (loadw esi ebp-tn -3)
 
   ;; Push the (saved) return-pc so it looks like we just called.
+  #!-x86-reserve-ebx
   (inst push ebx)
+  #!+x86-reserve-ebx
+  (inst push esi)
 
   ;; And jump into the function.
   (inst jmp (make-ea-for-object-slot eax closure-fun-slot fun-pointer-lowtag))
diff -Nur -x '*.trace' -x '*.rej' -x '*.orig' -x sbcl.h -x ldso-stubs.S -x Config -x target -x CVS -x 'target-*.h' -x output -x genesis -x '*.o' -x '*.nm' -x '*.core' -x '*.map' -x '*.d' -x '*~' -x '*.lisp-obj' -x '*.fasl' -x '*.lisp-temp' -x systems -x '*.tmp' -x local-target-features.lisp-expr -x a.out -x '*.so' -x foo.c -x sbcl -x grovel-headers -x customize-target-features.lisp -x external-format-test.txt -x test-status.lisp-expr sbcl-1.0.18-reserve-ebx-3/src/compiler/assembly/x86/assem-rtns.lisp sbcl-1.0.18-reserve-ebx-4/src/compiler/assembly/x86/assem-rtns.lisp
--- sbcl-1.0.18-reserve-ebx-3/src/compiler/x86/call.lisp	2008-07-01 18:06:57.630878840 -0400
+++ sbcl-1.0.18-reserve-ebx-4/src/compiler/x86/call.lisp	2008-07-01 20:51:05.521951360 -0400
@@ -1128,7 +1128,7 @@
 ;;;
 ;;; The assembly routine takes the following args:
 ;;;  EAX -- the return-pc to finally jump to.
-;;;  EBX -- pointer to where to put the values.
+;;;  EBX -- pointer to where to put the values. (EDX when #!+x86-reserve-ebx)
 ;;;  ECX -- number of values to find there.
 ;;;  ESI -- pointer to where to find the values.
 (define-vop (return-multiple)
@@ -1140,6 +1140,7 @@
   (:temporary (:sc unsigned-reg :offset eax-offset :from (:argument 1)) eax)
   (:temporary (:sc unsigned-reg :offset esi-offset :from (:argument 2)) esi)
   (:temporary (:sc unsigned-reg :offset ecx-offset :from (:argument 3)) ecx)
+  #!-x86-reserve-ebx
   (:temporary (:sc unsigned-reg :offset ebx-offset :from (:eval 0)) ebx)
   (:temporary (:sc descriptor-reg :offset (first *register-arg-offsets*)
                    :from (:eval 0)) a0)
@@ -1172,7 +1173,10 @@
         (emit-label not-single)))
     (move esi vals)
     (move ecx nvals)
+    #!-x86-reserve-ebx
     (move ebx ebp-tn)
+    #!+x86-reserve-ebx
+    (move a0 ebp-tn)
     (move ebp-tn old-fp)
     (inst jmp (make-fixup 'return-multiple :assembly-routine))
     (trace-table-entry trace-table-normal)))
