??? 09/14/04 22:07 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#77399 - RE: Optimising for 8052 Responding to: ???'s previous message |
Vico Lupori said:
I have already searched in the Keil Forum and I found that a guy named Graham Cole has written a MD5 routine for 8051 micro in under 2k of code. Cross post: http://www.keil.com/discuss/docs/thread4995.htm Vico Lupori said:
The standard MD5 routine that you can grab from the net gives very bad result with Keil cross compiler Almost any "standard" code that you just grab off the net (or anywhere else) is almost certain to give "poor" results with any 8051 'C' compiler! :-( "Standard" code tends to use int by default; a Keil int is 16 bits - so this is obviously a Bad Thing on an 8-bit processor! You should only ever use >8-bit variables when you really need to. Similarly, avoid signed Graham's fast_long_roll() will certainly help you in beating the code into shape: http://www.keil.com/discuss/docs/thread1252.htm Another thing that can significantly reduce your code size is careful consideration of the memory spaces used for your variables. Remember, DATA is not only much quicker than XDATA, but also uses far less code space! Try to get all your most-used variables into DATA space. There is a whole chapter at the back of the Keil C51 Manual on writing optimum code for the 8051. There have also been plenty of threads both here and at Keil; eg, http://www.8052.com/forum/read.phtml?id=71821 (note particularly the IAR article, Getting the Least Out of Your C Compiler). |
Topic | Author | Date |
MD5 for 8052 | 01/01/70 00:00 | |
RE: MD5 for 8052 | 01/01/70 00:00 | |
RE: MD5 for 8052 | 01/01/70 00:00 | |
RE: Optimising for 8052 | 01/01/70 00:00 | |
RE: MD5 for 8052 | 01/01/70 00:00 | |
RE: MD5 for 8052![]() | 01/01/70 00:00 |