I wrote a simple program Test.c using RTX-51 Tiny:
#include <AT89X52.H> #include <RTX51TNY.H> void test_task(void) _task_ 0x00 { while (1) { #pragma asm RLC A #pragma endasm os_wait(K_IVL, 100, 0); } }
#include <RTX51TNY.H> void dummy_task(void) _task_ 0x0F { while (1) { os_wait(K_SIG, 0, 0); } }
"But the aim of writing inline assemby was making program the fastest the possible" <old scratched record> Simply writing in assembler does not necessarily give you faster code; in fact, it's quite possible that a good optimising 'C' compiler can give tighter code than a mediocre assembler programmer. </old scratched record> If you're using an RTOS, that kinda suggests that maybe absolute performance is not really to primary target? Have you checked whether the Compiled 'C' code, with maximum optimisation, actually meets your performance requirements?
I am using RTOS just for ease of time keeping (Round Robin task switch disabled). The current optimization level is 8. I have already checked with levels from 6 to 9 (favor speed) and analysed both size and speed of my prog. Level 8 gave best performance. By the way, I would like to shift a bit into a char from one side and get the bit which is shifted out from the other side. Any suggest for a C code replacement? _crol_ and _cror_ functions only shift bits around. Does << and >> operators do the correct thing?