To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 587
586  |  588
Subject: 
Re: Spirit.OCX & Starting a Program
Newsgroups: 
lugnet.robotics
Date: 
Mon, 16 Nov 1998 18:06:37 GMT
Original-From: 
Kekoa Proudfoot <kekoa@Graphics.Stanford.EDU>
Viewed: 
2178 times
  
As far as I know, you can't set and start a different program from within
another program.  Execution stops when you switch programs, so the
following start task instruction will never get reached.

Doesn't the mysterious opcode d2 allow you to do that?  Or am I missing
something?

It does seem to have the correct behavior for both setting and starting a
program.  My earlier description of the d2 opcode was a bit brief.
Reviewing my notes, the "stop all tasks, set current program, run program"
pseudocode is really:

stop all tasks in current program
stop all motors (cc50[] = 4f, cc4d[] = 4f)
set current program number (ccc4)
initialize task starting addresses (cdde[] = cd72[prog][])
get task 0 status to running (ce56[prog][0] = running)
copy task 0 starting address to task 0 pc (cdde[0] = cd72[prog][0])

So variables stay intact.  However, the code in d2 does not appear to reset
the loop counter stack of task zero, which may or may not be of concern.
There are certainly workarounds for this.

-Kekoa



Message is in Reply To:
  Re: Spirit.OCX & Starting a Program
 
(...) Doesn't the mysterious opcode d2 allow you to do that? Or am I missing something? }}Date: Sun, 25 Oct 1998 15:35:08 -0800 (PST) }}From: Kekoa Proudfoot <kekoa@Graphics.Stanford.EDU> }}To: Lego Robotics <lego-robotics@crynwr.com> }}Subject: Re: (...) (26 years ago, 16-Nov-98, to lugnet.robotics)

7 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