??? 02/01/06 13:41 Modified: 02/01/06 13:41 Read: times |
#108886 - Pointer hints Responding to: ???'s previous message |
Sorry for duplicate, browser glitch
#define timers (dual_timers *)0x03FF6000 This defines a pointer to a variable of type dual_timer, which I assume is declared elsewhere. Most pointer declarations read from right to left. This pointer is given a specific value as it is probably going to be used to access some memory mapped IO registers. Apart from the fact that the memory address excedds the range of most 8052 variants, there are better ways of accessing IO registers. #define RAM0_ADDR (*(char far *)0x0D0000) This defines a pointer to a variable of type char, and then the first * dereferences the pointer to give you the char. Note that RAM0_ADDR is not a good name because you don't get an address. |
Topic | Author | Date |
Question about pointers with C | 01/01/70 00:00 | |
Eh??? | 01/01/70 00:00 | |
Compiler | 01/01/70 00:00 | |
is that the Keil compiler you are using? | 01/01/70 00:00 | |
Keil compiler | 01/01/70 00:00 | |
keil has '51, '251, '16x, ARM which? | 01/01/70 00:00 | |
A51 | 01/01/70 00:00 | |
You mean C51 ? | 01/01/70 00:00 | |
then what is this addressing? | 01/01/70 00:00 | |
Addressing a RAM chip | 01/01/70 00:00 | |
Addressing a RAM chip | 01/01/70 00:00 | |
ah banking | 01/01/70 00:00 | |
80c51 Addressing | 01/01/70 00:00 | |
Pedantic | 01/01/70 00:00 | |
ridiculous | 01/01/70 00:00 | |
because![]() | 01/01/70 00:00 | |
Dereference | 01/01/70 00:00 | |
Pointer hints | 01/01/70 00:00 | |
No, that's wrong | 01/01/70 00:00 | |
struct modelling memory-mapped IO | 01/01/70 00:00 | |
I think it is time to stop replies to | 01/01/70 00:00 | |
More pedantically | 01/01/70 00:00 | |
Pointer hints | 01/01/70 00:00 | |
start small | 01/01/70 00:00 |