| ??? 06/02/00 19:17 Read: times |
#3009 - RE: C or ASM ? |
Franc,
i can only agree with you. it is true that in some cases, pure asm code can be very effetive, but worse to be supported if time goes by and the projects grows and grows and grows ... you loose control on the location of variables, what var is modified where and needed there .... c has the advantage that you can forget these things in most cases. i have implemented a dozend of state machines in one big source spread over lots of files that are included in several projects. some state machines stick together and are depending on others. no chance to have an overview in pure asm. a look at the generated asm code shows that it would be very hard to do that better in pure asm, not speaking of the time it takes. the whole stuff of pointers to vars is 100% under control of the compiler, no need to worry about that (does dpl/dph point to the right adress after some function calls ? i agree that it would be fun to implement it in pure asm, but what about a system that has only the tcpip in it ? i guess the system has more to do than just echo a ping ... so if the source is done with as much c as possible (especially the var handling), the bug hunting in different target systems will be faster. not everybody wants to have the coffee machine online :-) somebody his tee machine, microwave oven .... :-) i was a asm freak in the early 80's, gave me more pleasure than everything else to make it as fast as possible, but a pure c function has the big advantage that somebody else can give support without the need of knowledge of the target cpu. everybody who knows c can help. swap to a different cpu 8051 -> 80251, OK change some compiler options, run it, thats it ... go to : http://www.titro.de/ethernet/ werner cornelius has a web page about his tcpip project. Reagrds Michael Schmitt |



