cancel
Showing results for 
Search instead for 
Did you mean: 

Adding text in your code (Assembler)

brian4
Associate II
Posted on April 10, 2003 at 17:00

Adding text in your code (Assembler)

12 REPLIES 12
csameling
Associate II
Posted on April 10, 2003 at 12:52

Thanks Spen!

And if I want to make four different strings one behind the other:

is this right or not:

+seg .firm -b 0xf000 -n .firm # special const section

+seg .autor -a .firma -n .autor # special const

+seg .version -a .autor -n .version # special const

+seg .kunde -a .version -n .kunde # special const

+seg .text -n .text -a .kunde # program code

+seg .const -a .text # constants follow code

#pragma section const {firm}

const char * const pString = ''testfirm'';

#pragma section const {autor}

const char * const pString = ''Ampel'';

#pragma section const {version}

const char * const pString = ''1.0.0.'';

#pragma section const {kunde}

const char * const pString = ''ST Micro'';

#pragma section const {}

???

regards

sjo
Associate II
Posted on April 10, 2003 at 16:59

All you would have to do is:

+seg .str -b 0xf000 -n .str # special const section

+seg .text -n .text -a .str # program code

+seg .const -a .text # constants follow code

#pragma section const {str}

const char * const pData[] = {

''testfirm'',

''Ampel'',

''1.0.0.'',

''ST Micro''

};

or why not

const char* pString = ''testfirm Ampel 1.0.0. ST Micro'';

#pragma section const {}

Regards

Spen

sjo
Associate II
Posted on April 10, 2003 at 17:00

All you would have to do is:

+seg .str -b 0xf000 -n .str # special const section

+seg .text -n .text -a .str # program code

+seg .const -a .text # constants follow code

#pragma section const {str}

const char * const pData[] = {

''testfirm'',

''Ampel'',

''1.0.0.'',

''ST Micro''

};

or why not

const char* pString = ''testfirm Ampel 1.0.0. ST Micro'';

#pragma section const {}

Regards

Spen