diff --git a/module/mescc/armv4/as.scm b/module/mescc/armv4/as.scm index 3787c9be..8975cc8f 100644 --- a/module/mescc/armv4/as.scm +++ b/module/mescc/armv4/as.scm @@ -369,10 +369,13 @@ `(,(string-append "push___%" r0)) (armv4:call-label #f "__mesabi_idiv" 2)) ;; __mesabi_uldiv(a, b, remainderp) - (cons* `(,(string-append "push___0")) - `(,(string-append "push___%" r1)) - `(,(string-append "push___%" r0)) - (armv4:call-label #f "__mesabi_uldiv" 3))))) + (append `(("push___%r3") ; slot for remainder + ("mov____%esp,%r3") + ("push___%r3") ; pointer to remainder + (,(string-append "push___%" r1)) + (,(string-append "push___%" r0))) + (armv4:call-label #f "__mesabi_uldiv" 3) + `(("pop____%r3")))))) (define (armv4:r0%r1 info signed?) (let ((r0 (get-r0 info))