Jump to content


  • Posts

  • Joined

  • Last visited

JvH's Achievements


Newbie (1/14)

Week One Done One Month Later

Recent Badges



  1. In the Commander X16 emulator, in the built-in debugger that you can open with F12, there are 2 fields above the program counter and stack pointer called BKA and BKO. What are these for?
  2. Finally, I figured it all out. Thanks guys for your help. Assembling library method into separate object files and using ar65 to put them into lib files does exactly what I'm aiming for: only assembling the code that I actually use in my main program. I also realized what I was doing wrong with the .ifref approach. For now I directly include the asm files that make up my main program. I did have a vera.inc file containg my globals (including the clearScreen symbol) and vera.asm that contained the clearScreen method itself. In my main program though I only included vera.inc, so the clearScreen symbol+implementation couldn't be found. Another lesson learned
  3. In that case I'd highly recommend cc65 I have started a discussion about this on cc65's Github page. Maybe that will lead to some new insights.
  4. That's a bummer, but yes I expect that's actually what's happening here. Did you bother to solve this in your demo, or did you just include your entire graphics library?
  5. Indeed, that's what the documentation says. So I've already tried including vera.inc at the end of my main program's asm file. Still, it gives the same error. I also tried switching vera.o and program.asm in the call to cl65, but that didn't help either.
  6. I'm trying to create an object file containing VERA-related subroutines, but I can't get it working. I've got vera.inc, which contains (among other things): .global clearScreen I have vera.asm: .include "vera.inc" ... .ifref clearScreen .proc clearScreen ... .endproc .endif In my main program I have: .include "vera.inc" ... jsr clearScreen I get the error: "Unresolved external 'clearScreen' referenced in: program.asm(12) ld65: Error: 1 unresolved external(s) found - cannot create output file" If I remove the .ifref ... .endif lines it works, but I'd really like to include only the stuff from vera.o that I actually need. What am I doing wrong?
  7. Ah right my wording was a bit too simplistic. Thanks for your answer. With this knowledge I can begin restructuring and tidying up the littte game I'm trying to put together.
  8. Hello Stephen, thanks for your answer. Let me check if I understand this correctly. * You put all global symbols from math.asm in a separate math.inc file, and you include that file (with .include) in math.asm * Assembling math.asm yields math.o, which contains the ML code + the used symbols * In splash.asm you .include math.inc, but when linking you refer to math.o Am I correct? Another question that comes to mind: Suppose you have a math.asm with cos, sin and tan functions. Let's assume, for the sake of argument, that those functions don't share any code. Now if you include math.inc in your program only to use the sine function, I assume math.asm will still be added to the prg file in its entirety. Is that correct? EDIT: now that I come to think of it, I suppose that is what .ifref could be used for... EDIT2: oh right, that's exactly what the documentation says
  9. Hi Elektron72, Thanks for your very quick reply! Indeed, I don't think I'll need this anytime soon. Still curious why they included it in a config that is specific to assembly. Maybe when you assemble your code into a module and link that into a C project. Could you explain to me how that works? Is it a matter of exporting the symbols you're going to need externally, assembling your code into a .o file (without the BASIC header of course) and then including that .o file when calling cl65?
  10. Hello! During the last couple of days I've been converting a CBM prg Studio ML project (target: Commodore 64) to CX16. I'm using the cc65 suite to assemble my code. At this moment there are 2 things about cc65 that I don't really understand. 1) The CONDES section in cx16-asm.cfg From what I understand, this is mostly meant for C development. Each module can 'export' pointers to their constructor and destructor code, so that this code is called before/after main() is executed. I am, however, only using assembly. So my questions are: * What purpose does it serve when you're using only assembly? It's in cx16-asm.cfg after all, so it must be there for a reason right? * The constructor entry refers to a segment (ONCE) that's not even present in the configuration. Is this created on-the-fly? If so, in which memory segment does it get added? * What is the interruptor entry for? 2) Working with multiple files In hopes of increasing readability, I split my project into multiple files. I use .include to refer to other files, which just inserts the file contents at the position of the .include. I'm really not sure if this is the way to go. Yes, I don't have to .import and .export and still have access to all identifiers in my code. But the downside is that you really have to be careful about including files twice or including them in the wrong order. Are there some developers with experience in cc65 who can give me some hints and tips on managing multi-file cc65 projects? Thanks in advance for your replies.
  • Create New...

Important Information

Please review our Terms of Use