The problem I see with your technique of linking lots of assembly functions is that you can't simply access a variable that was defined in C with the assembly code, you need to "pass" it to asm using one of the W registers, which means you will be defining every variable that is used in both sections, twice. I assume my problem stems from the fact that I want to perform bit-based actions on variables that I define and I don't know where they will be until the code is compiled. So bit-based actions are possible using C if you have a fixed location for the byte you want to update. ![]() I just looked at the disassembly for my code to see what was really happening and here is one example:ĭAC1STATbits.LOEN = 1 - This is the line in Cīset.b 0x03f3, #7 - This is the line is the disassembly code Linking in Assembly functions and Interrupt handlers to C turned out to be trivial.įunny you should bring that up. ![]() ![]() I am writing skeleton in C an then replace key/critical parts with Assembly. Most of the SFR bit fields are defined that way.
0 Comments
Leave a Reply. |