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 1b87616349
commit abf677a8c3
1 changed files with 4 additions and 7 deletions

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))