From: SourceForge.net <no...@so...> - 2013-02-13 19:14:42
|
Bugs item #3604563, was opened at 2013-02-13 11:14 Message generated for change (Tracker Item Submitted) made by molnarkaroly You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3604563&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Molnár Károly (molnarkaroly) Assigned to: Nobody/Anonymous (nobody) Summary: [MCS51] Certain variables overlap in the XRAM Initial Comment: Example: __xdata __at (0x0000) unsigned char bf0[256]; __xdata unsigned char var0; __xdata unsigned char var1; __xdata unsigned char var2; __xdata unsigned char var3; void main(void) { bf0[0] = '0'; var0 = '1'; var1 = '2'; var2 = '3'; var3 = '4'; } Excerpt from the disassembled list (mcs51-disasm.pl): _main: 0x0064: 90 00 00 mov DPTR, #0x0000 ; DPTR = 0x0000 0x0067: 74 30 mov A, #0x30 ; ACC = 0x30 {'0'} 0x0069: F0 movx @DPTR, A ; XRAM[DPTR] = ACC 0x006A: 90 00 00 mov DPTR, #0x0000 ; DPTR = 0x0000 0x006D: 74 31 mov A, #0x31 ; ACC = 0x31 {'1'} 0x006F: F0 movx @DPTR, A ; XRAM[DPTR] = ACC 0x0070: 90 00 01 mov DPTR, #0x0001 ; DPTR = 0x0001 0x0073: 74 32 mov A, #0x32 ; ACC = 0x32 {'2'} 0x0075: F0 movx @DPTR, A ; XRAM[DPTR] = ACC 0x0076: 90 00 02 mov DPTR, #0x0002 ; DPTR = 0x0002 0x0079: 74 33 mov A, #0x33 ; ACC = 0x33 {'3'} 0x007B: F0 movx @DPTR, A ; XRAM[DPTR] = ACC 0x007C: 90 00 03 mov DPTR, #0x0003 ; DPTR = 0x0003 0x007F: 74 34 mov A, #0x34 ; ACC = 0x34 {'4'} 0x0081: F0 movx @DPTR, A ; XRAM[DPTR] = ACC 0x0082: 22 ret ; PCH = [SP--], PCL = [SP--] I have included a simple example program. SDCC : mcs51/gbz80/z80/z180/r2k/r3ka/ds390/pic16/pic14/TININative/ds400/hc08/s08 3.2.1 #8384 (Jan 13 2013) (Linux) Károly ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3604563&group_id=599 |