| ??? 01/10/11 21:24 Modified: 01/10/11 21:25 Read: times |
#180503 - What is "that way"? Responding to: ???'s previous message |
Andy Neil said:
Jan Waclawek said:
... maybe better use the native absolute addressing through keyword __at (see chapter 3.6 of the Manual). Does it work that way? See: http://www.8052.com/forum/read/180498 Andy also said: I don't know what do you exactly mean by XBYTE macro, but if one desires indexed access to absolutely positioned array, in SDCC the following:
Which looks to me like it is the same as in Keil - ie, it cannot be used as in the XBYTE macro. __xdata __at 0 unsigned int a[0];
void main(void) {
a[10] |= 20;
}
results in (some antique version of SDCC I happen to have on this computer, the current edition might work slightly differently as far as code generation goes)0000 90 00 14 134 mov dptr,#(_a + 0x0014) 0003 E0 135 movx a,@dptr 0004 FA 136 mov r2,a 0005 A3 137 inc dptr 0006 E0 138 movx a,@dptr 0007 FB 139 mov r3,a 0008 43 02 14 140 orl ar2,#0x14 000B 90 00 14 141 mov dptr,#(_a + 0x0014) 000E EA 142 mov a,r2 000F F0 143 movx @dptr,a 0010 A3 144 inc dptr 0011 EB 145 mov a,r3 0012 F0 146 movx @dptr,a Is this what you meant by "XBYTE macro" (okay, in this particular case it would be XWORD perhaps)? Jan |
| Topic | Author | Date |
| sdcc internal error / C syntax | 01/01/70 00:00 | |
| legality of indexing NULL pointer | 01/01/70 00:00 | |
| bug | 01/01/70 00:00 | |
| version | 01/01/70 00:00 | |
| version revisited | 01/01/70 00:00 | |
| thank you | 01/01/70 00:00 | |
| Fixed | 01/01/70 00:00 | |
| no snapshot | 01/01/70 00:00 | |
| works | 01/01/70 00:00 | |
| 0 is special - but so is NULL. indexing around NULL is bad | 01/01/70 00:00 | |
| No guarantee that a NULL pointer points to any memory | 01/01/70 00:00 | |
| time | 01/01/70 00:00 | |
| I know :-( | 01/01/70 00:00 | |
| Use of __at ? | 01/01/70 00:00 | |
| What is "that way"? | 01/01/70 00:00 | |
| the antique version.... | 01/01/70 00:00 | |
| XBYTE macro | 01/01/70 00:00 | |
| Okay, then the following definition... | 01/01/70 00:00 | |
| RE: David's remarks about volatility | 01/01/70 00:00 | |
| Close, but no cigar | 01/01/70 00:00 | |
| Avoid the 'volatile' | 01/01/70 00:00 | |
| instead of offsetting... | 01/01/70 00:00 | |
| Dereferencing a '_REG | 01/01/70 00:00 | |
I agree | 01/01/70 00:00 | |
| Use of __at ? [ed] | 01/01/70 00:00 |



