I know, there is a restriction "No Label address in datasection (?Label)". Maybe, I have a solution for that. I've analyzed a bit. The following code works with ASM backend, but not with the C backend.
Code: Select all
Structure Inner
b.i
EndStructure
Structure Struct
a.i
*inner.Inner
EndStructure
Define *var.Struct
*var = ?Struct
Debug *var\a
Debug *var\inner\b
DataSection
Struct:
Data.i 105213214
Data.i ?Inner
Inner:
Data.i 42
EndDataSection
Code: Select all
unsigned char pb_data[] = {30,109,69,6,0,0,0,0
,l_inner // <<-----
,42,0,0,0,0,0,0,0
};
I tried to set the data to 0 first and manipulate it after:
Code: Select all
Structure Inner
b.i
EndStructure
Structure Struct
a.i
*inner.Inner
EndStructure
; ====== CHANGE ======
! char *pointer = &pb_data[16];
! memcpy(&pb_data[8], &pointer, 8);
; ====== END ======
Define *var.Struct
*var = ?Struct
Debug *var\a
Debug *var\inner\b
DataSection
Struct:
Data.i 105213214
Data.i 0;?Inner ; <====== CHANGE ======
Inner:
Data.i 42
EndDataSection
Thanks and best regards
Kevin