From f88ad6651b961781d67e79e282cdf2189bc52f2d Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Mon, 27 Jan 2025 15:51:03 -0500 Subject: msp430 improvements; fix compname bug --- foci.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'foci.c') diff --git a/foci.c b/foci.c index 107d317..8dedfbd 100644 --- a/foci.c +++ b/foci.c @@ -53,7 +53,7 @@ NAKED void compname(void) } RESTORE; - *--sp = *(unsigned char *)here; + *--sp = *(unsigned char *)here + 1; NEXT; } @@ -172,18 +172,21 @@ static void dotimpl(intptr_t n) { static const char dottbl[16] = "0123456789abcdef"; static char dotbuf[16] = {0}; - int i; + int i = 0; if (n < 0) { n *= -1; foci_putchar('-'); } - for (i = 0; n > 0; n /= 10) + do { dotbuf[i++] = dottbl[n % BASE]; + n /= BASE; + } while (n); while (--i >= 0) foci_putchar(dotbuf[i]); + foci_putchar(' '); } -- cgit v1.2.3