Sean Schouten wrote : > My conclusion was that there must be > something messed-up with my usage of the RES function and > thus my memory addressing. I switched > to hard coding the address; TEMP_VAR equ 0x020. That works! Good debugging practice, but not the best long time solution. > I am now thinking that using RES does not work without > having a linker script? Having a linker script = reloc code. No linker script = abs code. And the syntax of the acual code must match. The syntax for RES in the two "modes" are in the MPASM/MPLINK manual. But as they says : "The most common usage for RES is for data storage in relocatable code." > Is that a correct assumption? Can anyone point me to > good material (tutorial / real world example) on dynamic > code and / or linker scripts? The MPASM/MPLINK manual has plenty of examples. > How does the RES directive work when the assembler / linker > sees that you have a variable that you must access in two banks? > Does it register that variable in both banks or do you still have to > pay much attention to bank switching? Check the MPASM/MPLINK manual. It depends on which of UDATA, UDATA_ASC, UDATA_OVR and UDATA_SHR you use. > Is relocatable ("dynamic") code just as efficient as absolute code? The difference is i the source code, the processor sees no difference. Reloc code is often more efficient to write and maintain, thought... Anyway, reloc code isn't much harder to write then abs code, just a little different. Whichever you learn first, will be the your natural selection later on. Jan-Erik. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist