Personal tools
You are here: Home Forums M32C Using Assembler

Using Assembler

Up to M32C

Using Assembler

Posted by genius2005 at July 25. 2008

hello to everyone,  i am using m32c87 ,  in assembler , how can i identify the variables, how can i allocate ram blocks and  what are the things which i have to make first before i do not begin to program 

please explain,  i read the datasheet , but i can not understand these topics

thanks  thanks

Re: Using Assembler

Posted by FrankL at July 25. 2008

You really don't follow advice if you don't like it, don't you?

M32C/87 has up to 1MB of memory. You don't want to write 1MB assembler code?

Assembler does not know anything about variables or functions or things like that. In assembler there are only symbols. These symbols can either represent a ROM or RAM address.

RAM is reserved using the pseudo instructions like blkb (1 byte units), blkw (2 byte units) blka (3 byte units), blkl or blkf (4 byte units), blkd (8 byte units).

For the basic initialisation you can use ncrt0.a30 and sect308.inc, which are also used in C programs. This gives you a frame you can expand for your application.

If you want to write assembler code you should read the as308 user's manual and the M32C/80 series Software Manual.

Re: Using Assembler

Posted by genius2005 at July 25. 2008

thank you very much

Re: Using Assembler

Posted by genius2005 at July 28. 2008

the thing which i wonder is  how i can identify the valiables,  in C  we can write    int i,j ;     it is enough ,

 but how is it in assembler,,,,

Re: Using Assembler

Posted by FrankL at July 28. 2008

In assembler there are no variables. Yopu only have symbols related to a certain address either in RAM or in ROM. You have to know by yourself if this is to be treated as char, int, long and reserve the correct space for it.

The assembler does not know variable types, and it makes no check if you access the correct size. This is all up to you.

Re: Using Assembler

Posted by genius2005 at July 29. 2008

thank you very much for responses  ,

 ok i understood ,  but not exactly ,  for example   

  in C ;          int  i,j;  i=40; j=4;  i=i*j; ;   

  what is the assembler  code of the codes,, how can i write in assemble??? 

thanks again

Re: Using Assembler

Posted by genius2005 at July 29. 2008

plus,

how can i use the   .section  command,  what are .section program,code , .section mem,data,.section const,romdata???

thanks

Re: Using Assembler

Posted by FrankL at July 29. 2008

Question1: I don't care

Question 2: Assembler User's Manual page 22ff , Compiler User's Manual page 33ff


Re: Using Assembler

Posted by genius2005 at July 31. 2008

thanks  i can learn commands ,   but  i have questions ,

 what are the a0,fb,sb  exactly  ?  when will we use   which one??

Re: Using Assembler

Posted by FrankL at July 31. 2008

Please read chapter 1.3 "Register Configuration" and chapter 2.1 "Addressing Modes" in M32C/80 Series Software Manual.

Powered by Ploneboard