??? 07/23/09 05:01 Read: times |
#167729 - In that case, where's the benefit? Responding to: ???'s previous message |
Yes, you'd use different syntax, but once you've been programming for a while, you have accumulated a few megalines of macros that allow you to write, with one line, whatever a fucntion in 'C' might allow. It seems to me that the majority of questions about 'C' for the 805x that have appeared here have been about using 'C' libraries and intrinsics. Once you've written an ASM macro, you can reuse it. No doubt, you can do that in 'C' or any other HLL.
Just how would you write a function in 'C' that switches to the "other" DPTR, sets it to auto-increment, defines that DPTR value, moves data from location 0xAAAA to @DPTR 256 times, with interrupts enabled, and then restores DPTR to its prior state? This is not a convenient time for me to show you the code, as I'm in the midst of moving, but you see what I mean. I'd guess it takes very nearly the same number of lines of 'C' as it would in ASM, perhaps more, and, in fact, it might be best written in ASM in any case. I'd be surprised if the resulting code weren't considerably larger if it weren't done in ASM. RE |