When I went through the ST10 C-compiler document, I am not clear how the near, far & huge address are identified while it executing in the target. Could any one please clarify me?
When I read the C-Compiler document I understood in the following way. For near data 16 bit address will be generated,14th & 15th bit is used to find the DPP register so 14bit offset and 10 base address is taken DPP point page and the data is accessed. For far data 24 bit address is generated and address arithmetic is performed on the 24 bit. 14bit is used as offset and one DPP is temporally used. For huge data no address arithmetic is performed. But while executing in the target how the MCU identifies the address is near, far, huge?
There is no runtime pointer type identification. The compiler must know the type of each pointer at compile time. Where the pointer type is not specified, it is assumed to be the default pointer type for the selected memory model.
- mike
Hi,
Thanks for the information, but I will give a example.
If the data is near, it is will generate 16bit address, this will be done by the compiler, but while executing in the hardware 15th and 14th bit is used to identify the DPP. So if the 15th bit = 0, 14th bit = 1, then the value is 01. DPP1 will be selected and the base address will be taken from the DPP1 and the remaining 14th bit will be offset. So the access is restriced to 16k.
For Far data address, 24bit address will be generated by compiler. Address arithmetic is performed and one DPP will be temporally used so 24bit will be seperated to 14bit offset and from DPP the base address will be taken. So the access is restriced to 16k.
For huge data address the 24bit address is generated by compiler. Address arithmetic is not done.So can access till 16MB.
How this identification is done by MCU?