#142 hc08 port hexadecimal case

None
closed-fixed
None
5
2016-04-30
2006-05-27
Anonymous
No

Please make the case of numbers output by hc08's gen.c
the same as those output by SDCC. Some peephole
optimizations are impossible without the same case.
I have attached a patch that changes the case of the
hc08 port to uppercase. (patch is against SVN trunk)

Test:
unsigned char foo;
((foo >> 4) & 0xf);

replace {
and %1
and %1
} by {
; Peephole - removed redundant and
and %1
}

Discussion

  • Nobody/Anonymous

    uppercase patch for sdcc/src/hc08/gen.c, against SVN.

     
  • Frieder Ferlemann

    Logged In: YES
    user_id=589052

    The hc08 port does it right: let's work towards lower case
    hex digits within SDCC instead?

    They are less error prone than their upper case equivalent:

    0x00d0 versus 0X00D0

    0X67B9 versus 0x67b9

     
  • Zinx Verituse

    Zinx Verituse - 2006-05-28

    Logged In: YES
    user_id=271960

    That would be fine as well; it only needs to be consistent.
    I didn't do it to SDCC because I assumed the other ports
    may already use upper-case. It would be easy to change the
    SDCC source to do lowercase, but I don't know about the
    other ports.

    It's a few lines in asm.c, in the _*_mapping arrays, as far
    as I can tell.

     
  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
    • Group: -->
     
  • Philipp Klaus Krause

    Changed to lower case in revision #9584.

    Philipp

     

Log in to post a comment.