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); } }
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?