??? 05/17/04 04:52 Read: times |
#70455 - RE: use of PC or DPTR Responding to: ???'s previous message |
I think Michael pretty well summed it up. I've been disassembling a bosch fuel injection box and it seems they only use the pc offset for small, local lookup tables like a bit mask. I'd never used the pc offset method so when I saw it I had to look up my opcode reference just to make sure it was kosher!
As an aside, for many years I used to write the most optimal assembler I could as I didn't want to waste precious machine cycles. As my programs become larger (>1k) I found maintaining and adding features to my code became rather difficult. I had also started looking at 'c' compilers and I looked at the code these generated which I found to be far from optimal. After doing a bit of reading, it dawned on me that most of your code doesn't need to be super optimal and writing more generic code makes for easier maintainability and less bugs. I also adopted the compiler's rules for passing parameters to subroutines. Nowadays I tend to use 'c' for most of the coding and leave assembler to the small time critical tasks. Where space is limited I'll write in 'c' then hand compile in assembler just to squeeze the functionality in. The issue of code size and speed is becoming less of an issue as there's lots of micros with enough flash, ram and performance to take care of most tasks without having to count cycles. |
Topic | Author | Date |
use of PC or DPTR | 01/01/70 00:00 | |
RE: use of PC or DPTR | 01/01/70 00:00 | |
RE: use of PC or DPTR | 01/01/70 00:00 | |
RE: use of PC or DPTR | 01/01/70 00:00 | |
RE: use of PC or DPTR | 01/01/70 00:00 | |
RE: use of PC or DPTR | 01/01/70 00:00 | |
RE: use of PC or DPTR | 01/01/70 00:00 | |
RE: use of PC or DPTR | 01/01/70 00:00 | |
thanks | 01/01/70 00:00 | |
can we make three four lookup tables | 01/01/70 00:00 | |
RE: can we make three four lookup tables | 01/01/70 00:00 | |
RE: can we make three four lookup tables | 01/01/70 00:00 | |
RE: can we make three four lookup tables![]() | 01/01/70 00:00 |