version:
SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/gbz80/tlcs90/ez80_z80/z80n/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15 4.1.6 #12533 (MINGW32) published under GNU General Public License (GPL)
test.c
unsigned char message[20] = "Hello, world";
commandline:
sdcc -mgbz80 --asm=rgbds --codeseg ROMX --no-optsdcc-in-asm --no-std-crt0 --fsigned-char -I libc/include -S -o srcs/test.asm srcs/test.c
result:
;-------------------------------------------------------- ; ram data ;-------------------------------------------------------- SECTION FRAGMENT "_INITIALIZED",ROM0 _message: DS 20
ROM0 is incorrect, WRAMX is expected like this:
;-------------------------------------------------------- ; ram data ;-------------------------------------------------------- SECTION FRAGMENT "_INITIALIZED",WRAM0 _message: DS 20
obviously, because it is a RAM, not ROM.
ps: also data should go to WRAM0, not WRAMX, but that is a minor problem:
/sdcc/src/z80/main.c line 646:
options.data_seg = Safe_strdup ("WRAMX");
to:
options.data_seg = Safe_strdup ("WRAM0");
sorry, typo: WRAM0 is expected.