[Icc-mot] GNU to ICC

Oskar Atkinson oskar at atk-it.com
Sat Feb 16 21:35:01 PST 2008


Hi folks,

My project of porting a app compile with GNU to ICC was on hold for a
while, but now I finally need to tackle it ..

With the info I go here - Thanks Edward - I am able to compile most of
the files.

First, what would be the recommended reading/newsgroup/website for
someone who developning biz software for windows and has no idea about
microprocessor proamming yet 


In the moment still a lot of questions open:

The chip is a MC9S12C64MFA	- which target device configuration
shoul I select ?

In the app, a ot of constants are forced ito several custom ( non
standard ? ) memory locations.
Does the -b linker option work to specify multiple areas?
Here is a snippet form the GNU makefile

--change-section-lma .lookup=0x3Ca400 
--change-section-lma .text3c=0x3C8000 
--change-section-lma .text3d=0x3D8000 
--change-section-lma .text3b=0x3B8000 

Or leave the whole stuff alone and let the linker do his job?


Then, I still have trouble with some of the inline asm code

Number one:

           __asm__ __volatile__ (
                    //                "ldx    %1\n"
                    "ldab   %2,x\n"
                    "clra\n"
                    "ldy    %3\n"
                    "emul\n"
                    "ldx    #100\n"
                    "ediv\n"
                    "tfr    y,d\n"
                    "addd   %4\n"
                    : "=d"(tmp3)
                    : "x"(ATD0DR5),
                    "m"(egofactor_table[0]),
                    "m"(flash4.egomult),
                    "m"(flash4.ego0)
                    : "y" );

My try: ( maybe should say guess .. )

           asm(
		        "ldx  ATD0DR5\n"		
                    "ldab    egofactor_table[0],x\n"	
				\\ error: invalid character '[', if I am
using a ptr to egofactor_table, I am getting illegal addressing mode
				\\ the GNU sytax for ldap seems to be
different - 
                    "clra\n"
                    "ldy    flash4.egomult\n"
                    "emul\n"
                    "ldx    #100\n"
                    "ediv\n"
                    "tfr    y,d\n"
                    "addd   flash4.ego0\n"
			  "std	tmp3\n"
		);



Number two:

/*		
        __asm__ __volatile__ (
                "clra\n"
                "ldab %1\n"
                "tfr d,x\n"
                "dex\n"
                "ldab %2,x\n"
                "stab %0\n"
                : "=m" (t1)
                : "m" (rtsci), "m" (txbuf) );
*/
        asm(
                "clra\n"
                "ldab rtsci\n"	
                "tfr d,x\n"
                "dex\n"
                "ldab txbuf, x\n"	// illegal addressing mode
                "stab t1\n"
		);

Thanks for any hints

Oskar



More information about the Icc-mot mailing list