How to initialize 6805 configuration byte at compile time?
>I’m using a 68HC705C9A. I must somehow generate at hexcode which writes the registry > at programming time. I’m looking for a instruction like: > > const unsigned char PORTB_MOR @ 0x3ff0 = 0x00; Something like this should do it: #define ___mkstr(x) #x #define __CONFIG(x) asm(“\tpsect config,abs,ovrld”);\ asm(“\torg\t3FF0h”); \ asm(“\tfcb “___mkstr(x)) Then just use __CONFIG(0); or whatever. Just make sure the argument is ok as an assembler expression – you can use #define’d constants because the __mkstr hack makes sure they get expanded.