Introduction
NBC stands for NeXT Byte Codes. It is a simple language for programming the LEGO MINDSTORMS NXT product. The NXT has a byte-code interpreter (provided by LEGO), which can be used to execute programs. The NBC compiler translates a source program into LEGO NXT byte-codes, which can then be executed on the NXT itself. Although the preprocessor and format of NBC programs are similar to assembly, NBC is not a general-purpose assembly language - there are many restrictions that stem from limitations of the LEGO byte-code interpreter.
Logically, NBC is defined as two separate pieces. The NBC language describes the syntax to be used in writing programs. The NBC Application Programming Interface (API) describes the system functions, constants, and macros that can be used by programs. This API is defined in a special file known as a "header file" which is automatically included at the beginning of any NBC program.
This document describes both the NBC language and the NBC API. In short, it provides the information needed to write NBC programs. Since there are different interfaces for NBC, this document does not describe how to use any specific NBC implementation (such as the command-line compiler or Bricx Command Center). Refer to the documentation provided with the NBC tool, such as the NBC User Manual, for information specific to that implementation.
For up-to-date information and documentation for NBC, visit the NBC website at http://bricxcc.sourceforge.net/nbc/.