Jump to content

Search the Community

Showing results for tags 'language'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Commander X16 Forums
    • Introductions
    • X16 Discussion Lounge
    • X16 Help & Support Lounge
    • Off-topic Lounge

Categories

  • Official Software
  • Official Docs
  • Community Downloads
    • Games
    • Productivity Apps
    • Graphics Apps
    • Audio Apps
    • Demos
    • Networking Apps
    • Dev Tools
    • Tutorial Apps
    • Misc Apps

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me

Found 1 result

  1. So after piecing together the memory map of the Commander X16 and getting the emulator working I set out to make the necessary changes in my programming language Prog8 compiler to support a second target machine architecture beside the C64. Prog8 is a free programming language that is written on a modern computer and is then cross-compiled into a machine code binary for 6502 8-bit machine targets such as the Commodore-64 and/or the Commander X16. 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) Some micro-benchmarks (not by me) to compare it to other languages and compilers such as cc65 can be seen here. If you would like to help this project, the easiest thing to contribute perhaps is making a syntax-highlighting file for your favorite text editor! Here is a github issue tracking this effort What does Prog8 provide? big reduction of source code length over raw assembly modularity, symbol scoping, subroutines various data types other than just bytes (16-bit words, floats, strings) automatic variable allocations, automatic string and array variables and string sharing subroutines with parameters and return values variables are allocated statically various high-level optimizations small program boilerplate/compilersupport overhead sane variable initialization, programs can be restarted again just fine after exiting to basic conditional branches floating point operations (requires the C64 Basic ROM routines for this) 'when' statement to provide a concise jump table alternative to if/elseif chains many built-in functions such as sin, cos, rnd, abs, min, max, sqrt, msb, rol, ror, swap, sort and reverse various powerful library modules for I/O, number conversion, graphics and other things structs to group together sets of variables and manipulate them at once convenience abstractions for low level aspects such as ZeroPage handling, program startup, explicit memory addresses fast execution speed due to compilation to native assembly code 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 as desired (C64/Cx16) Rapid edit-compile-run-debug cycle: 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 Two supported compiler targets (contributions to improve these or to add support for other machines are welcome!): "c64": Commodore-64 (6510 CPU = almost a 6502) support (main target) "cx16": Commander X16 (65c02 CPU) support. 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)! Here is one of the simpler programs that I made in Prog8 for the Cx16, it renders the well-known Mandelbrot fractal (using floating point calculations): For those interested this is the source code of the above program: %import textio %import floats %zeropage basicsafe main { const uword width = 60 const uword height = 50 const ubyte max_iter = 16 sub start() { txt.print("calculating mandelbrot fractal...\n\n") ubyte pixelx ubyte pixely for pixely in 0 to height-1 { float yy = (pixely as float)/0.40/height - 1.3 for pixelx in 0 to width-1 { float xx = (pixelx as float)/0.32/width - 2.2 float xsquared = 0.0 float ysquared = 0.0 float x = 0.0 float y = 0.0 ubyte iter = 0 while iter<max_iter and xsquared+ysquared<4.0 { y = x*y*2.0 + yy x = xsquared - ysquared + xx xsquared = x*x ysquared = y*y iter++ } txt.color2(1, max_iter-iter) txt.chrout(' ') } txt.chrout('\n') } } }
×
×
  • Create New...

Important Information

Please review our Terms of Use