mescc: Fix hex2:immediate8 to work with mes/m2-compiled mes.

* module/mescc/M1.scm (hex2:immediate8): Remove mesc? exception.
(mesc?): Remove.
This commit is contained in:
Andrius Štikonas 2023-07-03 19:15:56 +01:00 committed by Janneke Nieuwenhuizen
parent 516b5849f2
commit 2e13faa3c2

View file

@ -88,16 +88,13 @@
(if hex? (string-append "%0x" (dec->hex o))
(string-append "%" (number->string o))))
(define mesc? (string=? %compiler "mesc"))
(define (hex2:immediate8 o)
;; FIXME: #x100000000 => 0 divide-by-zero when compiled with 64 bit mesc
(if hex? (string-append "%0x" (dec->hex (if mesc? 0 (modulo o #x100000000)))
(if hex? (string-append "%0x" (dec->hex (modulo o #x100000000))
" %0x" (if (< o 0) "-1"
(dec->hex (if mesc? o (quotient o #x100000000)))))
(string-append "%" (number->string (dec->hex (if mesc? 0 (modulo o #x100000000))))
(dec->hex (quotient o #x100000000))))
(string-append "%" (number->string (dec->hex (modulo o #x100000000)))
" %" (if (< o 0) "-1"
(number->string (dec->hex (if mesc? o (quotient o #x100000000))))))))
(number->string (dec->hex (quotient o #x100000000)))))))
(define* (display-join o #:optional (sep ""))
(let loop ((o o))