Prog8 language and compiler topic

All aspects of programming on the Commander X16.
User avatar
desertfish
Posts: 1096
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: Prog8 language and compiler topic

Post by desertfish »

I think in 1 or 2 weeks, in the meantime, you can always download a development build from the github Action CI builds page.
Mark Burring
Posts: 2
Joined: Sat Nov 07, 2020 2:34 am

Re: Prog8 language and compiler topic

Post by Mark Burring »

Do you know what I'm doing wrong here?

Code: Select all

markb@psilon:~/code/prog8$ java -jar prog8compiler-8.14-all.jar -target cx16 examples/cx16/rasterbars.p8 

Prog8 compiler v8.14 by Irmen de Jong (irmen@razorvine.net)
This software is licensed under the GNU GPL 3.0, see https://www.gnu.org/licenses/gpl.html

Compiling program examples/cx16/rasterbars.p8
ERROR file:///home/markb/code/prog8/examples/cx16/rasterbars.p8:19:9: undefined symbol: sys.set_rasterirq
ERROR file:///home/markb/code/prog8/examples/cx16/rasterbars.p8:59:9: undefined symbol: sys.set_rasterline

There are 2 errors and 0 warnings.
markb@psilon:~/code/prog8$ java -version
openjdk version "11.0.19" 2023-04-18
OpenJDK Runtime Environment (build 11.0.19+7-post-Ubuntu-0ubuntu122.04.1)
OpenJDK 64-Bit Server VM (build 11.0.19+7-post-Ubuntu-0ubuntu122.04.1, mixed mode, sharing)
markb@psilon:~/code/prog8$ 64tass --version
64tass Turbo Assembler Macro V1.56.2625

markb@psilon:~/code/prog8/examples/cx16$ java -jar prog8compiler-8.14-all.jar -target cx16 rasterbars.p8 

Prog8 compiler v8.14 by Irmen de Jong (irmen@razorvine.net)
This software is licensed under the GNU GPL 3.0, see https://www.gnu.org/licenses/gpl.html

Compiling program rasterbars.p8
ERROR file:///home/markb/code/prog8/examples/cx16/rasterbars.p8:19:9: undefined symbol: sys.set_rasterirq
ERROR file:///home/markb/code/prog8/examples/cx16/rasterbars.p8:59:9: undefined symbol: sys.set_rasterline

There are 2 errors and 0 warnings.
User avatar
desertfish
Posts: 1096
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: Prog8 language and compiler topic

Post by desertfish »

You are using the version 8 compiler to try to compile code from version 9. A bunch of breaking changes are coming in version 9: https://prog8.readthedocs.io/en/latest/upgrading8.html

So - either download a work in progress version of the verson 9 compiler from the github CI action build artifacts (or build it yourself in the already cloned repository!), or switch back to the version 8 branch of the example code https://github.com/irmen/prog8/tree/v8_maintenance
Mark Burring
Posts: 2
Joined: Sat Nov 07, 2020 2:34 am

Re: Prog8 language and compiler topic

Post by Mark Burring »

desertfish wrote: Sat Jun 03, 2023 9:16 am You are using the version 8 compiler to try to compile code from version 9. A bunch of breaking changes are coming in version 9: https://prog8.readthedocs.io/en/latest/upgrading8.html
Thanks for your reply, I checked out the project and compiled it

Code: Select all

markb@psilon:~/code/prog8$ compiler/build/install/p8compile/bin/p8compile examples/cx16/rasterbars.p8 

Prog8 compiler v9.0-dev by Irmen de Jong (irmen@razorvine.net)
This software is licensed under the GNU GPL 3.0, see https://www.gnu.org/licenses/gpl.html

Compiling program examples/cx16/rasterbars.p8
ERROR file:///home/markb/code/prog8/examples/cx16/rasterbars.p8:2:1: no module found with name palette. Searched in: [/home/markb/code/prog8] (and internal libraries)

There are 1 errors and 0 warnings.
We'll leave it there, I don't expect you to keep debugging my issues. I will keep an eye on how your project progresses and try again later.
User avatar
desertfish
Posts: 1096
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: Prog8 language and compiler topic

Post by desertfish »

that error is much easier to fix, you're compiling a CommanderX16 program with the default compilation target which is the commodore64.

Please study the prog8 manual a little to familiarize with the various options and settings as I've tried to explain all of this there. In this particular case, you should add "-target cx16" as a command line option to tell the compiler that the program is meant to run on the commander x16.
User avatar
desertfish
Posts: 1096
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Important Version 9.0 released

Post by desertfish »

:!: Prog8 version 9.0 has been released! https://github.com/irmen/prog8/releases/tag/v9.0

This release contains a bunch of breaking changes over 8.0.
Please read about them and some guidance on how to upgrade your programs here: https://prog8.readthedocs.io/en/latest/upgrading8.html
  • the -target option is now required, c64 is no longer a default.
  • added ‘cbm’ block in the syslib module that now contains all CBM compatible kernal routines and variables
  • added min(), max() builtin functions. For floats, use floats.minf() and floats.maxf().
  • added clamp(value, minimum, maximum) to restrict a value x to a minimum and maximum value. For floats, use floats.clampf(f, minv, maxv).
  • rename sqrt16() to just sqrt(), make it accept multiple numeric types including float. Removed floats.sqrt().
  • abs() now supports multiple datatypes including float. Removed floats.fabs().
  • divmod() now supports multiple datatypes. divmodw() has been removed.
  • cx16diskio module merged into diskio (which got specialized for commander x16 target). load() and load_raw() with extra ram bank parameter are gone.
  • drivenumber parameter removed from all routines in diskio module. The drive to work on is now simply stored as a diskio.drivenumber variable, which defaults to 8.
  • for loops now skip the whole loop if from value already outside the loop range (this is what all other programming languages also do)
  • asmsub params or return values passed in cpu flags (like carry) now must be declared as booleans (previously ubyte was still accepted).
  • (on cx16) added diskio.save_raw() to save without the 2 byte prg header
  • added sys.irqsafe_xxx irqd routines
  • added gfx2.fill() flood fill routine
  • added @split storage class for (u)word arrays to store them as split lsb/msb arrays which is more efficient (but doesn’t yet support all array operations)
  • added -splitarrays command line option and ‘%option splitarrays’ to treat all word arrays as tagged with @split
Edmond D
Posts: 489
Joined: Thu Aug 19, 2021 1:42 am

Re: Prog8 language and compiler topic

Post by Edmond D »

Congrats on getting a major release out, with what looks to be an extensive amount of changes and improvements.
User avatar
ahenry3068
Posts: 1136
Joined: Tue Apr 04, 2023 9:57 pm

Re: Prog8 language and compiler topic

Post by ahenry3068 »

Can you point me to the correct Documentation on how SPLIT arrays are handled ?
User avatar
desertfish
Posts: 1096
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: Prog8 language and compiler topic

Post by desertfish »

User avatar
ahenry3068
Posts: 1136
Joined: Tue Apr 04, 2023 9:57 pm

Re: Prog8 language and compiler topic

Post by ahenry3068 »

TY
Post Reply