Excuse my limited knowledge on this... For proprietary reasons I must split my 8051 code so I can supply one section to a vendor who will perform testing on the product. I broke the code into Banks but am having trouble with the calls. Both with SiLabs emulator and running without the emulator the program counter goes back to reset instead of reaching the banked functions. Details: I broke the code into two projects, built them with "unresolved externals" warnings - because the code isn't there. It is in the other bank. I use ohx51.exe and then "Hex2Bin /L131072 RP0.h00 Linked.bin" ...and... "Hex2Bin /O0x9c40 /M RP0.h01 Linked.bin" and finally bin2hex /4 Linked.bin Linked.hex. So the unit just sits there reseting over and over again. Any clue what I'm doing wrong? Replies are greatly appreciated! ALSO: I need to know if it is possible to pass parameters in Banked calls.
the program counter goes back to reset So run it in the simulator, turn on recording, put a break at 0x0000, and go backwards from there to see where it came from. Generally said, things like "unresolved externals" warnings don't actually exist. An unresolved external is an error, every time. And it's almost certainly the exact reason for your problem, too. If you split up the project into separately linked parts, you have to at least export the locations of the missing part to the one calling them --- in terms of PC programming with shared libraries, you need an "import library". Such a trick is relatively easy to pull off in assembly, but may prove tricky in banked C programs --- the linker will probably forget to include the inter-bank call instrumentation for them.