We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all
I try to use Generate Assembler SRC file to see the assembler code ,I found the complier is smart enough to stroe variable into register sometimes , but sometimes is strange. I try to complier same code twice times ,one time, it will sotre into register , one time is not,Why??
The first time ,I got this
?XD?int0_hander?MAIN SEGMENT XDATA OVERLAYABLE
RSEG ?XD?_int0_hander?MAIN ?int_hander?BYTE:
msgsts?040: DS 1
intsts?041: DS 1
The second time,I got this
msgsts?040 is stroe in R2 register
intsts?041 is also stroe in R2 register
Another example,I have a interrupt handler function it just read clear the interrupt status register
void irc_int_hander(void) { intsts = ptr_reg[IRC_INT_STS]; dma_task_scheduler(0,0,0); }
why "insts" will not store into register ,there is R2,R6 are free, but others more complex code can do this well.
any comment is welcome
Best Regards
http://www.keil.com/support/man/docs/c51/c51_xc.htm
user.it.uu.se/.../engblom-esc-sf-2001.pdf