From: <sdc...@ya...> - 2003-01-19 12:24:19
|
Hi, I was able to pass the address using variable to the XBYTE instruction for storing value at that particular location. Here is my Code :-))) karthik.c ========= #include<stdio.h> #include<8051.h> #define XBYTE *(xdata unsigned char *) unsigned char _sdcc_external_startup() { return 0; } void main(void) { xdata km; km=0xA000; while(km!=0xA00f) { XBYTE(km)=0x0004; km++; } } THus i was able to store 0x0004 in the locations starting from 0xA000 to 0xA00f. The Point to be Noted - I declared the variable 'km' as xdata type. If u declare that 'km ' variable 'as unsigned char km' or 'xdata unsigned char km', u will not get the value stored at that particular address even though the program gets compiled correctly. A small declaration problem . karthik bala guru tka...@ya... ________________________________________________________________________ Missed your favourite TV serial last night? Try the new, Yahoo! TV. visit http://in.tv.yahoo.com |