This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RTX-51 Tiny & inline asm

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);
	}
}
Then I checked Generate Assembler SRC File & Assemble SRC File in Options for File 'Test.c'. Then I added a dummy C module Dummy.c, which declares a never created/called task, in order to get the approriate C libraries and RTX-Tiny library be linked to my program:
#include <RTX51TNY.H>

void dummy_task(void) _task_ 0x0F
{
	while (1) {
		os_wait(K_SIG, 0, 0);
	}
}
When I built the program, there was a warning:

Build target 'Target 1'
assembling STARTUP.A51...
compiling Test.c...
assembling Test.src...
compiling Dummy.c...
linking...
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?TEST_TASK?TEST
Program Size: data=63.1 xdata=0 code=539
"RTX51ASM" - 0 Error(s), 1 Warning(s).

When I simulated program, test_task() never be reached. So what's the matter and how can I fix it, please?

Parents
  • 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?

Reply
  • 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?

Children
No data