??? 01/13/07 03:26 Read: times |
#130763 - Tell me something I don't know! Responding to: ???'s previous message |
Purushottam,
You've manged to piss off two people in very short time. One, learn to read - the code I posted wasn't written for a 2051/4051! That was left to Ralph to figure out. And I don't store messages in rom as hex! There was a routine called 'pstring' - load dptr with the code address and call. The string is terminated by a null. And, yes, there's a ton of ways I could've saved a few cycles here and there - my time is best served solving the problem and writing code that works - I've probably been doing this for many more years than you have. One day you'll understand that writing the tightest, most efficient assembler doesn't get the job done faster - especially when we're talking about a LCD - so what if you save 5uS for something that you have to wait for anyway! If you looked closely, my method of doing the nibble stuff means I can use any port pin - I traded some flexibility for code size. The project that code came from had 8k flash - the code came in at 6k, then a new part came out with 62k flash, so I rewrote the code in 'c' - 12k code - and still worked comfortably on a 12mhz,12clock cpu - saving cycles meant little overall and writing in 'c' means other engineers can modify and maintain the code easily without having to tackle assembler. I'm sure I know how to 'and' and 'or' - would you like me to show you how to design a cpu from 7400 'nand' gates? My days of squeezing code into a '2051 stopped 10 years ago - and I used to do this a lot. Nowadays, there's plenty of cpus with a stack of flash and ram for little money - why write in assembler? If you like the intellectual challenge - fine, but what is the exercise? For me it is getting the job done in the least time - my wage is expensive compared to the cost of the cpu. If the software costs $15000 to write, that buys a few cpus - mind you, if you're making 100,000 units then saving some dollars on the cpu is wise. So, please, don't tell us how to 'suck eggs' - you added nothing to the discussion. You could've posted your own code for critical acclaim and solved Ralph's problem. |