Kwooda posted a topic in BoostC and Chameleon compilers programmingIf I have some existing libray code written in MPLAB assembly, is there a way I can include it or link it into a BoostC program? I tried using the asm directive and cutting+pasting some code in there, but the compiler didn't like that. I really just want to include it as part of the build, primarily during the process of incrementally rewriting some of the code in C.
I am using SourceBoost 6.92 and I took uart_driver.h from a later version and heavily modified it and am using it in a PIC program I am writing, but it only works properly in SINGLE_PORT_MODE. When using multi-port mode, I noticed that the compiler creates temporary variables for values that are passed by reference, so an interrupt handler will copy values from the original variables on the way in, and copy the values from the temporary variables back to the original variables on the way out. I also noticed many argument and temporary variables share the same memory locations among different functions. I have not been able to pinpoint the problem, but the behavior of my program that simply reads from the UART and echoes the character back to the UART, suggests that some variables are getting clobbered in the process. As I mentioned, things work fine in single-port mode, when parameter passing is not used - the problem only appears when the calling signatures to the various routines require parameters. I have attached my code so you can see the behavior. It is written for a PIC16F628A running at 12 MHz, but it should work if you configure for another PIC. It seems this must be a result of a compiler bug, but like I said, I have yet to pinpoint the problem, and I have run out of time to debug it. I am moving forward in single-port mode, but eventually will need to have the multi-port functionality working. Any help would be appreciated. uart.rar