??? 08/24/07 07:16 Modified: 08/24/07 08:20 Read: times |
#143576 - This is a really bad idea! Responding to: ???'s previous message |
Jacob Boyce said:
This is a Really Bad Idea! As I said earlier in this thread, It is not safe to assume that an assignment made in 'C' (ie, outside the #pragma ASM) won't have been "interfered with" by the time you get into the inline assembler.
http://www.8052.com/forum/read.phtml?id=143387 The same applies to setting ACC in 'C' before calling your assembler functions! If you want to pass parameters to your assembler functions, you must do it via the compiler's Calling Convention - or use properly defined global variables. You have absolutely no guarantee whatsoever that the compiler won't have used ACC for its own purposes during the calling process... You may have got lucky this once, but you must not rely upon it! [update] I'll put together an example of the complete process - watch this space... |