This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

write code to direct address

I try to write some codes to rest space of MCU's flash ROM (behind my program), so I should know the lastest byte of my program.
How to do all of these?

  • You should write almost codes and comple them first.Then see the lasted code byte in file *.m51(code segment).Of cource you must leave some space for the program code.

  • In principle, this should be possible by adding a segment of assembly code to your program that contains only a single label, and telling the linker to place that segment as the very last one of the whole project.

    We've had problems with that approach here, though. The linker didn't respect the "last" directive if there was a gap in the memory map into which this segment would fit.

  • Why not placing this codes to the end of the physical memory area. So you always have this codes at the same adress. Even when you insert some more Bytes to your original source code you don't have to move this codes to another location.