To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.spyboticsOpen lugnet.robotics.spybotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Spybotics / 173
172  |  174
Subject: 
Re: Spybotics to RCX message
Newsgroups: 
lugnet.robotics.spybotics
Date: 
Wed, 15 Jan 2003 16:25:36 GMT
Viewed: 
6424 times
  
Hey cool, Mark, this is really going to be useful!

I've noticed that when MindScript generates a call to
the SendRCXMessage subroutine, it always pops the
calling parameters off the stack.  For example, this
MindScript code:

SendRCXMessage(5)

generates this LASM:

push 2,5
calls 37  ;SendRCXMessage
pop 1

You might want to try adding something like the
following line to the end of your routine(s):

  asm { 0x01, 1 };  // pop 1

You probably wouldn't notice a nything odd until
the stack underflowed.  I think 80 stack parameters
or so is the limit before there's a problem (i.e. the
task is terminated).

Cheers,

Mark (the other one)

"Mark Ferris" <markdf2001@yahoo.com> wrote:

The following NQC code will define a routine to send a message to the
RCX or Scout:

// Sends an RCX PBMessage to RCX or Scout
// nMessage = 1 - 255
__nolist void SendRCXMessage (const int nMessage)
{
  asm { 0xe3, &nMessage };
  asm { 0x17, 37 };
}


I'm busy making API .nqh files to get access to the ROM subroutines.
So far I have them divided into utility functions (such as the one
above) that do not need any of the ROM defined variables and engine
functions, which do . The engine functions implement the game engine
that the Spybots progam uses.  Lots of useful stuff there.  I have  a
lot more calls already defined, I just have to test them more before
posting them.   I thought I'd just jump in and post this one because I
remember the statement being made at one point that it might not be
possible to send a standard RCX message out from a Spybot.



Message has 2 Replies:
  Re: Spybotics to RCX message
 
Just erased 3 lines of reply now that I've remembered my basic assembly stuff ... boy it's been a while. Yes, that sounds like the right thing to do. Just curious, I haven't installed the Mindstorms SDK since I try to minimize what all I've (...) (21 years ago, 16-Jan-03, to lugnet.robotics.spybotics)
  Re: Spybotics to RCX message
 
Ok, I give up. How did you get the LASM output from the Mindscript? I installed the SDK, but didn't find any way to get the LASM output, which is what I'd like to see. (...) (21 years ago, 20-Jan-03, to lugnet.robotics.spybotics)

Message is in Reply To:
  Spybotics to RCX message
 
The following NQC code will define a routine to send a message to the RCX or Scout: // Sends an RCX PBMessage to RCX or Scout // nMessage = 1 - 255 __nolist void SendRCXMessage (const int nMessage) { asm { 0xe3, &nMessage }; asm { 0x17, 37 }; } I'm (...) (21 years ago, 15-Jan-03, to lugnet.robotics.spybotics)

5 Messages in This Thread:


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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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