最后结果=30=1*1+2*2+3*3+4*4
======================================
unsigned int data1[4];
unsigned int data2[4];
unsigned int *tbl1,*tbl2;
unsigned char i;
unsigned long tmp,result;
void main(void) {
/* put your own code here */
EnableInterrupts;
asm_main(); /* call the assembly function */
result="0";
tbl1=data1;
tbl2=data2;
for(i=0;i<4;i++)
{
data1=i+1;
data2=i+1;
}
for(i=0;i<4;i++)
{
asm
{
LDX tbl1
LDY tbl2
EMACS result
}
tbl1+=1;
tbl2+=1;
}
for(;;) {} /* wait forever */
/* please make sure that you never leave this function */
}
文章评论(0条评论)
登录后参与讨论