Hi all,
This problem may be very simple for c programmers but for a assembly guy like me its very critical. I have a 89S51 board, which have a external static RAM located at 0x2000. I use this for both code and data memory. While assembling any program, I use ORG directive to tell assembler to start the code from 0x2000. This works fine. Now I moved to C (SDCC as no way I can afford KEIL). Now how to tell SDCC to compile the code from address 0x2000 ? I could not find any straight answer. SDCC manual has two command line options:
--code-loc <Value> The start location of the code segment, default value 0. Note when this option is used the interrupt vector table is also relocated to the given address. The value entered can be in Hexadecimal
or Decimal format, e.g.: --code-loc 0x8000 or --code-loc 32768.
and
--xram-loc <Value> The start location of the external ram, default value is 0. The value entered can be in Hexadecimal or Decimal format, e.g.: --xram-loc 0x8000 or --xram-loc 32768.
I used these like
sdcc --code-loc 0x2000 --xram-loc 0x2000 serial_101.c
The program serial_101.c compiles successfully, but starting location is 0x0000 as i observed in generated ASM file. I am using Windows7 64 and WindowsXP 32. How this can be achived ? Need your expert advice.
Thanks
Ashok
This problem may be very simple for c programmers but for a assembly guy like me its very critical. I have a 89S51 board, which have a external static RAM located at 0x2000. I use this for both code and data memory. While assembling any program, I use ORG directive to tell assembler to start the code from 0x2000. This works fine. Now I moved to C (SDCC as no way I can afford KEIL). Now how to tell SDCC to compile the code from address 0x2000 ? I could not find any straight answer. SDCC manual has two command line options:
--code-loc <Value> The start location of the code segment, default value 0. Note when this option is used the interrupt vector table is also relocated to the given address. The value entered can be in Hexadecimal
or Decimal format, e.g.: --code-loc 0x8000 or --code-loc 32768.
and
--xram-loc <Value> The start location of the external ram, default value is 0. The value entered can be in Hexadecimal or Decimal format, e.g.: --xram-loc 0x8000 or --xram-loc 32768.
I used these like
sdcc --code-loc 0x2000 --xram-loc 0x2000 serial_101.c
The program serial_101.c compiles successfully, but starting location is 0x0000 as i observed in generated ASM file. I am using Windows7 64 and WindowsXP 32. How this can be achived ? Need your expert advice.
Thanks
Ashok