Using Assembler
Up to M32C
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
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.
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,,,,
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.
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
plus,
how can i use the .section command, what are .section program,code , .section mem,data,.section const,romdata???
thanks
Question1: I don't care
Question 2: Assembler User's Manual page 22ff , Compiler User's Manual page 33ff
thanks i can learn commands , but i have questions ,
what are the a0,fb,sb exactly ? when will we use which one??

