Program language

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
aarnau
Posts: 14
Joined: 10 Dec 2011, 11:21

Program language

Post by aarnau »

Hi, I am writing to ask If it's possible to see the program written with the universal language of programing, without symbols.
It means that I want to see the program with numbers, not symbols. Is it possible?

pd: Sorry for my bad english.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Program language

Post by mattallen37 »

You want to use NXT-G (the software that comes with the NXT), but you want to see the program in text form? That's not possible.

What I would suggest is that you use BCC and NXC. You can use the same FW that is already on the NXT (normal lego FW), although it's better to upgrade to the latest enhanced FW (still 100% backwards compatible with NXT-G).
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: Program language

Post by h-g-t »

Do you mean machine code?
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
aarnau
Posts: 14
Joined: 10 Dec 2011, 11:21

Re: Program language

Post by aarnau »

I mean in text form. But mattallen37 has said that it's not possible.
Thanks.
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Program language

Post by HaWe »

there is an attempt to write a graphical "language" such as NXT-G or Enchanting which simultaneously generates a C-like code (NXC):
Visual-NXC
it's not finished yet - but do you mean something like that?

But consider that NXC is another uncompiled high-level-language - although readable in script form, not in icon form - it's not the code the firmware is working with... (in both cases that would be the generated byte code - actually almost unreadable)
tcwan
Posts: 186
Joined: 30 Sep 2010, 07:39

Re: Program language

Post by tcwan »

aarnau wrote:I mean in text form. But mattallen37 has said that it's not possible.
Thanks.
First of all, there is no single 'universal language of programming'. If you're talking about machine code (which consists only of numbers, binary 0 and 1, which can also
be represented as Hexadecimal (4 binary values == 1 hexadecimal value from zero to the symbol 'F'), it is specific to a given processor architecture. For example, in PCs, which are based on the 80x86 architecture, a 32-bit hex value of ABCD1234 (I made that up) means one thing, while on the NXT, which uses a processor based on the ARM architecture, it means something else entirely.

Secondly, the NXT-G programs are not written in the machine language used by the ARM processor in the NXT. Instead it is written to a virtual machine bytecode format, similar to how Java compilers generate Java Byte Code. The NXT Byte Code (NBC) is what is used by the NXT firmware to execute its programs, typically.

You can of course take a RXE file generated by NXT-G or Bricxcc and perform a Hex-dump of it, meaning, use a program which reads in the RXE file, and display the numerical (hexadecimal) value of each byte in the file. I suppose that may be what you're asking. However, it would be next to impossible to understand what it means without knowing a lot of details regarding which value represents what command, and which bits in a value refer to commands and which refer to storage locations, etc.
aarnau
Posts: 14
Joined: 10 Dec 2011, 11:21

Re: Program language

Post by aarnau »

yes, it was what I wanted to know, thanks.

Now, I am seeing that it's more difficult than what I thought.
aarnau
Posts: 14
Joined: 10 Dec 2011, 11:21

Re: Program language

Post by aarnau »

I have seen that somebody has written in letters the program as I want.
Here is the example:

Code: Select all
#include "NXCDefs.h"
#include "NBCCommon.h"

#define MOTOR_LEFT OUT_B
#define MOTOR_RIGHT OUT_C
#define MOTOR_BOTH OUT_BC
#define MOTOR_FORK OUT_A
#define COLORSENSOR SENSOR_2
#define TOUCH SENSOR_3
#define ULSONIC SensorUS(IN_1)
#define LIGHT_BLACK 115
#define LIGHT_WHITE 275
... and it continues


How can I do it?
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Program language

Post by HaWe »

that's NXC
install BricxCC, NXC is included!
Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests