> We have inherited a project running on a PIC16F505 at 4MHz. The bulk of > the > software is written in Hitech C with some inline assembler. The original > code works (we have the original source and the original .hex and .cof > files. We are unable to compile it with the latest version of Hitech C > (no > optimization, free version) caused by passing a variable from a C routine > that calculates a number for a delay that is passed to an inline > assembler > routine that performs the delay (approx 40 - 75us). If I comment out the > inline assembly routine and replace it with a fixed delay routine using > the > built in delay_us function, it compiles OK. Any suggestions? Sorry that > I > am being so sketchy, but this is a proprietary product. You could post sections and we probably wouldn't know anything too proprietary. Especially if you changed names to be generic. Needless to say, there are a couple of ways of doing inline asm in HiTech. In my old version you access C variables by prepending an underscore to them, so a variable in C named Fred would be _Fred in asm. And you can have one line of assembly all by itself like this: asm("incfsz _inc1_2,w"); which is accessing the variable inc1_2 or you can do entire blocks of asm. What method does the code use? What does the current HiTech users manual say about inline assembly (I can't check because my version is old). Best regards, Bob --=20 http://www.fastmail.fm - Access your email from home and the web --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .