Forum Discussion
Altera_Forum
Honored Contributor
16 years agoNot really, since a every relative branch that crosses the deleted instruction would have to be modified. These are generated as absolute values by the assembler.
Similarly the jump tables used for switch statements would also need hacking. One possibility is to use a global register variable to point to the C structure that will be mapped to the low address. The compiler will then generate a single instruction for each access. Another option is to get the data within +-32k of _gp so that gp relative addressing can be used. For a system with only M9K memory it is not unreasonable to get all data items addressable that way. struct foo foo __attribute__((section(".sdata"))) = { ... }; will make the compiler use gp relative addressing for foo.