Prog8 documentation: https://prog8.readthedocs.io
Prog8 project and source code website: https://github.com/irmen/prog8
You can download the compiler from there as well, it is free and open-source (GPL license)
A whole bunch of example programs is included in the prog8 source repository: https://github.com/irmen/prog8/tree/master/examples
What does it do?
- all advantages of a higher level language over having to write assembly code manually
- programs run very fast because compilation to native machine code: often produces smaller and faster running programs than equivalent C code compiled with CC65 or even LLVM-MOS
- modularity, symbol scoping, subroutines
- various data types other than just bytes (16-bit words, floats, strings)
- floating point math is supported if the target system provides floating point library routines (C64 and Cx16 both do)
- strings can contain escaped characters but also many symbols directly if they have a petscii equivalent, such as "♠♥♣♦π▚●○╳". Characters like ^, _, , {, } and | are also accepted and converted to the closest petscii equivalents.
- automatic static variable allocations, automatic string and array variables and string sharing
- subroutines with input parameters and result values
- high-level program optimizations
- no need for forward declarations
- small program boilerplate/compilersupport overhead
- programs can be run multiple times without reloading because of automatic variable (re)initializations.
- conditional branches
- when statement to provide a concise jump table alternative to if/elseif chains
- in expression for concise and efficient multi-value/containment check
- many built-in functions such as sin, cos, rnd, abs, min, max, sqrt, msb, rol, ror, swap, sort and reverse
- various powerful built-in libraries to do I/O, number conversions, graphics and more
- convenience abstractions for low level aspects such as ZeroPage handling, program startup, explicit memory addresses
- inline assembly allows you to have full control when every cycle or byte matters
- supports the sixteen 'virtual' 16-bit registers R0 - R15 from the Commander X16, and provides them also on the C64.
- encode strings and characters into petscii or screencodes or even other encodings, as desired (C64/Cx16)
- use a modern PC to do the work on, use nice editors and enjoy quick compilation times
- can automatically run the program in the Vice emulator after succesful compilation
- breakpoints, that let the Vice emulator drop into the monitor if execution hits them
- source code labels automatically loaded in Vice emulator so it can show them in disassembly
If you only use standard kernel and prog8 library routines, it is possible to compile the exact same program for both machines (just change the compiler target flag)!