Turbo51
Encyclopedia
Turbo51 is a compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

 for the programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 Pascal
Pascal (programming language)
Pascal is an influential imperative and procedural programming language, designed in 1968/9 and published in 1970 by Niklaus Wirth as a small and efficient language intended to encourage good programming practices using structured programming and data structuring.A derivative known as Object Pascal...

, for the Intel MCS-51
Intel MCS-51
The Intel MCS-51 is a Harvard architecture, single chip microcontroller series which was developed by Intel in 1980 for use in embedded systems. Intel's original versions were popular in the 1980s and early 1990s. While Intel no longer manufactures the MCS-51, binary compatible derivatives remain...

 (8051) family of microcontroller
Microcontroller
A microcontroller is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of NOR flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM...

s. It features Borland
Borland
Borland Software Corporation is a software company first headquartered in Scotts Valley, California, Cupertino, California and finally Austin, Texas. It is now a Micro Focus subsidiary. It was founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn.-The 1980s:...

 Turbo Pascal
Turbo Pascal
Turbo Pascal is a software development system that includes a compiler and an integrated development environment for the Pascal programming language running on CP/M, CP/M-86, and DOS, developed by Borland under Philippe Kahn's leadership...

 7 syntax, support for inline assembly
Assembly language
An assembly language is a low-level programming language for computers, microprocessors, microcontrollers, and other programmable devices. It implements a symbolic representation of the machine codes and other constants needed to program a given CPU architecture...

 code, source-level debugging
Debugging
Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected. Debugging tends to be harder when various subsystems are tightly coupled, as changes in one may cause bugs to emerge...

, and optimizations, among others. The compiler is written in Object Pascal
Object Pascal
Object Pascal refers to a branch of object-oriented derivatives of Pascal, mostly known as the primary programming language of Embarcadero Delphi.-Early history at Apple:...

 and produced with Delphi.

In the 1980s, Intel introduced the 8051 as the first member of the MCS-51 processor family. Today, hundreds of cheap derivatives are available from tens of manufacturers. This makes the architecture very interesting for professionals and hobbyists. It is surprising that this 8-bit architecture is still in use today, and is still so popular. Of all 8051 compiler
8051 compiler
There are various high level language compilers for 8051 or enhanced versions of 8051 from various vendors. The most popular is the C language compiler. As the modern C compilers are efficient, assembly language is seldom used nowadays. It is common to have a complete program written solely in C...

s, several widely used C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 compilers exist, but only a few Pascal compilers. Turbo51 is available as freeware
Freeware
Freeware is computer software that is available for use at no cost or for an optional fee, but usually with one or more restricted usage rights. Freeware is in contrast to commercial software, which is typically sold for profit, but might be distributed for a business or commercial purpose in the...

 and was created with the goal to make a Pascal compiler for MCS-51 processors that will be as fast as Turbo Pascal
Turbo Pascal
Turbo Pascal is a software development system that includes a compiler and an integrated development environment for the Pascal programming language running on CP/M, CP/M-86, and DOS, developed by Borland under Philippe Kahn's leadership...

, will use the same syntax and will generate high quality optimized
Compiler optimization
Compiler optimization is the process of tuning the output of a compiler to minimize or maximize some attributes of an executable computer program. The most common requirement is to minimize the time taken to execute a program; a less common one is to minimize the amount of memory occupied...

 code.

Language dialect

Turbo51 uses Borland
Borland
Borland Software Corporation is a software company first headquartered in Scotts Valley, California, Cupertino, California and finally Austin, Texas. It is now a Micro Focus subsidiary. It was founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn.-The 1980s:...

 Turbo Pascal
Turbo Pascal
Turbo Pascal is a software development system that includes a compiler and an integrated development environment for the Pascal programming language running on CP/M, CP/M-86, and DOS, developed by Borland under Philippe Kahn's leadership...

 7 dialect. The syntax was extended with some constructs to support specific features of MCS-51 processors.


Var RS485_TX: Boolean absolute P3.2;
I2C.SDA: Boolean absolute P3.7;
I2C.SCL: Boolean absolute P3.4;

EEPROM_Data: TEEPROM_Data XDATA absolute 0;

ModuleAddress: Byte;
RX_LedTimer: Byte;
TX_LedTimer: Byte;

SavedOutput: TOutputData IDATA;
OutputsAuxData: Array [1..8] of Byte IDATA;

Features

  • Win32
    Windows API
    The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces available in the Microsoft Windows operating systems. It was formerly called the Win32 API; however, the name "Windows API" more accurately reflects its roots in 16-bit Windows and its support on...

     console application
  • Fast single pass optimizing compiler
  • Borland
    Borland
    Borland Software Corporation is a software company first headquartered in Scotts Valley, California, Cupertino, California and finally Austin, Texas. It is now a Micro Focus subsidiary. It was founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn.-The 1980s:...

     Turbo Pascal
    Turbo Pascal
    Turbo Pascal is a software development system that includes a compiler and an integrated development environment for the Pascal programming language running on CP/M, CP/M-86, and DOS, developed by Borland under Philippe Kahn's leadership...

     7 syntax
  • Full floating point support
  • Mixed Pascal
    Pascal (programming language)
    Pascal is an influential imperative and procedural programming language, designed in 1968/9 and published in 1970 by Niklaus Wirth as a small and efficient language intended to encourage good programming practices using structured programming and data structuring.A derivative known as Object Pascal...

     and assembly programming
  • Full use of register banks
  • Advanced multi-pass optimizer
    Compiler optimization
    Compiler optimization is the process of tuning the output of a compiler to minimize or maximize some attributes of an executable computer program. The most common requirement is to minimize the time taken to execute a program; a less common one is to minimize the amount of memory occupied...

  • Smart linker
  • Generates compact high quality code
  • Output formats: Binary, Intel HEX, OMF51 Object Module Format
    Relocatable Object Module Format
    The Relocatable Object Module Format is an object file format used primarily for software intended to run on Intel 80x86 microprocessors. It was originally developed by Intel under the name Object Module Format, and is perhaps best known to DOS users as a .OBJ file...

  • Assembly source code generation

"Hello World" example


Program HelloWorld;

Const
Osc = 22118400;
BaudRate = 19200;

BaudRateTimerValue = Byte (- Osc div 12 div 32 div BaudRate);

Var SerialPort: Text;

Procedure WriteToSerialPort; Assembler;
Asm
CLR TI
MOV SBUF, A
@WaitLoop:
JNB TI, @WaitLoop
end;

Procedure Init;
begin
TL1 := BaudRateTimerValue;
TH1 := BaudRateTimerValue;
TMOD := %00100001; { Timer1: no GATE, 8 bit timer, autoreload }
SCON := %01010000; { Serial Mode 1, Enable Reception }
TI := True; { Indicate TX ready }
TR1 := True; { Enable timer 1 }

Assign (SerialPort, WriteToSerialPort);
end;

begin
Init;
Writeln (SerialPort, 'Hello world!');
end.

See also

  • Intel 8051
    Intel 8051
    The Intel MCS-51 is a Harvard architecture, single chip microcontroller series which was developed by Intel in 1980 for use in embedded systems. Intel's original versions were popular in the 1980s and early 1990s. While Intel no longer manufactures the MCS-51, binary compatible derivatives remain...

  • 8051 compiler
    8051 compiler
    There are various high level language compilers for 8051 or enhanced versions of 8051 from various vendors. The most popular is the C language compiler. As the modern C compilers are efficient, assembly language is seldom used nowadays. It is common to have a complete program written solely in C...

    s
  • Pascal (programming language)
    Pascal (programming language)
    Pascal is an influential imperative and procedural programming language, designed in 1968/9 and published in 1970 by Niklaus Wirth as a small and efficient language intended to encourage good programming practices using structured programming and data structuring.A derivative known as Object Pascal...

  • Comparison of Pascal and C
    Comparison of Pascal and C
    The computer programming languages C and Pascal have similar times of origin, influences, and purposes. Both were used to design their own compilers early in their lifetimes....

  • Borland
    Borland
    Borland Software Corporation is a software company first headquartered in Scotts Valley, California, Cupertino, California and finally Austin, Texas. It is now a Micro Focus subsidiary. It was founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn.-The 1980s:...

  • Turbo Pascal
    Turbo Pascal
    Turbo Pascal is a software development system that includes a compiler and an integrated development environment for the Pascal programming language running on CP/M, CP/M-86, and DOS, developed by Borland under Philippe Kahn's leadership...

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK