(r1 (get-r1 info)))
`((,(string-append "and____%" r1 ",%" r0)))))
-(define (i386:r0/r1 info)
+(define (i386:r0/r1 info signed?)
(let ((allocated (.allocated info))
(r0 (get-r0 info))
(r1 (get-r1 info)))
`(,@(if (equal? r0 "eax") '()
`(("push___%eax")
(,(string-append "mov____%" r0 ",%eax"))))
- ("xor____%edx,%edx")
+ ,(if signed? '("cltd") '("xor____%edx,%edx"))
(,(string-append "idiv___%" r1))
,@(if (equal? r0 "eax") '()
`((,(string-append "mov____%eax,%" r0))
("push___%edx")
(,(string-append "mov____%" r1 ",%ebx"))
(,(string-append "mov____%" r0 ",%eax"))
- ("xor____%edx,%edx")
+ ,(if signed? '("cltd") '("xor____%edx,%edx"))
(,(string-append "idiv___%ebx"))
("pop____%edx")
("pop____%ebx")
(,(string-append "mov____%eax,%" r0))
("pop____%eax")))))
-(define (i386:r0%r1 info)
+(define (i386:r0%r1 info signed?)
(let ((allocated (.allocated info))
(r0 (get-r0 info))
(r1 (get-r1 info)))
`(,@(if (equal? r0 "eax") '()
`(("push___%eax")
(,(string-append "mov____%" r0 ",%eax"))))
- ("xor____%edx,%edx")
+ ,(if signed? '("cltd") '("xor____%edx,%edx"))
(,(string-append "idiv___%" r1))
(,(string-append "mov____%edx,%" r0)))
`(("push___%eax")
("push___%edx")
(,(string-append "mov____%" r1 ",%ebx"))
(,(string-append "mov____%" r0 ",%eax"))
- ("xor____%edx,%edx")
+ ,(if signed? '("cltd") '("xor____%edx,%edx"))
(,(string-append "idiv___%ebx"))
("pop____%edx")
("pop____%ebx")