Search the Community
Showing results for tags 'cc65'.
Found 4 results
Hi, I am working on a larger project and need to understand better how the structuring in files and the placing in memory works. The project will be a pure assembler project and also will not use any BASIC operation. Question 1: I will need to define a lot of variables inside ZP. As far as I understood I can use $02-$7F and $A9-$AF. How do I need to setup the cx16.cfg ZP directive, that it does automatically assign the bytes to the allowed windows? This does work (e.g compiles) to enable more ZP bytes then the normal $20-$7F ... but it obviously would just overwrite $80- $A8, which is unsave for the Kernal and might crash the machine (makes kernel functions unusable). Question 2: Maybe related to the first one: As I do not know how many variables I will have and may want to change them during the development process and they all have different length, I want to use the .res statement to define the length of each variable and using labels to get the symbols for the addresses of each ZP. I did something like that: As my ZP segement starts @$02 ZP will point to $02 as well as RAND and TRPTB will point to $06. My issue with that is, that the compiler will actually create code and place it into memory after loading. Is there any other way of automatically (in opossition to calculate everything manually) define some symbols (e.g. memory addresses) but not get it actually compiled into the source code? I can see the EXTZP segment in the cx16-asm.cfg ... but what does it mean? It has not been defined. Also I do not understand how to load things like LOADADR correctly. It is getting imported... from where? That brings me to my question 3: I like to have a main PRG file (e.g. loader) and some .bin files that keep individual parts of the real program, such as models or math library or main loop etc. From the file structure I do understand how to create multiple source files and exporting symbols I want to use from outside. However how do I instruct the assembler/linker to create a .bin file out of a given object file? Lets assume I want to have the following three files out of the input files: Loader.s => LOADER.PRG math.s => GAME1.BIN models.s => GAME2.BIN mainloop.s => GAME3.BIN Question 4: Also I want to instruct the linker to put the GAME2.BIN @$A000 to be able to use it in a BANK. How can I use multiple BIN files using the same address space, as they are all sitting in BANKS (so all starting with $A000?) Question 5: How do I get all this together, that all the parts can be loaded to the corresponding RAM areas? (I am not talking about the Loader here, but how does the linker get the correct addresses to math.s and how do I get those addresses to get my loader right (e.g. prepare the right bank before loading it). I would be interested in a good documentation, that goes into those details to understand much better the building process. I see you heavily using it for the KERNAL but even there I do not even understand were it starts and how it works. The official documentation does not go into any detail on that - it is a good reference, but not very good to learn.
Getting "Hello World" to work using cl65 requires knowledge buried in the docs somewhere. It compiles. I load it and invoke with a "sys $a200". I'm obviously missing something. OH! Do I need to worry about BANK ZERO? => Answered my own question: yes, but that's not the problem, it still doesn't run. ; ; cl65 -o saludo.prg -t cx16 -C cx16-asm.cfg saludo. ; chrout = $ffd2 .org $A200 .export LOADADDR = * Main: ldx #0 loop: lda hello,x jsr chrout inx cpx #<(hellodone-hello) bcc loop exit: rts hello: .byte "--- HOLA MUNDO! ---" hellodone: .byte 0
libX16 View File libX16 is a utility library for those using C with the CC65 toolchain for the Commander X16. Library documentation is available from the github page: https://github.com/CJLove/libX16. Currently it supports loading/saving files to banked RAM and VRAM, playing sound data for the YM2151, and providing a VERA header file with additional constant definitions beyond those provided by CC65. This is a beta v0.1.0 release of libX16 for the Commander X16 rom version r37 and CC65. The attached artifact includes the library header files and library file for linking. Alternatively the library can be referenced as a git submodule in a github repo via the .gitmodules file: [submodule "libX16"] path = libX16 url = https://github.com/CJLove/libX16 Submitter ChrisL Submitted 07/11/20 Category Dev Tools
5 downloadslibX16 is a utility library for those using C with the CC65 toolchain for the Commander X16. Library documentation is available from the github page: https://github.com/CJLove/libX16 This is a beta v0.1.0 release of libX16 for the Commander X16 rom version r37 and CC65. The attached artifact includes the library header files and library file for linking. Alternatively the library can be referenced as a git submodule in the .gitmodules file: [submodule "libX16"] path = libX16 url = https://github.com/CJLove/libX16