Hi,
When I OR or AND an xdata location with a number, for instance to set a
bit in a register, the compiler generates an extra instruction to move
the old xdata contents into r2. E.g.:
; src/myfile.c:305: MY_REG &=3D ~BIT0;
; genAssign
; genAnd
mov dptr,#_MY_REG
movx a,@dptr
mov r2,a
; Peephole 248.b optimized and to xdata
anl a,#0xFE
movx @dptr,a
r2 is not then used anywhere, so why does this happen, and is there
anything I can do to stop it happening?
Mary-Ann
|