Jump to content


  • Posts

  • Joined

  • Last visited

C3c's Achievements


Newbie (1/14)

One Month Later Dedicated First Post Reacting Well Conversation Starter Rare

Recent Badges



  1. Below is a worked example (for the CA65 assembler) on how to load a file called "MAPS.BIN" into a memory location (map_location) in assembly. As you can see, you first have to call the SETLFS and SETNAM functions, after which you can call the LOAD function. See this page for some documentation on these Commodore 64 API calls. IMPORTANT: if you are using the emulator, the file name on your file system should be in UPPER CASE. The file name in the code should be in lower case. B.t.w. Can anybody tell me how to properly format code on this forum? Edit: sorry, didn't read your post properly, I assumed you were talking about using assembly, not C. .org $080D .segment "STARTUP" .segment "INIT" .segment "ONCE" .segment "CODE" jmp start .macro ram_load filename_start, filename_end, ram_address ; overwrites A, X, Y .scope SETLFS = $FFBA SETNAM = $FFBD LOAD = $FFD5 filename_length = filename_end - filename_start lda #01 ldx #08 ldy #0 jsr SETLFS lda #filename_length ldx #<filename_start ldy #>filename_start jsr SETNAM lda #0 ldx #<ram_address ldy #>ram_address jsr LOAD .endscope .endmacro start: ram_load map_filename, map_filename_end, map_location rts map_filename: .byte "maps.bin" map_filename_end: map_location:
  2. Hi Everyone! Like many other people around here, I'm using the CA65 assembler to develop for the X16. One thing I don't really understand is what the .SEGMENT command does exactly. I find the CA65 documentation a bit terse on this matter: Could any tell me what exactly happens if I use .SEGMENT "DATA" inside my code? Thanks! Cedric
  • Create New...

Important Information

Please review our Terms of Use