sir ,
i want to add to data from the external memory. so i need correct format for this controller
XBYTE[0x1234] = 0x55; XBYTE[0x1245] = 0x11;
how to add this data and save it to another memory
Why are you using XBYTE? Why don't you define variables instead? eg,
unsigned char xdata addend; unsigned char xdata augend; unsigned int xdata sum; addend = 0x55; augend = 0x11; sum = addend + augend;
See: http://www.keil.com/support/man/docs/c51/c51_le_xdata.htm
If the absolute location in XDATA matters, use the _at_ keyword: http://www.keil.com/support/man/docs/c51/c51_le_absvarloc.htm
sorry sir. i had concentrate in some other work. so i had using new thread list.then coming to my point. i want a data for ex 0x55 is data. i want to get the data from particular memory location. so i have using XBYTE. But ur ans coding is the data is transfer through acc. it is corect. but i want
addend is store in the particular memory address &
augend is store in the another memory address and
result sum is stored in some other memory location
#include<stdio.h> #include<reg51.h> #include<intrins.h> unsigned char xdata addend; unsigned char xdata augend; unsigned int xdata sum; void main() { addend = 0x55; augend = 0x11; sum = addend + augend; }
Why not describing the problem you are trying to solve, instead of telling us details such that you want the data transfered through the accumulator?
If you give the picture, people can help solving the problem.
View all questions in Keil forum