#6 LongShiftLeft

closed-fixed
5
2013-05-25
2000-05-08
No

#define R2 27
unsigned long __lrotl_R2 (unsigned long x)
{
return x<<R2; // | (x >> (sizeof(x)*8-R2));
}
/*
"sdcc --model-large --stack-after-data --noinduction -c -I//E/sdcc220a/usr/local/share/include ..."
compiles thus, and crashes bits 24..31 (in r5) :
___lrotl_R2:
mov r2,dpl
mov r3,dph
mov r4,b
mov r5,a
mov a,r2
swap a
rr a
anl a,#0xf8
mov r5,a
mov r2,#0x00
mov r3,#0x00
mov r5,#0x00 ; BUG ?
mov dpl,r2
mov dph,r3
mov b,r4
mov a,r5
00101$:
ret
*/

Discussion

  • George Kolarov

    George Kolarov - 2000-05-08

    I solved this so:
    {
    x = x<<16;
    return x<<11;
    }

     
  • Sandeep Dutta

    Sandeep Dutta - 2000-06-14
    • assigned_to: nobody --> sandeep
     
  • Johan Knol

    Johan Knol - 2001-04-07
    • assigned_to: sandeep --> johanknol
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks