How to make the Prospero Compilers work on a modern system

Anything QL Software or Programming Related.
User avatar
tofro
QL Wafer Drive
Posts: 1423
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

How to make the Prospero Compilers work on a modern system

Postby tofro » Tue Feb 14, 2017 9:52 am

I have promised to do a short writeup on the subject, so let's try:

  1. Download THE DISTRIBUTION from here http://www.sinclairql.net/downloads/THE ... BUTION.ZIP
  2. Find and extract ProPas_117_zip from the downloaded file and extract it to a new directory on your hard disk, e.g. win1_prospero
  3. Point a dev_ device (I use dev8_) to that directory by adding

    Code: Select all

    dev_use 8,win1_prospero_

    to your BOOT file.
  4. Execute the

    Code: Select all

    setddev
    program you just unpacked for all executable files you just unpacked, except LINK and set the device to dev8_
  5. Create a file PAS_CONFIG in the directory containing the following lines:

    Code: Select all

    /GL
    dev8_
    dev8_
    dev8_
    dev8_

    (Line 1 contains your preferred compilatiopn options, the other lines point to the location of the compiler)
  6. in case you are using the pth_ device to help you find your binaries, add the Prospero directory to your search path (preferrably in your BOOT file)

    Code: Select all

    PTH_ADD 1, win1_Prospero
  7. As you should be having plenty of memory, you might want to set the data space of all compiler programs to at least 32768 to be able to compile really large programs. Use the

    Code: Select all

    setstack
    program to do that

You should now be able to compile one of the example files like so:

Code: Select all

ex pas;win1_prospero_results

(Note you need to change all occurrences of "mdvx_" in the source code with a proper path on your system first)
This should produce a results_rel file which now obviously needs to be linked using

Code: Select all

ex link

and entering

Code: Select all

win1_prospero_results_rel -with win1_prospero_pas_link

to the linker prompt (Note as well that you need to adapt the path to the startup code and the libraries in the PAS_LINK file from mdv1_ to win1_prospero_ first)

Note I have only tried that for the Pascal compiler, but would expect the Fortran compiler to work in a similar way. EDIT: I just checked with the F77 compiler - this does not seem to work on QPC2: After the F77 compiler has been run once, the PRL-Runtime ROM loaded with EPROM_LOAD is apparently changed/destroyed and a _rel file is not produced. The Fortran compiler seems to check the ROM is really ROM by trying to write to it (The PRL S*Basic command gives a "PRL sumcheck error" after f77 has been run once).

It does make sense to use c68 make together with Prospero Pascal in order to ease compilation. I'll post a makefile and some more info soon.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
swensont
Forum Moderator
Posts: 130
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: How to make the Prospero Compilers work on a modern system

Postby swensont » Tue Feb 14, 2017 8:40 pm

Tobias,

You are running into exactly the same problem that I had in testing ProPascal and ProFortran. In my case, I was testing ProFortran on UQLX and I encountered the same issue you did with the PROM having an issue. I don't know if it is fixable. If I need to use ProFortran, I plan on using Q-emulator, where it works just fine.

With ProPascal, IIRC I had to lower the memory limits of UQLX (from the default of 4 Meg to 512K) to get it to work.

For Pascal, there is also the Computer One Pascal compiler. It is more of an IDE when run. IIRC C1 Pascal will allow you to open a console window, but with ProPascal you can only open an SCR window (no input). I did a review of both in a past issue of SMSQzine.

Tim Swenson


User avatar
tofro
QL Wafer Drive
Posts: 1423
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: How to make the Prospero Compilers work on a modern system

Postby tofro » Tue Feb 14, 2017 8:48 pm

Tim,
with the above procedure, I had no issues with ProPascal whatsoever, even with QPC set to 128M of memory ;)

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
tofro
QL Wafer Drive
Posts: 1423
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: How to make the Prospero Compilers work on a modern system

Postby tofro » Fri Apr 13, 2018 7:06 pm

Apparently, I never posted the promised makefile:

Code: Select all

#
# Extended ProPascal Library
#
#
# Assumptions:
#   DATA_USE points to Device/Directory holding the Sources
#   LINK_TARGET environment variable holds the name of the binary to create
#
# Program filenames
#
PASC = win1_Propascal_pas
NOQNS= win1_propascal_noqns_exe
LINK = win1_propascal_link
LIBR = win1_propascal_prolib
ASM  = win1_assembler_qmac
LK   = win1_assembler_qlink
MK   = win1_c68_make
SH   = win1_c68_sh
TC   = win1_c68_touch
GREP = win1_c68_grep
CP   = win1_c68_cp

#
# Assembler command line options
#
ASMCMD   = -errors ram1_err -nosym -bin -link

#
# Pascal command line options
# G -console output to LOG file
# I -range checks on index bounds
# A -range checks on assignments
# P -checks on pointers
# N -track source names & line numbers at run time
# L -source listing
# D -real constants to double precision
# C -compact object code
# S -accept only strict Standard Pascal
#
PASCMD   = /GL
LINK_TARGET = ram1_test_exe

#
# Input files
#
OBJS = \
 qdosmtaclock_rel\
 qdosmtactiv_rel\
 
#
# The library description file
#
LIB_DESCR = dos2_paslib_qdoslib_dsc
VER =

default: qdoslib_lib
test: ${LINK_TARGET}

#
# Produces by default a file that doesn't ask for files and a command line
# In case you need this, comment out the second (${NOQNS}) Line
#
${LINK_TARGET}:   test_rel qdoslib_lib
     ${LK} -with qdoslib_link -prog ${LINK_TARGET} -filetype 1
     ${NOQNS} ${LINK_TARGET}

qdoslib_lib: ${OBJS} ${LIB_DESCR}
   ${LIBR} @ ${LIB_DESCR}
   ${CP} -m qdoslib_rel qdoslib_lib
   
clean:
   ${RM} ${OBJS}
   ${RM} *_LOG
   ${RM} *_PRN
   ${RM} *_MAP
   
noq: ${LINK_TARGET} ${OBJS}
     ${NOQNS} ${LINK_TARGET}
#
# Header file dependencies
#

#
# Rule for turning _asm into _rel files
#
# _asm_rel:
#    ${ASM} $C$*_asm ${ASMCMD}

#
# Rule for turning _pas into _rel files
# Note: Needs "log" (G option) enabled to be able to parse for errors and stop
#

_pas_rel :
   ${RM} $C$*_rel
   ${PASC} $C$*${PASCMD}
   ${GREP} ERROR $C$*_log

.SUFFIXES : _o _rel _pas


This builds just fine on QPC and Q68, both a library target and an executable target

And another one I forgot to mention: You obviously need to EPROM_LOAD the PRL_rom file from your BOOT in order to run any of the above.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO

Return to “Software & Programming”

Who is online

Users browsing this forum: No registered users and 1 guest