Main Menu

IAP question

Started by Valent, May 19, 2003, 12:11:11 AM

Previous topic - Next topic

Valent

I am looking for information about which registers are modified and which not in the IAP calls at 0xFFF0H of a P89C51RD2H. Please, help me!

Andy Ayre

You have to assume that all registers may potentially be corrupted during an IAP call.

If you are wrapping the IAP calls up in the necessary code to allow them to be called from C as C functions, then C compilers automatically assume inside a function that all registers are corrupted, so this no longer becomes a problem.

You can download a C library for IAP which does this from our web site at:

http://www.esacademy.com/faq/progs/flash.htm

Embedded Systems Academy, Inc.
support at esacademy dot com

Valent

Hi Andrew and thanks by answer.

But I suspected that some registers were free, at least R2.
This register is used in an example of an old version of the AN461 application note from Philips to repeat an "ERASE BOOT VECTOR & STATUS BYTE" 6 times.
Also this register is used in all funtions (except iap_erase_chip) of IAP Library (rx2iap_lib) found in this web.
 
I am need to make my own library and I just was looking for any free register to optimize code.

Andrew Ayre wrote:

> You have to assume that all registers may potentially be
> corrupted during an IAP call.
>
> If you are wrapping the IAP calls up in the necessary code to
> allow them to be called from C as C functions, then C compilers
> automatically assume inside a function that all registers are
> corrupted, so this no longer becomes a problem.
>
> You can download a C library for IAP which does this from our
> web site at:
>
> http://www.esacademy.com/faq/progs/flash.htm