People who code: we want your input. Take the Survey

Questions tagged [cc65]

The cc65 C compiler and toolchain, including ca65 (Assembler), cl65, ar65, etc.

Filter by
Sorted by
Tagged with
0
votes
1answer
176 views

Defining a C function with given address in cc65

I have a function that should be callable with the following syntax: void __fastcall__ initSIDplayer1(uint8_t a); The __fastcall__ modifier here means that the argument is passed in the Accu instead ...
1
vote
0answers
66 views

Run ca65 assembler with intermediate step of resolving macros

I would like to convert an assembler program in ca65 with macros into assembler code with resolved macros in order to carry out manual or automatic optimizations with the resulting code. Then, the ...
7
votes
2answers
507 views

Labels in cc65 inline assembler with #define macro

In general, it is possible to use inline assembler statements within C macros, for example #define toscreencode(C) (__AX__ = (C), \ asm("cmp #$60"),\ ...
4
votes
1answer
202 views

Commodore 64 CC65 - I need help with config set up for using a data segment in Bank 3

I'm developing a game for C64 using CC65 to compile my C code to ASM. To get started quickly, I have been defining the data for my sprites in C arrays and then copying the data in those arrays to the ...
3
votes
2answers
188 views

Printing German umlauts with cc65

I want to print German texts with umlauts with a compiled C program on the C64. I'm aware that these characters are not in the charset and that I will have to change the character set. However, it ...
3
votes
1answer
122 views

How to pass a value to an inline assembler script in a #define macro in cc65

I'm trying to add a compact #define macro in a cc65 program for performing various low-level tasks efficiently. For some of the macros, I need to pass a non-constant value to the assembler part. I ...
4
votes
3answers
199 views

ca65 vs tass syntax: converting a hex address to decimal?

Most of the tass example programs start with a header like this, which places BASIC code at the beginning of the file that has an appropriate SYS instruction to run the rest of the application: * ...
6
votes
1answer
587 views

Putting code into two different memory areas with cc65/ca65

According to cc65 / ca65 documentation, the .org directive does not affect the placement of the code unlike with other 6502 assemblers. The docs suggest defining a memory segment with the intended ...
5
votes
1answer
418 views

Adding control characters to string constants in ca65 assembler

According to the cc65 documentation, a string constant in assembler programs can be defined with the .ASCIIZ command. However, I could not manage to sneak control commands in, for example, the ...
9
votes
1answer
468 views

Different handling of ASCII interpretation between ca65 and cl65

I stumbled upon a divergence in the ASCII upper case/lower case handling when using assembler and linker of the cc65 suite separately (I used cc65 V2.15 on Win10). For a test I made the following ...
11
votes
1answer
710 views

cprintf printing invisible characters in C program on VIC 20

I want to compile and run a Hello World program in C with the cc65 compiler for an unexpanded VIC-20 model. For printing I'm using the conio.h function cprintf, since the conio implementation requires ...
3
votes
1answer
443 views

How to read disk files using CBM specific functions in cc65 with proper error checking

TL:DR What is the reason my kernel_read() function ignoring file errors? I'm trying to understand how to work with files in cc65 using CBM specific functions. My target is Commodore 64 with 1541 ...