To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.scoutOpen lugnet.robotics.scout in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Scout / 37
36  |  38
Subject: 
Using NQC with Scout
Newsgroups: 
lugnet.robotics.scout
Date: 
Sat, 4 Dec 1999 03:30:50 GMT
Viewed: 
1953 times
  
It appears that the download protocol and control structure bytecodes are
identical between the RCX and Scout.  This means that NQC can be used
as-is to generate some Scout code.  There are a few caveats, however...

1) You'll need to put the Scout into Power mode, and also "unlock" it with
the boot command.  You can do this using NQC:

nqc -raw a54c45474fae

The Lego tools probably also unlock the Scout, but I haven't used them, so
I can't say for sure.  Once unlocked, you're ready to download using NQC.


2) There are some things that the RCX has, that the Scout doesn't, such as
configurable sensors.  As a result, NQC is perfectly happy to let you
write something like

SetSensor(SENSOR_1, SENSOR_ROTATION);

and it will download some bytecodes to the Scout that are meaningless at
best.  I don't know how the Scout handles unknown bytecodes - perhaps it
just stops dead in its tracks.  Anyway, use at your own risk.


3) NQC doesn't know about the whole local variable thing.  All variables
are equal, and you don't have much control over whether they are global or
local.  I'll probably add some support into NQC to allow better control
over variable placement, but this will take some thought.  BTW, Lego still
hasn't given us *real* local variables - I mean something on a stack.
This precludes any sort of decent subroutine generation and recursion
<sigh>.  The "locals" are still ok for passing parameters to subroutines,
but this is pretty hideous - think of those as "registers" rather than
local variables.


4) NQC doesn't know about any of the new bytecodes.  Things like 'playv'
or 'light'.  Overall, most of these should be relatively easy to implement
as inline functions that translate to the NQC assembler.  If you browse
through rcx.h you'll see how this was done for the RCX.  I'll probably add
suitable definitions for Scout functions as well (and a compile time
symbol to determine which target you're on similar to cybermaster support
in NQC).


5) NQC's listing is completely divergent from the LASM mnemonics.  I guess
this was inevitable since I just guessed at opcodes.  Now that we have
some official names for the bytecodes, I'll adjust the disassembler to
produce code that looks more like LASM.

Dave Baum

--
reply to: dbaum at enteract dot com



Message has 1 Reply:
  Re: Using NQC with Scout
 
Dave Baum <dbaum@spambgoneenteract.com> wrote in message news:dbaum-031299213...act.com... ... (...) Yes, the lego tools do this too. (...) Registers are a good way to think of them. I wish we had a stack too. We will need to access these for NQC (...) (25 years ago, 4-Dec-99, to lugnet.robotics.scout)

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