Page 1 of 1

Program language

Posted: 11 Jan 2012, 22:53
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.

Re: Program language

Posted: 11 Jan 2012, 23:16
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).

Re: Program language

Posted: 12 Jan 2012, 15:25
by h-g-t
Do you mean machine code?

Re: Program language

Posted: 12 Jan 2012, 21:00
by aarnau
I mean in text form. But mattallen37 has said that it's not possible.
Thanks.

Re: Program language

Posted: 12 Jan 2012, 22:46
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)

Re: Program language

Posted: 12 Jan 2012, 23:41
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.

Re: Program language

Posted: 13 Jan 2012, 23:25
by aarnau
yes, it was what I wanted to know, thanks.

Now, I am seeing that it's more difficult than what I thought.

Re: Program language

Posted: 14 Jan 2012, 16:39
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?

Re: Program language

Posted: 14 Jan 2012, 17:41
by HaWe
that's NXC
install BricxCC, NXC is included!