jartim 0 Posted November 30, 2017 Report Share Posted November 30, 2017 Hi, Does anyone have any insight into how to access a function parameter from in-line assembler? I am doing the following - void type24Var::add(const unsigned long src) { asm { movf _src, W } } But this will not compile and I get the message - failure type24Var.cpp(68:2): error: error in built-in assembly make[2]: [build/default/production/type24Var.o] Error 1 (ignored) It's driving me crazy, nothing I do seems to clear the error! Quote Link to post Share on other sites
Pavel 0 Posted November 30, 2017 Report Share Posted November 30, 2017 You access function argument correctly. Must be something else that causes the problem. Have you included system.h? If W is undefined you'll get same error (to check replace W with 0) Quote Link to post Share on other sites
jartim 0 Posted December 1, 2017 Author Report Share Posted December 1, 2017 Thanks Pavel, that was the problem. Cannot believe I missed it, it was a long day. Rgds Tim Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.