To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 9
8  |  10
Subject: 
One Big Program
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Tue, 23 Feb 1999 05:39:44 GMT
Viewed: 
2293 times
  
I'm going to follow Dave's suggestion in an earlier post, and post to this
group, on an issue I raised to him earlier:

The three principal limitations to "large" program development on the RCX
are:
1. 32 variables globally
2. 8 subroutines/ program
3. 10 tasks / program

The one I find most limiting is the 8 subroutine limit.  I'm wondering if,
using the inline code generation capabilities in NQC (i.e., asm (xxxx, yyyy,
etc..)), it would be possible to "fake out" the RCX and allow a single
program to use all 40 available subs on the RCX.  Essentially do the
following:

Program 1 (one of up to 4 programs containing only subroutines)
task main
{
......
}
sub1
{
etc.
}
sub2
{
etc.
}
}

Program 5 the "real" program:

#define SUB1 asm(xxx,yyy,zzz)
#define SUB2 asm(aaa,bbb,ccc)

task main
{
..
SUB1
etc.
SUB2
...
}

The defines would inline the "call addr(sub1)", resulting to a call to
external subroutines in another program.  Due to the linear addressing model,
no memory managment, etc., I see no reason why this won't work. Since the
variables are all global with respect to all programs, as long as they are
declared in the same order in each program, they would be available to the
main and all sub's. The absolute addresses of the subroutines could be
obtained from the RCX memory map and defined in compile time "define"'s.

Well, it is cludgy, but what do you think?  If this will actually work, I
would very much appreciate it if someone would post the proper H8 opcode for
"call xxxx", including proper endien order for address xxxx. I know I could
probably dig this out of the microprocessor docs somewhere, but, surely,
someone reading this list has it handy...



Message has 1 Reply:
  Re: One Big Program
 
Small misunderstanding... The RCX firmware contains a small interpreter which runs "RCX bytecodes". These are very different from H8 machine language. NQC generates code that runs within the interpreter, and asm statements just generate raw (...) (26 years ago, 23-Feb-99, to lugnet.robotics.rcx.nqc)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR