| ??? 05/13/07 19:55 Read: times |
#139190 - mov? Responding to: ???'s previous message |
while at it, there should be two mov and two xrl here:
mov a, temp1lo xrl a, temp2lo jnz proceed xrl a, temp1hi <- mov a,temp1hi xrl a, temp2hi jnz proceed I guess this one is a little late because Jan was there earlier:
#include <8051.h>
unsigned char __xdata *temp1;
unsigned char __xdata *temp2;
void main(void)
{
do
{
P3 = *temp1++; // just to do something
}
while (temp1 != temp2);
}
compiles to:
0064 330 00101$:
...
341 ; equ.c:11: while (temp1 != temp2);
0075 E5 08 342 mov a,_temp1
0077 B5 0A EA 343 cjne a,_temp2,00101$
007A E5 09 344 mov a,(_temp1 + 1)
007C B5 0B E5 345 cjne a,(_temp2 + 1),00101$
|
| Topic | Author | Date |
| compare two 16 bit values | 01/01/70 00:00 | |
| redundant move | 01/01/70 00:00 | |
| makes sense | 01/01/70 00:00 | |
| How about... | 01/01/70 00:00 | |
| don\'t work ! | 01/01/70 00:00 | |
| Oops. | 01/01/70 00:00 | |
| mov? | 01/01/70 00:00 | |
| I don't think so... | 01/01/70 00:00 | |
yes, I've fallen in that trap:) | 01/01/70 00:00 |



