DEAR TO ALL, I AM DEALING WITH C8051F120 MICROCONTROLLER.UTILIZING 16 X 16 MAC ENGINE OPERATION.I AM DOING ASSEMBLY LANGUAGE PROGRAMMING USING THIS MICROCONTROLLER FOR MULTIPLICATION. IS IT POSSIBLE TO MULTIPLY TWO UNSIGNED 16 BIT INPUTS? IF YES, THEN HOW ?
After reading the part you pointed out,i got confused that whether MAC0SC and MAC0RS are equal because no where i saw any further description about that bit.
MAC0SD and MAC0RS seem to refer to the same bit (the one that controls the direction of the bit-shifts). MAC0SC is the bit that actually triggers the bit shift.
ACALL and LCALL how we utilize in program?
You can use ACALL to call a subroutine within the same 2 kB page of the code memory. Else you have to use LCALL. ACALL and LCALL take the same number of processor cycles, but ACALL only takes two bytes, while LCALL takes three.
because i have to reduce execution time
ACALL and LCALL have the same execution time.
guide me for this question : how many ways we can reduce code size
That is a question that's usually treated in large books. Especially since you also say that you need to reduce the execution time, too - quite often, you need to make a tradeoff between code size and execution time.
You can unroll loops, which makes the program faster, but larger, for example.
You can use macros instead of function calls, which also makes the program faster, but larger.
You can calculate any math functions you need, or you can use lookup tables. The former usually leads to slow, but small code, while the latter takes up a lot of space, but can be very fast.
"That is a question that's usually treated in large books."
It is a common fallacy that the mere act of writing in assembler will inherently give you fast, tight code.
This is simply not true: it takes a great deal of skill and experience to write fast, tight code in any language! Sure, assembler gives you more opportunities - but you need to know how to use them!
If you need to ask basic questions like how to use ACALL and LCALL, you're probably not quite ready to be turning out super-optimised code...
You might even find that the compiler can do a better job - especially with optimisations enabled (but then that gives you the issues with debugging - which comes back to skill & experience)