Download Latest Version pascal-p5c-code-r76.zip (3.9 MB)
Email in envelope

Get an email when there's a new version of pascal p5c

Home / p5x
Name Modified Size InfoDownloads / Week
Parent folder
tp5x.pas 2021-04-01 53.4 kB
tstring.pas 2021-04-01 37.5 kB
sys.inc.pas 2021-04-01 910 Bytes
tclib.pas 2021-04-01 10.4 kB
pcom.pas 2021-04-01 511.3 kB
string.inc.pas 2021-04-01 13.0 kB
p5c-good.c 2021-04-01 638.5 kB
p5x.h 2021-04-01 4.6 kB
guide.txt 2021-04-01 155.0 kB
console.inc.pas 2021-04-01 11.1 kB
console.pas 2021-04-01 4.1 kB
assert.inc.pas 2021-04-01 1.2 kB
clib.inc.pas 2021-04-01 4.8 kB
README 2020-01-13 1.9 kB
r 2020-01-13 6.2 kB
Totals: 15 Items   1.5 MB 0
This is p5x - p5c with extensions...

eg:
  underscores in identifiers
  mixed declaration order
  case statements have otherwise and ranges
  constant expressions
  // comments
  etc


getting started
===============
step 1: get gcc
  gcc is widely supported and distributed.
  To get gcc for windows, search for mingw, cygwin or delorie.
  Linux and other unix type systems are likely have gcc already installed.

step 2: compile p5x.c
  make sure p5x.h is in the current directory or where gcc can find it
  use something like this command in the bash shell:
         gcc -I . -lm -o p5x p5x.c

  Other systems should have similar commands.

step 3: compile your pascal program
  for p5x, compiling is a 2 stage process, the first is to compile the pascal
  into c, the second is to compile the c code into an executable.
  eg, for the obligatory hello world:
         p5x hello.pas hello.c > hello.lst
         gcc -lm -I . -o hello hello.c

step 4: run the program ./hello


using p5x
=========
It works the same as p5c.

there is a run script, called r, that compiles and runs a pascal program.

First set an environment variable to tell it where the compiler is

    export P5CDIR=/path/to/p5x

the script runs the program, first checking if it needs to be compiled.
eg to compile and run a pascal program called myprog, use this command

   ./r myprog

see guide.txt for full details, and tp5x.pas for example code



Files in this directory are similar to the files in the p5c directory, with
these additions:

string.inc.pas  - a string library

tstring.pas     - test & demo program for string library

console.inc.pas - library of console functions, features similar to those
                  provided by turbo pascal's crt unit
                  see console.pas for examples of its use.

assert.inc.pas  - add assertions to check your code, like in c

clib.inc.pas    - use many c library functions
Source: README, updated 2020-01-13