This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

how to initialize a pointer using data page mode


Hi all,

When compiling a C code containing a global declaration like:
char *s = "abc";
The assembly code will be
	.section .rodata

.LC0:
	.ascii "abc\0"
	.section .data
	.align 1
_s:
	.long	.LC0
where the real address of string constant is kept in _s. However, in
the processor I am porting GCC to, there is a memory mode, data page
mode, which combines 14 LSB of the first word with 10LSB of the second
word to make a read address. So, how to make GCC generates for _s
like:
_s:

      .int POF:.LCO
      .int PAG:.LCO
and how to make assembler or linker accepts such an initialization.
The assembler can accept the prefix POF and PAG now if they are in the
assembly code like
mov r2, PAG:_s
mov r3,POF:_s
but it cannot accept such a prefix in the initialization.

Best regards,
Phung


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]