Atari Legacy·Reader Resources·Mad-Pascal·Chapter 1

Software · Course

Chapter 1: Setting up and Hello World

By Wojciech "Bocianu" Bociański · As printed in Issue 01 · pp. 56-58 · Online 2026-09-17

Setting up a cross-development workbench on a PC: the Mad-Pascal compiler, the MADS cross-assembler behind it, the Altirra emulator to run the result, and VS Code wired up so that Shift+Ctrl+B takes you from Pascal source to a running Atari program in one keystroke. Ends with hello world on a blue Atari screen.

Get the code

Everything from the printed article, ready to compile. Checksums are printed so you can verify a file you got from somewhere else against ours.

From zero to hello world

Two compilers and an emulator, none of which need installing in any particular place — the build script just has to know where you put them.

  1. Download Mad-Pascal: https://github.com/tebe6502/Mad-Pascal/releases
  2. Download MADS: https://github.com/tebe6502/Mad-Assembler/releases
  3. Download Altirra (SDL on Linux/macOS, native build on Windows)
  4. Edit the four paths at the top of build.sh or build.bat
  5. Drop tasks.json into .vscode/ and press Shift+Ctrl+B

Compilation is a two-stage affair: Mad-Pascal translates the Pascal into MADS assembly source, and MADS assembles that into an Atari executable. That is why you need both tools, and why the build script checks the exit code between the two steps.

The full listing

The same file you can download above — line numbers match the errata table below. Line numbers are not selected when you copy.

Typed in from the printed page, not yet checked against the author’s original — a difference here is our mistake, not theirs. Tell us and it goes in the errata.

hello.pas Download
// ---------------------------------------------------------------------// hello.pas — Mad-Pascal, Chapter 1 of the Atari Legacy course// Wojciech "Bocianu" Bociański, Atari Legacy Issue 01, pp. 56-58//// Transcribed by the editorial team from the printed listing (Fig. 4).// Not yet checked against the author's original file.// ---------------------------------------------------------------------program hello;uses crt;begin    Writeln('hello world');    Readkey;end.

Typed in from the printed page, not yet checked against the author’s original — a difference here is our mistake, not theirs. Tell us and it goes in the errata.

build.sh Download
#!/bin/bash# ---------------------------------------------------------------------# build.sh — Mad-Pascal, Chapter 1 of the Atari Legacy course# Wojciech "Bocianu" Bocianski, Atari Legacy Issue 01 (Fig. 6)## Transcribed by the editorial team from the printed listing.# Adjust the four paths below to wherever you unpacked the tools.# ---------------------------------------------------------------------MP_BIN="/home/bocianu/Mad-Pascal/bin/linux_x86_64/mp"MADS_BIN="/home/bocianu/Mad-Assembler/bin/linux_x86_64/mads"MP_BASE="/home/bocianu/Mad-Pascal/base"ALTIRRA="/home/bocianu/altirra/altirra.AppImage"NAME="hello"$MP_BIN $NAME.pasif [ $? -eq 0 ]; then    $MADS_BIN $NAME.a65 -x -i:$MP_BASE -o:$NAME.xexfiif [ $? -eq 0 ]; then    $ALTIRRA --run $NAME.xexfi

Typed in from the printed page, not yet checked against the author’s original — a difference here is our mistake, not theirs. Tell us and it goes in the errata.

build.bat Download
@rem --------------------------------------------------------------------@rem build.bat — Mad-Pascal, Chapter 1 of the Atari Legacy course@rem Wojciech "Bocianu" Bocianski, Atari Legacy Issue 01 (Fig. 5)@rem@rem Transcribed by the editorial team from the printed listing.@rem Adjust the four paths below to wherever you unpacked the tools.@rem --------------------------------------------------------------------@setlocal@SET MP_BIN=D:\atari\Mad-Pascal\bin\windows\mp.exe@SET MADS_BIN=D:\atari\Mad-Assembler\bin\windows_x86_64\mads.exe@SET MP_BASE=D:\atari\Mad-Pascal\base@SET ALTIRRA_BIN=D:\atari\Altirra\altirra64.exe@SET NAME=hello%MP_BIN% %NAME%.pas@if %ERRORLEVEL% == 0 %MADS_BIN% %NAME%.a65 -x -i:%MP_BASE% -o:%NAME%.xex@if %ERRORLEVEL% == 0 %ALTIRRA_BIN% %NAME%.xex

Typed in from the printed page, not yet checked against the author’s original — a difference here is our mistake, not theirs. Tell us and it goes in the errata.

tasks.json Download
{    // See https://go.microsoft.com/fwlink/?LinkId=733558    // for the documentation about the tasks.json format    "version": "2.0.0",    "tasks": [        {            "label": "Mad-Pascal build",            "type": "shell",            "command": "./build.sh",            "windows": {                "command": "build.bat"            },            "group": {                "kind": "build",                "isDefault": true            }        }    ]}

Screens

The Altirra emulator window showing an Atari blue screen with the words 'hello world' printed in the top-left corner.
Fig. 9 — the first program running in the Altirra emulator.

The toolchain

Bibliography from the printed article

Errata

Paper cannot be patched. This is where a wrong line in the printed listing gets fixed — the downloadable file above is always the corrected one.

No corrections to the printed article so far. Found one? Write to biuro@l-tek.pl and it will appear here.

Rights

The listings from this chapter are republished here so that readers do not have to retype a printed page. The build scripts still carry the author's own directory paths as printed — change them to match your own installation. Copyright remains with Wojciech "Bocianu" Bociański.