I have a Cypress 8051 system which has 6K internal RAM and a 64K Flash ROM external to the uP. The internal RAM can be used for data and/or code. What I'm trying to do is move a few "flash updating" routines into the RAM and execute them from RAM. They would operate on the external flash ROM. My issue is that I don't know how to have these routines link to the area where the will eventually run. I've read app note 138 (for the 166 family and there are so many differences I don't know why people at Keil tell me to refer to that app note) I've done flash programming in other systems, so I'm aware of the issues. I need to know how to control the Keil compiler so my code ends up in the proper places. For example, there some BL51 locate parameters like "Code Range" and "Xdata Range" I've been setting the code range to "0x2000-0xffff" because that is (basically) the range where the external flash rom is decoded. The lower area is for the internal RAM resource. However, I want to run a function write_flash_block() from 0x400 (down in RAM). How do I tell it the runtime location is 400, but it's stored somewhere (anywhere actually) in Flash???