??? 06/17/09 07:01 Read: times |
#166170 - When I was a youngster ... Responding to: ???'s previous message |
Per Westermark said:
Richard said:
If you can't write your program in ASM, you don't know what you're doing. That doesn't mean a programmer shouldn't use HLL's, but it does mean he should know quite well what the resulting ASM should be. Trying to write a delay loop in a HLL is clear evidence of what a person doesn't know. If you work as a software professional, you may have to support 10 different products using 5 different processor architectures. Some may have 8-pin microcontrollers with a couple of hundred bytes of flash. Some may run a full Linux system. With a full-blown GNU/Linux system on a PPC, you don't spend the time learning to code in assembler unless you have a strong reason to. On the 8-pin processor, you made the processor choice with the intention that nothing but assembler would be used. Back when I was starting out, it was necessary to know, by heart, all the instructions for all the CPU's that one claimed to know and understand. I don't just mean the mnemonics, but it was necessary to be able to sit down, and, from memory, write the hex codes so they could be entered via a debugger. There often weren't even assemblers available when a field fix had to be worked out, and in those days, one had to know 8080, 6800, 3870, 2650, 8x300, and sometimes even 1802. There were others, but if you got a job, it had to be done in less time than it took to obtain and learn the manufacturer's tools, and the hardware on which it ran often was too costly, since there weren't any popular PC's ... yet. After a time, of course, there was CP/M ... but it was years before there were HLL cross-compilers. A number of cross-assemblers came first, but not for some time. Never make life so easy as assuming that assembler knowledge for a specific processor is a requirement to be a competent programmer. That just means that you have focused too narrowly on details. Now we're back to that delay loop issue. If you know your environment and your compiler, and are sufficiently familiar with the core, then you know when you have to write a function in ASM. A delay loop is a good example. David Prentice said:
I would suggest a polite refusal would be more appropriate than dropping hints. I strongly disagree with this opinion. I have done quite a lot of projects in quite a number of fields. With your view, I would have to politely refuse helping with a very large number of questions. Any competent receiver would gain quite a lot from receiving knowledgeable hints. A big part of development is to recognize the bad solutions, and avoid them. Giving someone the hint that "what would happen if xx happens", can help someone to avoid falling into a deep pit, while at the same time helping them analyzing a problem and building the required knowledge to be able to find a solution on their own. When you were in school, the teacher didn't walk to each student and said that the answer to the math problem was 17. He/she instead pointed at a part of your equation and noted that you had an incorrect sign, or where doing an incorrect simplification. You don't gain knowledge without own work. And in the end, you do need that knowledge. The alternative to getting that knowledge is to be a buyer and pay for solutions. But even a buyer needs knowledge - without knowledge, you will not kwow what you buy or if the price is good or bad. It's all about knowing what the MCU can do, what the ASM can do, and what the HLL compiler can't do. Once you have that in your head, you're on your way. However, if you can't do it in ASM for your particular MCU, you probably can't do it in HLL either. Nothing points that out any better than using several different MCU cores. If you want to stick with a compiler you know, there aren't many that will support 68HCx08, 805x, and the various PIC's. You have to be smart enough to deal with each one in ASM before you can even understand the differences. RE |