1. The concept that Basic is slow and C is fast is a remnant of the 70's when there were no basic compilers, just interpreters. Although it has bee nreduced to a myth that won't let go, in reality it is now all about which compiler author wrote efficient code--not which language he wrote. Recently someone posted that PBP compiled some code in 460 words, but MikroB wouldn't even fit in the chip. My guess would be that the MikroC would be just as bad, unless they had two compiler authors and one was a lousy coder. BTW, in short code, PBP and Proton are similar... but when it gets long, or you use a mix of Words and Longs, Proton really shines. (And when using interrupts.)
2. That's the article and formula I was talking about. without much tweaking, it was running at the speed I previously quoted. It takes around 400 instructions to do a 32 bit sqrrt on a PIC... only good for buffered or slow moves.
The 18F does save the wreg if you use the Fast Return, but not the variables you are changing and the registers related to them. For instance, if you are in the middle of changing an array value and an interrupt occurs, and you access an array (any array) in the interrupt, you have to save the INDF & FSR registers and anything else PBP uses to manipulate arrays. Proton has this built in, and many PBP users have used the DT Instant Interrupts... which is kind of an oxymoron since all of the saving removes the instant part.Re 'context saving' - if you mean 'wsave' and so on - I don't think it's necessary on the PIC18F8722?
Bookmarks