#801 long type multiplication on DS80C400

closed-fixed
Maarten Brock
5
2013-05-25
2004-08-24
Bernard
No

the following produces 'failed':

long int x = 10L;
void foo(void)
{
volatile long int y = 20L; // volatile to prevent
optimising out

if (x * y != 200L)
printf("failed\r\n");
else
printf("success\r\n");
}

The invoking command line via gmake is:
h:\sdcc\bin\sdcc.exe --stack-auto --stack-10bit
--float-reent --int-long-reent --nostdinc
-Ih:\sdcc\include -mds400 -c -odebug/msg.rel msg.c <
"./debug/exit.txt"

h:\sdcc\bin\sdcc.exe -Wl-r --code-loc 0x4000 --xram-loc
0x20000 --data-loc 0x28 -Lh:\sdcc\lib -mds400
-o.\pictest.ihx -llibc -lds400rom ./debug/main.rel
./debug/serial3.rel ... etc

Sdcc version:
SDCC :
mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
2.3.6 (Dec 13 2003) (MINGW32)

bernard@walkermarine.com

Discussion

  • Bernhard Held
    Bernhard Held
    2004-08-24

    • assigned_to: nobody --> bernhardheld
     
  • Bernhard Held
    Bernhard Held
    2004-08-24

    Logged In: YES
    user_id=203539

    1. Please try again with a more current SDCC, we're at 2.4.3:
    http://sdcc.sourceforge.net/snap.php
    2. You're using --int-long-reent. Are you sure that you
    recompiled your int/long library functions with --stack-auto?
    (This applies to float support functions as well!)

     
  • Bernard
    Bernard
    2004-08-24

    Logged In: YES
    user_id=1110042

    Can you confirm this still exists in 2.3.2

     
  • Bernard
    Bernard
    2004-08-24

    Logged In: YES
    user_id=1110042

    Using the following version
    SDCC :
    mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
    2.4.3 #800 (Aug 19 2004) (MINGW32)

    the commandline now reads:
    c:\sdcc_new\bin\sdcc.exe --stack-auto --stack-10bit
    --float-reent --int-long-reent --nostdinc --model-flat24
    -Ic:\sdcc_new\sw\include.1 -Ic:\sdcc_new\sw\include.2
    -Ic:\sdcc_new\sw\include.3 -mds400 -c -odebug/msg.rel msg.c
    < "./debug/exit.txt"

    c:\sdcc_new\bin\sdcc.exe -Wl-r --code-loc 0x4000 --xram-loc
    0x20000 --data-loc 0x28 --stack-loc 0x50
    -Lc:\sdcc_new\sw\lib.0\ds400
    -Lc:\sdcc_new\sw\lib.0\src\ds400
    -Lc:\sdcc_new\sw\lib.0\ds390 -Lc:\sdcc_new\sw\lib.1
    -Lc:\sdcc_new\sw\lib.2 -mds400 -o.\pictest.ihx -llibc
    -lds400rom ./debug/main.rel ...etc

    The libraries were compiled with the following options
    --stack-auto --stack-10bit --float-reent --int-long-reent
    --nostdinc

    The problem still remains...

     
  • Maarten Brock
    Maarten Brock
    2008-02-13

    _mullong.c compiled with --stack-auto --stack-10bit

     
    Attachments
  • Maarten Brock
    Maarten Brock
    2008-02-13

    Logged In: YES
    user_id=888171
    Originator: NO

    This still exists in 2.7.4 with at least part of the bug in _mullong.asm line 167 & 170.
    File Added: _mullong.asm

     
  • Maarten Brock
    Maarten Brock
    2008-06-04

    Logged In: YES
    user_id=888171
    Originator: NO

    Fixed in SDCC 2.8.2 #5192.

     
  • Maarten Brock
    Maarten Brock
    2008-06-04

    • labels: --> ds390 target
    • milestone: --> fixed
    • assigned_to: bernhardheld --> maartenbrock
    • status: open --> closed-fixed