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 Reply Children
No data