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.
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
Description | File name | File size |
---|---|---|
Executables | cabex008.zip (Content) | 59 KB |
Compiler source code | cabsr008.zip (Content) | 74 KB |
Documentation (in Japanese only) | cabdc008.zip (Content) | 20 KB |
clib run-time source code | cablb008.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
Description | File name | File size |
---|---|---|
CABEZON.ERR in English | cabezon_err_2020-01-19.zip | 2 KB |
Installation
- Get cabex008.zip (see section above).
- 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"
- Get lsic330c.zip or lsic330c.lzh (see section above).
- Extract LLD.EXE and R86.EXE to D:\CABEZON.
- 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.
Error | Description |
---|---|
2 | File not found |
3 | Path not found |
4 | Too many open files |
5 | File access denied |
6 | Invalid file handle |
100 | Disk read error |
101 | Disk write error |
102 | File not assigned |
103 | File not open |
104 | File not open for input |
105 | File not open for output |
106 | Invalid numeric format |
203 | Heap overflow error |
204 | Invalid pointer operation |
1 Using Info-ZIP Zip version 3.00: zip.exe -9 -o -r -X -D ..\lsic330 * ⇑