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 / 10
9  |  11
Subject: 
Re: One Big Program
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Tue, 23 Feb 1999 06:26:15 GMT
Viewed: 
2377 times
  
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
bytecodes for the interpreter - not H8 opcodes.  I don't know of any way
to execute arbitrary H8 code from a program running within the
interpreter.

In fact, one of the principle goals of the interpreter must have been to
provide a "safe" execution environment.  As an example, if you generate
bytecodes that try to jump outside of a task's code fragment, the
interpretter just stops the task.

Dave

In article <F7LEE8.71q@lugnet.com>, david.harry@ucdmc.ucdavis.edu (David
Harry) wrote:

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...

--
reply to: dbaum at enteract dot com



Message is in Reply To:
  One Big Program
 
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 (...) (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