No ydata ram display?

Beta Testing discussion on mikroC PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Jer
Posts: 19
Joined: 19 Oct 2008 22:05

No ydata ram display?

#1 Post by Jer » 11 Dec 2009 00:17

How can the contents of ydata memory be displayed in table form? - it looks like the RAM debug window is limited to the the top of xdata memory (0x27FF on my 33fj128gp802).

Also it would be nice if there were some display options to display the ram as ints or floats etc or just group in 1,2,3 ... 8 byte fields.

User avatar
nikola.kostic
mikroElektronika team
Posts: 433
Joined: 11 Aug 2009 12:12

#2 Post by nikola.kostic » 11 Dec 2009 15:18

Can you please provide code that can be compiled and demonstrates the problem you have with contents of ydata memory and RAM window?

Jer
Posts: 19
Joined: 19 Oct 2008 22:05

#3 Post by Jer » 11 Dec 2009 17:12

Here's the code I used

int xdata xxx = 9 ;
volatile int yyy absolute 0x2A00;

void main() {
int temp;
yyy = 7;
temp = xxx;
xxx = yyy;
yyy = temp;
}

I was not able to view 'yyy' in the debug RAM window as it only showed up to address 0x27ff, the problem was the same in release and icd debug mode - I'm probably making some stupid mistake.

User avatar
nikola.kostic
mikroElektronika team
Posts: 433
Joined: 11 Aug 2009 12:12

#4 Post by nikola.kostic » 14 Dec 2009 16:20

Thank you for the report and code. I have forwarded this to our developers and it will be inspected.

Jer
Posts: 19
Joined: 19 Oct 2008 22:05

.LST and .ASM output are different

#5 Post by Jer » 14 Dec 2009 20:28

Hi - I've also noticed that there are differences between the assembly code written to the '.asm' and '.lst' files for my test code - see below.

Looking at the first two MOV instructions the constants #2048 and #6142 in the '.asm' file are #2050 and #10239 in the '.lst' file.
I havent looked at the generated hex code to determine whats put in the HEX output but I think this difference might need inspection.

Also the CALL 552 (and the called code) present in the '.lst' (global variable initialisation, I assume) is missing in the '.asm' file - I think it should be shown in both files eg CALL _initialise_globals etc).

Here are the '.asm' and '.lst' showing the differences (using a Release / Software Debug build).


Assemble file output:
==============

Code: Select all

_main:
        MOV        #2048, W15
        MOV        #6142, W0
        MOV        WREG, SPLIM
        MOV        #1, W0
        MOV        WREG, PSVPAG
        MOV        #4, W0
        IOR        CORCON, 1
        LNK        #2

;tester.c,6 ::                 void main() {
;tester.c,8 ::                 yyy = 7;
        MOV        #7, W0
        MOV        W0, _yyy
;tester.c,9 ::                 temp = xxx;
        MOV        _xxx, W0
        MOV        W0, [W14+0]
;tester.c,10 ::                 xxx = yyy;
        MOV        _yyy, W0
        MOV        W0, _xxx
;tester.c,11 ::                 yyy = temp;
        MOV        [W14+0], W0
        MOV        W0, _yyy
;tester.c,12 ::                 }
L_end_main:
        ULNK
L__main1:
        BRA        L__main1
; end of _main

List file output (just showing the program code):
===============================

Code: Select all

main:
0x0200        0x20802F          MOV        #2050, W15
0x0202        0x227FF0          MOV        #10239, W0
0x0204        0xB7A020          MOV        WREG, SPLIM
0x0206        0x200010          MOV        #1, W0
0x0208        0xB7A034          MOV        WREG, PSVPAG
0x020A        0x200040          MOV        #4, W0
0x020C        0xB72044          IOR        CORCON, 1
0x020E        0xFA0002          LNK        #2
0x0210        0x000000020228          CALL        552
;tester.c,6 ::                 void main() {
;tester.c,8 ::                 yyy = 7;
0x0214        0x200070          MOV        #7, W0
0x0216        0x894000          MOV        W0, _yyy
;tester.c,9 ::                 temp = xxx;
0x0218        0x804000          MOV        _xxx, W0
0x021A        0x980700          MOV        W0, [W14+0]
;tester.c,10 ::                 xxx = yyy;
0x021C        0x814000          MOV        _yyy, W0
0x021E        0x884000          MOV        W0, _xxx
;tester.c,11 ::                 yyy = temp;
0x0220        0x90000E          MOV        [W14+0], W0
0x0222        0x894000          MOV        W0, _yyy
;tester.c,12 ::                 }
L_end_main:
0x0224        0xFA8000          ULNK
L__main1:
0x0226        0x37FFFF          BRA        L__main1
; end of _main
0x0228        0x228001          MOV        lo_addr(_yyy), W1
0x022A        0x280000          MOV        #32768, W0
0x022C        0x090000          REPEAT        #0
0x022E        0x7818B0          MOV        [W0++], [W1++]
0x0230        0x208001          MOV        lo_addr(_xxx), W1
0x0232        0x280020          MOV        #32770, W0
0x0234        0x090000          REPEAT        #0
0x0236        0x7818B0          MOV        [W0++], [W1++]
0x0238        0x060000          RETURN

Jer
Posts: 19
Joined: 19 Oct 2008 22:05

.LST and .ASM output are different

#6 Post by Jer » 14 Dec 2009 20:30

Hi - I've also noticed that there are differences between the assembly code written to the '.asm' and '.lst' files for my test code - see below.

Looking at the first two MOV instructions the constants #2048 and #6142 in the '.asm' file are #2050 and #10239 in the '.lst' file.
I havent looked at the generated hex code to determine whats put in the HEX output but I think this difference might need inspection.

Also the CALL 552 (and the called code) present in the '.lst' (global variable initialisation, I assume) is missing in the '.asm' file - I think it should be shown in both files eg CALL _initialise_globals or whatever).

Here are the '.asm' and '.lst' showing the differences (using a Release / Software Debug build).


Assemble file output:
==============

Code: Select all

_main:
        MOV        #2048, W15
        MOV        #6142, W0
        MOV        WREG, SPLIM
        MOV        #1, W0
        MOV        WREG, PSVPAG
        MOV        #4, W0
        IOR        CORCON, 1
        LNK        #2

;tester.c,6 ::                 void main() {
;tester.c,8 ::                 yyy = 7;
        MOV        #7, W0
        MOV        W0, _yyy
;tester.c,9 ::                 temp = xxx;
        MOV        _xxx, W0
        MOV        W0, [W14+0]
;tester.c,10 ::                 xxx = yyy;
        MOV        _yyy, W0
        MOV        W0, _xxx
;tester.c,11 ::                 yyy = temp;
        MOV        [W14+0], W0
        MOV        W0, _yyy
;tester.c,12 ::                 }
L_end_main:
        ULNK
L__main1:
        BRA        L__main1
; end of _main

List file output (just showing the program code):
===============================

Code: Select all

main:
0x0200        0x20802F          MOV        #2050, W15
0x0202        0x227FF0          MOV        #10239, W0
0x0204        0xB7A020          MOV        WREG, SPLIM
0x0206        0x200010          MOV        #1, W0
0x0208        0xB7A034          MOV        WREG, PSVPAG
0x020A        0x200040          MOV        #4, W0
0x020C        0xB72044          IOR        CORCON, 1
0x020E        0xFA0002          LNK        #2
0x0210        0x000000020228          CALL        552
;tester.c,6 ::                 void main() {
;tester.c,8 ::                 yyy = 7;
0x0214        0x200070          MOV        #7, W0
0x0216        0x894000          MOV        W0, _yyy
;tester.c,9 ::                 temp = xxx;
0x0218        0x804000          MOV        _xxx, W0
0x021A        0x980700          MOV        W0, [W14+0]
;tester.c,10 ::                 xxx = yyy;
0x021C        0x814000          MOV        _yyy, W0
0x021E        0x884000          MOV        W0, _xxx
;tester.c,11 ::                 yyy = temp;
0x0220        0x90000E          MOV        [W14+0], W0
0x0222        0x894000          MOV        W0, _yyy
;tester.c,12 ::                 }
L_end_main:
0x0224        0xFA8000          ULNK
L__main1:
0x0226        0x37FFFF          BRA        L__main1
; end of _main
0x0228        0x228001          MOV        lo_addr(_yyy), W1
0x022A        0x280000          MOV        #32768, W0
0x022C        0x090000          REPEAT        #0
0x022E        0x7818B0          MOV        [W0++], [W1++]
0x0230        0x208001          MOV        lo_addr(_xxx), W1
0x0232        0x280020          MOV        #32770, W0
0x0234        0x090000          REPEAT        #0
0x0236        0x7818B0          MOV        [W0++], [W1++]
0x0238        0x060000          RETURN

User avatar
nikola.kostic
mikroElektronika team
Posts: 433
Joined: 11 Aug 2009 12:12

#7 Post by nikola.kostic » 15 Dec 2009 13:23

Thank you for the reports Jer.

.lst file is one with relevant assembly code and .asm file is for internal use by the compiler and can be different (.asm file will not be generated from one of the next compiler releases).

Jer
Posts: 19
Joined: 19 Oct 2008 22:05

Posible error in P33fj64gp802.mlk

#8 Post by Jer » 28 Dec 2009 15:46

Hi - thanks for fixing the YData display problem for the 33fj128GP802 -
FYI the RAM ranges specified in P33fj64gp802.mlk seem to be wrong in the latest release of .mlk files.

User avatar
marko.ziv
mikroElektronika team
Posts: 531
Joined: 06 Dec 2007 10:11
Contact:

#9 Post by marko.ziv » 29 Dec 2009 09:51

Hi,
Jer could you send me an email at marko.ziv@mikroe.com, with a little bit more details on this issue so we can check it out?

Thank You

Jer
Posts: 19
Joined: 19 Oct 2008 22:05

16KByte not 8KByte

#10 Post by Jer » 29 Dec 2009 12:59

Apologies – I was convinced that the 33fj64gp802 had 8 Kbytes of RAM but (after another read of dspic manual) it has 16 KB which means the RAM ranges in the P33fj64gp802 are correct.

Post Reply

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