请输入您要查询的百科知识:

 

词条 Turbo51
释义

  1. Language dialect

  2. Features

  3. "Hello World" example

  4. See also

  5. External links

{{refimprove|date=June 2016}}{{Infobox software
| name = Turbo51
| screenshot = Turbo51 0.1.3.5 output.png
| caption = Turbo51 command line output
| developer = Igor Funa
| latest_release_version = 0.1.3.12
| latest_release_date = {{start date and age|2012|2|1}}
| operating_system = Win32
| genre = Compiler
| license = Freeware
| website = {{URL|turbo51.com}}
}}

Turbo51 is a compiler for the programming language Pascal, for the Intel MCS-51 (8051) family of microcontrollers. It features Borland Turbo Pascal 7 syntax, support for inline assembly code, source-level debugging, and optimizations, among others. The compiler is written in Object Pascal 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 compilers, several widely used C compilers exist, but only a few Pascal compilers. Turbo51 is available as freeware and was created with the goal to make a Pascal compiler for MCS-51 processors that will be as fast as Turbo Pascal, will use the same syntax and will generate high quality optimized code.

Language dialect

Turbo51 uses Borland Turbo Pascal 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;
      ModuleAddress:  Byte;      RX_LedTimer:    Byte;      TX_LedTimer:    Byte;
      SavedOutput:    TOutputData IDATA;      OutputsAuxData: Array [1..8] of Byte IDATA;

Features

  • Win32 console application
  • Fast single pass optimizing compiler
  • Borland Turbo Pascal 7 syntax
  • Full floating point support
  • Mixed Pascal and assembly programming
  • Full use of register banks
  • Advanced multi-pass optimizer
  • Smart linker
  • Generates compact high quality code
  • Output formats: Binary, Intel HEX, OMF51 Object Module Format
  • Assembly source code generation

"Hello World" example

Program HelloWorld;

Const

 Osc      = 22118400; BaudRate = 19200;

Var SerialPort: Text;

Procedure WriteToSerialPort; Assembler;

Asm

  CLR   TI  MOV   SBUF, A

@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 }

end;

begin

  Init;  Writeln (SerialPort, 'Hello world!')

end.

See also

  • Intel 8051
  • Pascal (programming language)
  • Comparison of Pascal and C
  • Borland
  • Turbo Pascal

External links

{{Wikibooks|Programming:Pascal}}
  • {{official website|turbo51.com}}
{{Pascal programming language family}}

5 : Pascal compilers|Pascal programming language family|Object-oriented programming languages|compilers and interpreters|Pascal software

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/12 5:50:00