??? 08/17/07 20:38 Read: times |
#143387 - Inelegant! Responding to: ???'s previous message |
Jorge Torija Zane said:
I did something like this and seems to work. It probably just happens to work in this case - but more by luck than judgement! 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. I don't know if there is a "more elegant" way of doing this. Yes - it's what I tried to explain before: http://www.8052.com/forum/read.phtml?id=143382 Again, you were lucky in this case - but it is not a good practice to adopt in general. Is this what you mean with "skeleton"? No: a skeleton is just a framework with no "meat" on it - you have included the meat! The "skeletons" would look something like this: void cout(unsigned char dato) { // No meat here! // (it will be written later in assembler) } unsigned char cin(void) { // No meat here! // (it will be written later in assembler) } You then get the compiler to translate that to assembler source; You then edit the assembler source to insert the "meat" See this Keil support article: http://www.keil.com/support/docs/50.htm |