I'm struggling to wrap my head around RAM access using sdcc. Specifically, I'm trying to read the values of BD0STAT, BD0CNT, BD0ADRL, and BD0ADRH, which are the first 4 bytes of Bank 2 in RAM when the USB module is activated. They are located at addresses 0x200, 201, 202, and 203, respectively.
To try to understand how sdcc handles data memory, I compiled a program in sdcc with the following global variables defined:
and found the corresponding lines in the asm file:
I gather the 0x00 is the bank in RAM the value is stored, but no address or offset is specified. How does the uC know exactly where foo and goo are in bank 0? And back to my original question, what if I know the exact address in RAM (e.g., 0x200) and I want to access the contents of that address?
Thanks,
Dan
To try to understand how sdcc handles data memory, I compiled a program in sdcc with the following global variables defined:
Code:
int foo = 0x12;
int goo = 0x13;
Code:
idata
_foo db 0x12, 0x00
_goo db 0x13, 0x00
Thanks,
Dan