|
In lugnet.robotics.rcx.nqc, Dirk Schlei wrote:
> Even if it requires a firmware replacement, please add:
>
> - more variables,
> - float type variables,
> - string type variables,
> - certain math library (sin, cos, exp, ...) - at least good approximations,
> - more subs,
> - functions with return values,
NQC is a language/compiler which works with the standard LEGO firmware(s). I
don't anticipate that ever changing.
But here's a glimpse of something new for the Spybot target that might be
interesting to NQC users. Would 256 (or 128, if you want to protect your Spybot
game data) byte-sized storage locations be useful? Because these are byte-size
locations, there may currently be some problems with the tranformations that
certain operators use to calculate their result (such as >>).
#define a @(0x140000 + 0x80)
#define b @(0x140000 + 0x81)
task main()
{
a = 5;
b = 3;
a = a + 1;
a = a << 1;
a >>= 2;
a <<= 1;
a = a % 2;
a %= 2;
a = a + b;
a += b;
a %= b;
a *= 3;
a &= b;
a |= 3;
a ||= b;
b = -1;
a +-= b;
a ^= 0x80;
}
And I still think pointers are cool. I'm currently working on getting them to
work with inline function calls. But a lot of stuff works already.
int i = 30;
task main()
{
int x = 3;
int* y = &x;
// *&x = 4; // not supported
MyFred(y); // not emitted correctly
*y = 4;
int z = *y;
z = 4;
MyFred(&z); // not emitted correctly
//047 setv var[32], 33
//052 setv var[32], 4
// z = (*y)++; // not supported
// z = ++(*y); // not supported
int a[5];
a[2] = 2;
z = x*y;
z = x**y;
z = x & *y;
z = x&y;
y = &a[2];
y = &a;
}
void MyFred(int *x)
{
*x = 4;
// x = &i;
}
|
|
Message has 1 Reply:
Message is in Reply To:
![](/news/x.gif) | | Re: NQC's future
|
| (...) Dear John, Even if it requires a firmware replacement, please add: - more variables, - float type variables, - string type variables, - certain math library (sin, cos, exp, ...) - at least good approximations, - more subs, - functions with (...) (21 years ago, 9-Dec-03, to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)
|
29 Messages in This Thread: ![NQC's future -John Hansen (2-Dec-03 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif) ![](/news/246.gif) ![Re: NQC's future -Mark Riley (2-Dec-03 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC's future -John Hansen (2-Dec-03 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif)
![](/news/x.gif) ![](/news/268.gif) ![Re: NQC's future -Trevyn Watson (3-Dec-03 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC's future -Speedsthatbeat (6-Dec-03 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC's future -Mark Riley (6-Dec-03 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif)
![](/news/x.gif) ![](/news/268.gif) ![Re: NQC's future -Pat LaVarre (6-Dec-03 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC's future -Bapt Denaeyer (7-Dec-03 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC's future -Pat LaVarre (11-Dec-03 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC's future -Bapt Denaeyer (11-Dec-03 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif)
![](/news/x.gif) ![](/news/268.gif) ![Re: NQC's future -Dirk Schlei (9-Dec-03 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif) ![](/news/46.gif) ![You are here](/news/here.gif) ![](/news/46.gif) ![Re: NQC's future -Brian B. Alano (28-Jan-04 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif)
![](/news/x.gif) ![](/news/268.gif) ![Re: NQC's future -Philippe Hurbain (8-Jan-04 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif) ![](/news/46.gif) ![RE: NQC's future -Ralph Hempel (8-Jan-04 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics, lugnet.robotics.rcx.pbforth)](/news/x.gif) ![](/news/46.gif) ![Re: NQC's future -Philippe Hurbain (9-Jan-04 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics, lugnet.robotics.rcx.pbforth)](/news/x.gif)
![](/news/x.gif) ![](/news/268.gif) ![Re: NQC's future -Brian Davis (11-Jan-04 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif) ![](/news/246.gif) ![Re: NQC's future -John Hansen (12-Jan-04 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif)
![](/news/x.gif) ![](/news/28.gif) ![](/news/x.gif) ![](/news/68.gif) ![Re: NQC's future -Dick Swan (12-Jan-04 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif)
![](/news/x.gif) ![](/news/268.gif) ![Ideas for NQC -Nicolas Alvarez (8-Mar-04 to lugnet.robotics.rcx.nqc)](/news/x.gif) ![](/news/246.gif) ![RE: Ideas for NQC -Marco Correia (9-Mar-04 to lugnet.robotics.rcx.nqc)](/news/x.gif)
![](/news/x.gif) ![](/news/28.gif) ![](/news/x.gif) ![](/news/268.gif) ![Re: Ideas for NQC -John Hansen (9-Mar-04 to lugnet.robotics.rcx.nqc)](/news/x.gif) ![](/news/46.gif) ![Re: Ideas for NQC -Nicolas Alvarez (27-Apr-04 to lugnet.robotics.rcx.nqc)](/news/x.gif)
![](/news/x.gif) ![](/news/28.gif) ![](/news/x.gif) ![](/news/68.gif) ![Re: Ideas for NQC -Kevin L. Clague (9-Mar-04 to lugnet.robotics.rcx.nqc)](/news/x.gif) ![](/news/46.gif) ![RE: Ideas for NQC -Elizabeth Mabrey (9-Mar-04 to lugnet.robotics.rcx.nqc)](/news/x.gif)
![](/news/x.gif) ![](/news/68.gif) ![Re: NQC's future -Jack Hawk (2-Apr-04 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC's future -John Hansen (2-Apr-04 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC's future -Don Heyse (3-Apr-04 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC's future -Don Heyse (11-Apr-04 to lugnet.robotics.rcx.nqc, lugnet.robotics.spybotics)](/news/x.gif)
- 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
|
|
|
|