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 / 221
220  |  222
Subject: 
Re: Sharing variables and using expressions (was Re: NQC 2.0 and some math questions
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Mon, 1 Nov 1999 21:48:44 GMT
Viewed: 
2642 times
  
Thanks, Dave! It will be good to have that in the manual, because it is a very
confusing behavior that is difficult to track down. Variables take on values
that are completely different from the values that the programmer is setting
them to. Most programmers would have been completely stuck.

In lugnet.robotics.rcx.nqc, Dave Baum writes:
The optimization was intentional (and quite a lot of work, actually).  I
know it breaks with multiple tasks, but I was more concerned with keeping
the variable pool from being cluttered with temporaries. [...]
This does warrant additional discussion in the manual, so I will add it
when I get some free time.

In article <FJv8wM.99v@lugnet.com>, "Robert Munafo" <munafo@gcctechNO.SPAMcom> • wrote:

I have discovered a somewhat non-intuitive feature of NQC (in my version, at
least, which is pre-2.0) [...]
var = (20 * var) / 21;
gets compiled into:
MUL var, 20   ; var = var * 20
DIV var, 21   ; var = var / 21
[causing var to sometimes take on an unexpected huge value]



Message is in Reply To:
  Re: Sharing variables and using expressions (was Re: NQC 2.0 and some math questions
 
The optimization was intentional (and quite a lot of work, actually). I know it breaks with multiple tasks, but I was more concerned with keeping the variable pool from being cluttered with temporaries. With only 32 vars to use, its quite easy to (...) (25 years ago, 20-Oct-99, to lugnet.robotics.rcx.nqc)

16 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