Hello,
I found some bugs doing asm part code debugging (mikroC PRO for dsPIC30/33)
case 1:
XOR.B W12,[W10++],W12
here W10 = W10+2 after operation (but have to be +1)
case 2:
do w11,loop2
XOR.B W12,[W10++],W12
add w3,w12,w0
mov.b [w0],w12
loop2: nop
sometimes havind W11 = 0 debugger goes to neverending loop (even App crash) but have to pass loop only ones.
Hope this will be solved
BUG in software emulator debugger
-
- Posts: 28
- Joined: 04 Nov 2013 13:21
BUG in software emulator debugger
Last edited by Vladimir.CDI on 17 Nov 2013 11:09, edited 1 time in total.
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: BUG in software emulator debugger
Hello,
Could you please post some example code which will more precisely demonstrate the issue.
Code which you posted looks out of context.
Best regards.
Could you please post some example code which will more precisely demonstrate the issue.
Code which you posted looks out of context.
Best regards.
-
- Posts: 28
- Joined: 04 Nov 2013 13:21
Re: BUG in software emulator debugger
suredejan.odabasic wrote:Hello,
Could you please post some example code which will more precisely demonstrate the issue.
Code which you posted looks out of context.
Best regards.
unsigned char *test1(unsigned char *a, unsigned char b) {
asm {
xor.b w11, [w10],[w10++]
mov w10,w0
}
}
in case, that you use MikroC Pro software debugger you can see, that after XOR operation W10 is increaced by 2 (it sould be 1 according to microchip docs). This bug is related to any arithmetic operation AND, ORI, XOR, ADD, SUB
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: BUG in software emulator debugger
Hello,
Thank you for posting additional example.
This issue will be corrected as soon as possible.
Best regards.
Thank you for posting additional example.
This issue will be corrected as soon as possible.
Best regards.
-
- Posts: 28
- Joined: 04 Nov 2013 13:21
One more bug in software debugger
Hello,
found one more software debugger bug
works not as expected. In any case Wn will be zero in software degugger
due to that reason code
works wrong in simulator (i always zero) in case, that it translated to
and works right when translated to
Hope, that this will be possible to correct in nearest future
p.s. using MicroC Pro for dsPic 6.0.0
found one more software debugger bug
Code: Select all
ZE [Wx],Wn
due to that reason code
Code: Select all
char *p, a[] = {"12345"};
int i;
p = &a;
i = (int) *p++;
Code: Select all
ZE [Wx],Wn
Code: Select all
MOV.B [Wx],wn
ZE Wn,Wn
p.s. using MicroC Pro for dsPic 6.0.0
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: BUG in software emulator debugger
Hello,
I have tested your minimized code in mikroC PRO for dsPIC v6.0.1 and it worked as expected.
Please install the latest live update by clicking on Help>Check for Updates.
Best regards.
I have tested your minimized code in mikroC PRO for dsPIC v6.0.1 and it worked as expected.
Please install the latest live update by clicking on Help>Check for Updates.
Best regards.
-
- Posts: 28
- Joined: 04 Nov 2013 13:21
Re: BUG in software emulator debugger
OK, that you for your replay - not it works OK
I have tested, that autoincrement in debugger still works wrong, can you please put this to your plans for future bug correction
I have tested, that autoincrement in debugger still works wrong, can you please put this to your plans for future bug correction
Vladimir.CDI wrote:in case, that you use MikroC Pro software debugger you can see, that after XOR operation W10 is increaced by 2 (it sould be 1 according to microchip docs). This bug is related to any arithmetic operation AND, ORI, XOR, ADD, SUBCode: Select all
unsigned char *test1(unsigned char *a, unsigned char b) { asm { xor.b w11, [w10],[w10++] mov w10,w0 } }
-
- Posts: 28
- Joined: 04 Nov 2013 13:21
Re: BUG in software emulator debugger
Hello,
tested version 6.0.1 of a compiler and found, that some bugs is still there. Can you please put them to bugs list
tested version 6.0.1 of a compiler and found, that some bugs is still there. Can you please put them to bugs list
Code: Select all
char testa[20];
volatile int i;
void main()
{
asm {
mov #lo_addr(_testa+3),w0
mov #0xFF,w1
mov.b w1,[w0--]
xor.b w1,[++w0],w1 // here W0 have to be increaced by 1 (but it is by 2 in SoftwareDebugger)
mov #lo_addr(_testa+3),w0
ze [w0],w0 // here W0 have to be 0xFFFF, (but it is 0x00FF using SoftwareDebugger)
}
testa[3] = 0xFF;
i = (int) testa[3]; // here variable "i" have to be -1, but it is 255 using software debugger
}
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: BUG in software emulator debugger
Hello,
Problem with double incrementing in SW debugger is solved and it will be propagated in new release of dsPIC compilers.
If you wish to have 0xFFFF in W0 reg, instead of ZE(Zero-extend), SE(Sign-Extend) instruction should be used.
By default char type is unsigned char in mikroC.
With testa explicitly declared as signed char, the value of variable i will be -1.
Best regards.
Problem with double incrementing in SW debugger is solved and it will be propagated in new release of dsPIC compilers.
If you wish to have 0xFFFF in W0 reg, instead of ZE(Zero-extend), SE(Sign-Extend) instruction should be used.
By default char type is unsigned char in mikroC.
With testa explicitly declared as signed char, the value of variable i will be -1.
Code: Select all
signed char testa[20];
volatile int i;
void main()
{
testa[3] = 0xFF;
Delay_100ms(); // Dummy code
i = testa[3]; // Here variable i = -1 (with or without explicit casting)
}
-
- Posts: 28
- Joined: 04 Nov 2013 13:21
Re: BUG in software emulator debugger
Thanks for signed char explanation