This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Extra (useless) instructions involving r7 and accumulator

Why would the following line in C:

XRAM00 |= 0x01;

compile into this:

mov dptr, #XRAM00
movx a, @dptr
mov r7, a
mov a, r7
orl a, #1
mov r7, a
mov dptr, #XRAM00
mov a, r7
movx @dptr, a

I would have expected this:

mov dptr, #XRAM00
movx a, @dptr
orl a, #1
movx @dptr, a

Parents
  • well, since I know of no terninology that will satisfy you I have to resort to examples. I am kind of uzzled what your problem is, many (e.g. Per) have undeerstood.

    if you have a function that ends like that
    void a (void)
    {
    w
    x
    y
    z
    }
    
    and another function that end like this
    void b (void)
    {
    p
    x
    y
    z
    

    the optimixer will, if you are more intersted in optimization than debuggability and select an optimization level reflecting that philosophy merge execution strings like this:

    void a (void)
    {
    w
    optimal:
    x
    y
    z
    }
    
    void b (void)
    {
    p
    goto optimal
    

    if x,y,z is too much for a sardines brain I give up, this will be my final att6epmt to make you understand what the common phrase "merging execution strings" mean

    Erik

Reply
  • well, since I know of no terninology that will satisfy you I have to resort to examples. I am kind of uzzled what your problem is, many (e.g. Per) have undeerstood.

    if you have a function that ends like that
    void a (void)
    {
    w
    x
    y
    z
    }
    
    and another function that end like this
    void b (void)
    {
    p
    x
    y
    z
    

    the optimixer will, if you are more intersted in optimization than debuggability and select an optimization level reflecting that philosophy merge execution strings like this:

    void a (void)
    {
    w
    optimal:
    x
    y
    z
    }
    
    void b (void)
    {
    p
    goto optimal
    

    if x,y,z is too much for a sardines brain I give up, this will be my final att6epmt to make you understand what the common phrase "merging execution strings" mean

    Erik

Children