Assembler Inline can not work with negative numbers!!!

General discussion on mikroC PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
freewheel
Posts: 17
Joined: 01 Oct 2008 10:36

Assembler Inline can not work with negative numbers!!!

#1 Post by freewheel » 27 Jan 2010 03:36

Dear mikroE's developer!

I am testing the specification of assember inline in the newest version, mikroC PRO for dsPIC30/33 and PIC24 - Demo version. And I found a problem which is your compiler is not compatible with the standard assembly language of microChip completely. Namely, the instructions worked with negative numbers did not operate correctly.

For example:

Code: Select all

mov   #5, W0               ; Right!
mov   #-5, W0              ; Wrong --> The compiler is generated an error is                          ;"invalid expression"

or, 

sftac   A,#4                  ; Compile is OK, but
sftac   A,#-4                 ; Not OK
Note: The above instructions is described in microchip's data-sheet.

Please let me know this bugs and wish you correct them as soon as.
Thanks for your reply!

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

#2 Post by tihomir.losic » 27 Jan 2010 12:59

Hello,

it's a compiler bug.
Bug corrected, and will be available with the next release.
Until then you can use following workaround:

mov #0-5, W0

or

sftac A,#0-4

ASM parser is very complicated for dsPIC, that is the reason for bug appearance in our compiler.
Thank you for your support, and pointing at that error.
Sorry for the inconvenience.

Best regards,

Losic Tihomir
mikroElektronika [Support team]

Post Reply

Return to “mikroC PRO for dsPIC30/33 and PIC24 General”