Ok, 
this seems to be a combiner bug and I can do nothing about it.

A simple workaround - use port5 defenition from libc and use bitfields.
        KP_CurKeyVal = port5.in.pin3;
or:
        KP_CurKeyVal = (P5IN & 0x08)?1:0;

~d

On Monday 24 February 2003 07:41, phil.hanc...@tekelek.com.au wrote:
> Official Release 1 ( 17-Dec-2002) does not generate this problem.
> This is a bug when using  patches from 10 Feb 2003.
>
> The first scenario (right shift 3) generates incorrect code. it should be
>
>                         bit.b #llo(8), &0x0030
>
> c-code :
>
>       /* Initialise key matrix variables */
>       KP_CurKeyVal = (P5IN & 0x08) >> 3;
>
> list file output:
>
> 246:src/keys.c    ****  /* Initialise key matrix variables */
>  247:src/keys.c    ****       KP_CurKeyVal = (P5IN & 0x08) >> 3;
>  223                          .stabn 68,0,247,.LM16-KEYS_InitSW
>  224                    .LM16:
>  225 0054 F2B0 0300           bit.b #llo(3), &0x0030
>  225      3000
>  226 005a C243 0000           clr.b &KP_CurKeyVal
>  227 005e C263 0000           adc.b &KP_CurKeyVal
>
>
>
> Correct code is generated for a right shift of 2
> c-code:
>
>       /* Initialise key matrix variables */
>       KP_CurKeyVal = (P5IN & 0x08) >> 2;
>
> list file:
>
>  246:src/keys.c    ****       /* Initialise key matrix variables */
>  247:src/keys.c    ****       KP_CurKeyVal = (P5IN & 0x08) >> 2;
>  223                          .stabn 68,0,247,.LM16-KEYS_InitSW
>  224                    .LM16:
>  225 0054 5F42 3000           mov.b &0x0030, r15
>  226 0058 7FF2                and.b #llo(8), r15
>  227 005a 12C3                clrc
>  228 005c 4F10                rrc.b r15
>  229 005e 4F11                rra.b r15
>  230 0060 C24F 0000           mov.b r15, &KP_CurKeyVal
>
>
>
> Regards,
> Phil Hancock
> Design Engineer
> Tekelek Pty Ltd
> 7 Comley St
> Export Park
> South Australia 5950
> Ph 61 8 8234 3011
> Fx 61 8 8234 3242
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
> The most comprehensive and flexible code editor you can use.
> Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
> www.slickedit.com/sourceforge
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users

-- 
/********************************************************************
     ("`-''-/").___..--''"`-._     (\   Dimmy the Wild      UA1ACZ
      `6_ 6  )   `-.  (     ).`-.__.`)  Enterprise Information Sys 
      (_Y_.)'  ._   )  `._ `. ``-..-'   Nevsky prospekt,   20 / 44
    _..`--'_..-_/  /--'_.' ,'           Saint Petersburg,   Russia
   (il),-''  (li),'  ((!.-'             +7 (812)  3468202, 5585314
 ********************************************************************/


Reply via email to