Recent Changes - Search:

Topics

Select Theme

Cabezon

About

Cabezon is a free compiler for the Pascal programming language running on DOS. It was originally developed by Hiroshi "ockeghem" Tokumaru from 22 August 1990 to 4 January 1993. Latest version is 0.08.

These wiki pages are maintained out of curiosity by Robert Riebisch to document his progress on understanding and extending the compiler. Please expect slow progress, because this is a spare-time project and all documentation by Hiroshi is in Japanese language. -- But let's dream big for now: Maybe some day, Cabezon can fully replace Turbo Pascal.

Features

Despite its low version number, Cabezon can already create working .EXE files in 16-bit DOS MZ format. At first, it translates your Pascal source code to x86 assembly language and then runs two external tools, an assembler and a linker to create the actual .EXE file.

FIXME

Requirements

  • Intel i8086/88 microprocessor (or compatibles)
  • ~256 KiB RAM
  • ~200 KiB disk space
  • Microsoft MS-DOS 2.0 (or compatibles)
  • Any of the following DOS-based assemblers:
    • Microsoft MASM version 5.1 (version 3.0 should also work)
    • Borland TASM version 1.0
    • LSI R86 version 1.11 (included with their C-86 compiler)
    • Eric Isaacson's A86 version 3.14
  • Any of the following DOS-based linkers:
    • Microsoft LINK version 3.0
    • Borland TLINK version 1.0
    • Zortech BLINK version 2.15 (included with their C++ compiler)
    • LSI LLD version 1.10 (included with their C-86 compiler)
    • Pocket Soft RTLink 2.03

All version numbers come from the file cabdc008.zip\CABEZON.MAN. Usually newer versions will also work as long as they run on DOS.

Starters are recommended to use the R86 & LLD combination from LSI C-86 version 3.30c, because it's available as a free download and very robust.

License

Cabezon is copyright Hiroshi Tokumaru.

Since 18 February 2019 Cabezon is under MIT License.

So it is not only available free of charge, but also comes with full source code.

Getting Cabezon

Cabezon can be downloaded from below or the original website.

Downloads

DescriptionFile nameFile size
Executablescabex008.zip (Content)59 KB
Compiler source codecabsr008.zip (Content)74 KB
Documentation (in Japanese only)cabdc008.zip (Content)20 KB
clib run-time source codecablb008.zip (Content)33 KB
LSI C-86 compiler (third-party tool)lsic330c.lzh (Content)400 KB
lsic330c.zip (lsic330c.lzh re-packed.1)391 KB

Looking for a specific file? Go to cab??008.zip Archive Listing or lsic330c.lzh Archive Listing.

More Downloads

DescriptionFile nameFile size
CABEZON.ERR in Englishcabezon_err_2020-01-19.zip2 KB

Installation

  1. Get cabex008.zip (see section above).
  2. Extract the following files to a new directory named, e.g., D:\CABEZON:
    • CAB.EXE -- compiler driver
    • CAB1.EXE -- compiler itself
    • CABEZON.ERR -- compile-time error messages in Japanese (!!) (or get in English), used by CAB1.EXE
    • CABEZON.INI -- interface part of what Turbo/Borland Pascal calls unit "System", used by CAB1.EXE
    • CLIB.LIB -- run-time library, like a compiled unit "System"
  3. Get lsic330c.zip or lsic330c.lzh (see section above).
  4. Extract LLD.EXE and R86.EXE to D:\CABEZON.
  5. Create a batch file named GOCAB.BAT in D:\CABEZON. (Or a directory mentioned in your computer's PATH environment variable, e.g., C:\TOOLS.)
@echo off
echo Preparing for Cabezon...
set PATH=D:\CABEZON;%PATH%
set ASM=R86
set LINK=LLD
echo.
echo Now have fun! :-)
echo.

First Run

First step is to prepare the compiler environment:

C:\>d:
D:\>cd \cabezon
D:\Cabezon>gocab
Preparing for Cabezon...

Now have fun! :-)


D:\Cabezon>

Then run the compiler driver:

D:\Cabezon>cab
Cabezon Compiler Ver 0.08
Copyright (C) 1990, 93  Ockeghem
/j      jump optimization (tasm 2.0 only)
/g      debug information
/s      compile only
/c      compile and assemble only
/l      generate list file
/m      generate map file

D:\Cabezon>

Hello, World

At first, place this very short Pascal code into a file named D:\CABEZON\HELLO.PAS:

program Hello;

begin
  writeln('hello, world');
end.

Now feed that source code to the compiler. -- This will also automatically call the assembler (R86.EXE) and the linker (LLD.EXE):

D:\Cabezon>cab hello
cab1 /oC:\Temp\hello.a86 /r hello

R86 -o hello.obj C:\Temp\hello.a86

DEL C:\Temp\hello.a86
LLD hello.obj clib.lib


D:\Cabezon>

Then you can run your first Cabezon-compiled program. -- You already guessed it. It just prints "hello, world" every time you run it:

D:\Cabezon>hello
hello, world

D:\Cabezon>hello
hello, world

D:\Cabezon>

Compiler Error Messages

Please see Translating CABEZON.ERR.

Run-time Error Messages

Programs generated with Cabezon will print Run time error 000 at 0000:0000 if anything goes wrong during execution. 000 is the error code and 0000:0000 is a segment:offset combination of the program code, where the error occurred.

Trivia: Programs generated with Turbo/Borland Pascal will print Runtime error 000 at 0000:0000 (no space between Run and time).

Run-time errors are divided into the following two types. DOS error: 1 to 17, I/O error: 100 or higher.

ErrorDescription
2File not found
3Path not found
4Too many open files
5File access denied
6Invalid file handle
100Disk read error
101Disk write error
102File not assigned
103File not open
104File not open for input
105File not open for output
106Invalid numeric format
203Heap overflow error
204Invalid pointer operation
 

1 Using Info-ZIP Zip version 3.00: zip.exe -9 -o -r -X -D ..\lsic330 *

Edit - History - Print - Recent Changes - Search
Page last modified on 2020-12-06T16:38