Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
December 18, 2022 23:51
February 14, 2022 11:27
December 6, 2021 23:55
January 17, 2023 22:58
April 27, 2020 22:39
August 16, 2019 00:44
March 21, 2023 22:28
December 18, 2022 23:50
March 26, 2023 16:38
September 29, 2022 13:51
March 9, 2023 00:05


Doc PL



Mad-Pascal (MP) is a 32-bit Turbo Pascal compiler for Atari XE/XL. By design, it is compatible with the Free Pascal Compilator (FPC) (the -MDelphi switch should be active), which means the possibility of obtaining executable code for XE/XL, PC and every other platform for which FPC exists.

MP is not a port of FPC; it has been written based on of SUB-Pascal (2009), XD-Pascal (2010), the author of which is Vasiliy Tereshkov.

A program that works on Atari might have problems on PC if, for example, the pointers have not been initialized with the address of a variable and the program attempts to write to the address $0000 (memory protection fault).

The strengths of MP include fast and convenient possibility of inclusion of inline assembly. A program using inline ASM does not work on platforms other than XE/XL. MP uses 64KB of primary memory; TMemoryStream provides usage of extended memory.

Variable allocation is static; there is no dynamic memory management. Parameters are passed to functions by value, variable or constant.

The available features are:

  • If Case For To For In While Repeat statements
  • Compound statements
  • Label Goto statements
  • Arithmetic and boolean operators
  • Procedures and functions with up to 8 parameters. Returned value of a function is assigned to a predefined RESULT variable
  • Static local variables
  • Primitive data types, all types except the ShortReal/Real type are compatible. Pointers are dereferenced as pointers to Word:
    • Cardinal Word Byte Boolean
    • Integer SmallInt ShortInt
    • Char String PChar
    • Pointer File Text
    • ShortReal Real fixed-point
    • Float16
    • Single
  • One-dimensional and Two-dimensional arrays (with zero lower bound) of any primitive type. Arrays are treated as pointers to their origins (like in C) and can be passed to subroutines as parameters
  • Predefined type String [N] which is equivalent to array [0..N] of Char
  • Type aliases
  • Records
  • Objects
  • Separate program modules
  • Recursion


WUDSN + Mad Pascal

Mad Pascal i Geany

Atari XE/XL

mp.exe filename.pas -ipath:<MadPascalPath>\lib
mads.exe filename.a65 -x -i:<MadPascalPath>\base


    <MadPascalPath>\MP.exe %1 -ipath:<MadPascalPath>\lib -ipath:<MadPascalPath>\blibs

    if exist %~dp1%~n1.a65 (
	    mads.exe "%~dp1%~n1.a65" -xli:<MadPascalPath>\base
	    if exist "%~dp1%~n1.obx" altirra "%~dp1%~n1.obx"

Commodore 64

mp.exe -t c64 filename.pas -ipath:<MadPascalPath>\lib
mads.exe filename.a65 -x -i:<MadPascalPath>\base

Commodore Plus/4

mp.exe -t c4p filename.pas -ipath:<MadPascalPath>\lib
mads.exe filename.a65 -x -i:<MadPascalPath>\base


mp.exe -t raw filename.pas -ipath:<MadPascalPath>\lib
mads.exe filename.a65 -x -i:<MadPascalPath>\base



Simple Atari Mad-Pascal common project bootstrap.

Source code at GitLab


Set of custom libraries for MadPascal.

Lastest documentation always at GitLab


Custom tool for generating documentation from pascal comments in units.

Source code at GitLab

Effectus - Action! compiler

In new version the source code is generated by using Mad Pascal cross-compiler, which is further compiled to binary code with Mad Assembler.

Game tutorial

Simple game tutorial by using Mad Pascal


Display List program editor for 8-bit Atari ANTIC chipset


Simple binary data manipulation tool written in javascript (export to Action!, Assembler, C, Pascal)

Bocianu's Atari Toolkit HUB

CutAs, FiDL, SprED, Sprite XL

Projects in Mad-Pascal


CC65 Mad Pascal Millfork
Sieve (less is better) 602 577 579
YoshPlus (higher is better) 41933 41933 41933
Chessboard (higher is better) 76 88 82

Floating Point

iteration x 256 Atari OS FastChip MP Single MP Real
add, sub, mul, div 232 118 64 99
add, sub, mul, div, sin, cos 5820 2915 3728 1231
  • MP Single: IEEE754-32bit
  • MP Real: Q24.8 Fixed Point