Jump to content

kenh

EstablishedMember
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

0 Neutral

About kenh

  • Rank
    Newbrie
  1. Very nice. Thank you. And the bytes can be accessed from assembly using _n and _n+1 if required.
  2. Thanks for the feedback. I assume it should be fairly trivial to implement this. Obviously it should apply for all instructions with literal arguments.
  3. With BoostC inline assembly, using the name of a variable with the movlw instruction loads its address, e.g. unsigned char array[4]; asm { movlw _array movwf _fsr } I would expect the same behavior for addlw, so that it would be possible to efficiently index into the array, e.g. asm { movlw 0x02 addlw _array movwf _fsr } However this gives an "error in built-in assembly" on the addlw line. (I know that in this simple case, one could swap the movlw and addlw instructions and get the same effect while avoiding the problem, but there are situations where this is not the case, e.g. when you already have the array index in the W register from a previous calculation). Is there some syntax trick to get around this error, or is it a bug / missing feature? Regards, Ken
  4. Found the solution in another thread....add +1 to the variable name. i.e. asm { movf _tmr1h, W movwf _x+1 movf _tmr1l, W movwf _x } I would suggest adding this to the inline assembler section of the BoostC manual.
  5. Hello, I would like to ask if it is possible to reference the individual bytes of an int from an inline assembly asm {} block, and if so, what is the syntax? One example where this would be useful is to optimize the capture of Timer1 values to an unsigned int variable e.g. unsigned int x; x = (tmr1h<<8)+tmr1l; I would like to be able to write something like asm { movf _tmr1h, W movwf _x.h movf _tmr1l, W movwf _x.l } I have tried various approaches with struct/unions and pointers, but without success.
×
×
  • Create New...