Some Prefer C Programming Language
If you don't like Pascal programming language then you are probably looking for C. And there is a great free C compiler for 8051, SDCC - Small Device C Compiler.
What ...
Turbo51 Methods
Pascal Compiler for 8051 Microcontrollers
Methods are always reentrant. Before a call to the method is made the following is pushed on the XDATA stack:
Address for String result (for functions ...
Reentrant Procedures in Turbo51
Pascal Compiler for 8051 Microcontrollers
For reentrant procedures all parameters are pushed on XDATA stack. Functions return simple result in first register set (R5R4R3R2). For functions which return ...
Turbo51 Compiler Internals
Pascal Compiler for 8051 Microcontrollers
If you are interested in Turbo Pascal compiler internals and would like to see the source code of some popular commercial Pascal compiler then check Turbo Pascal ...
8051 Assembler Statements
Pascal Compiler for 8051 Microcontrollers
Turbo51 assembler statement is very similar to 8051 assembler. You can use all instructions from the 8051 instruction set. Labels starting with @ don't have ...
8051 Interrupts in Turbo51
Pascal Compiler for 8051 Microcontrollers
Interrupts are procedures declared with the Interrupt directive and interrupt address. In this example Timer0 is a constant defined in the System unit. For ...
Procedure at Absolute Address
Pascal Compiler for 8051 Microcontrollers
You can force placing a procedure at absolute address with the absolute directive. This way you can also reserve some bytes at fixed addresses in code segment. ...
Turo51 Inline Procedures
Pascal Compiler for 8051 Microcontrollers
Procedures (and functions) that are declared with the Inline directive are copied to the places where they are called. This has the effect that there is no ...
Turbo51 Assembler Procedures
Pascal Compiler for 8051 Microcontrollers
Here you can see some examples of procedures written entirely in 8051 assembly language. At the end of each procedure Turbo51 adds only RET instruction (or ...
Turbo51 System Functions
Pascal Compiler for 8051 Microcontrollers
Abs
Function Abs (X: Integer): Integer;
Function Abs (X: Real): Real;
Abs returns the absolute value of a variable. The result of the function ...
Turbo51 System Procedures
Pascal Compiler for 8051 Microcontrollers
Assign
Procedure Assign (Var F: File; ReadFunction: Function; WriteProc: Procedure);
Procedure Assign assigns read function and write procedure to ...
Turbo51 Variables
Pascal Compiler for 8051 Microcontrollers
Turbo51 variables can have memory type directives DATA, IDATA, or XDATA which overrides default memory type for variables (IDATA memory with addresses starting ...
Turbo51 Types
Pascal Compiler for 8051 Microcontrollers
Turbo51 provides the following system types: Byte (unsigned 8-bit), Word (unsigned 16-bit), ShortInt (signed 8-bit), Integer (signed 16-bit), LongInt (signed ...
Turbo51 Constants
Pascal Compiler for 8051 Microcontrollers
Turbo51 constants can be of any ordinal type. Typed constants are stored in CODE memory (in little endian format) and can not be modified. Boolean typed constants ...
Turbo51 Objects
Pascal Compiler for 8051 Microcontrollers
Objects are data structures that merge pascal records and procedures called methods, i.e. data and code together. In order to use objects in Turbo51 you need ...
Turbo51 Files
Pascal Compiler for 8051 Microcontrollers
Turbo51 supports files - a general framework for IO handling. However, you have to provide the low level IO procedures. Files can be untyped, typed (File of ...
Turbo51 System Unit
Pascal Compiler for 8051 Microcontrollers
System unit implements Turbo51 runtime library and defines some special function registers (SFR), bits and interrupt addresses that are present in all microcontrollers ...
Turbo51 Memory Organization
Pascal Compiler for 8051 microcontrollers
CODE memory
By default the maximum code size is $10000 bytes (64 KB). This can be changed in the main program with the $M directive.
IDATA memory
By ...
Compiler Switches And Directives
Turbo Pascal Compiler for 8051 microcontrollers
Compiler switches: (defaults are shown below)
Compiler switchDescription
A- AbsoluteInstructions Off
Generate absolute instructions (ACALL/AJMP) ...
Turbo51 Command Line Syntax
How To Use the Compiler
Turbo51 is a command line console application. This means that it has no graphical user interface, menus or windows. It must be run from a console with parameters: pascal source ...