This is true in a sense, but I'm trying to keep it moving very little nowadays to avoid breaking existing code.
Some cc65 compiler questions
- desertfish
- Posts: 1093
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
Re: Some cc65 compiler questions
-
- Posts: 292
- Joined: Wed Jun 03, 2020 11:33 am
- Location: Kalmar, Sweden
Re: Some cc65 compiler questions
In the context, I want to say that I think Prog8 is an extraordinary achievement. I am very impressed and think it is a fantastic contribution to the community even if I am right now focusing on C and cc65.
I would like to return to one of my original questions. It seems that you can change the BASIC stub. As I have mentioned before, I found this done in the demo for ZSMKit. In the config, segments are defined like this:
And in the code:
How do I write the same code in C?
I would like to return to one of my original questions. It seems that you can change the BASIC stub. As I have mentioned before, I found this done in the demo for ZSMKit. In the config, segments are defined like this:
Code: Select all
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
EXTZP: load = ZP2, type = zp, optional = yes;
GOLDEN: load = GOLDEN, type = bss, optional = yes;
LOADADDR: load = LOADADDR, type = ro;
BASICSTUB: load = MAIN, type = ro;
STARTUP: load = MAIN, type = ro;
CODE: load = MAIN, type = to;
...
Code: Select all
.segment "BASICSTUB"
.word entry-2
.byte $00,$00,$9e
.byte "2061"
.byte $00,$00,$00
.proc entry
jmp main
.endproc
-
- Posts: 14
- Joined: Tue Sep 19, 2023 9:58 pm
Re: Some cc65 compiler questions
I guess, first thing would be to run the demo to see what it does (before changing things).
I can compile it, and load "DEMO.PRG" into the emulator, but after "RUN", nothing happens. What is supposed to be done?
-
- Posts: 292
- Joined: Wed Jun 03, 2020 11:33 am
- Location: Kalmar, Sweden
Re: Some cc65 compiler questions
The demo loads some ZSM songs and plays them. But, actually, what the program does is not relevant in this particular case. I am just interested in how the one row in BASIC is generated. I can see exactly how it is done in assembly language and I think I understand how it works, but I don't know how to translate it to C.
-
- Posts: 14
- Joined: Tue Sep 19, 2023 9:58 pm
Re: Some cc65 compiler questions
If you understand the assembly, couldn't you just use it to glue it to your C-program (as a startup-sequence)?Johan Kårlin wrote: ↑Fri Nov 17, 2023 2:05 pmThe demo loads some ZSM songs and plays them. But, actually, what the program does is not relevant in this particular case. I am just interested in how the one row in BASIC is generated. I can see exactly how it is done in assembly language and I think I understand how it works, but I don't know how to translate it to C.
So when you type "RUN", the demo does something like playing songs on your system (I know, that's not the main-topic, but if the program is supposed to be the base for tinkering, it should at least work first, I think) ?
-
- Posts: 292
- Joined: Wed Jun 03, 2020 11:33 am
- Location: Kalmar, Sweden
Re: Some cc65 compiler questions
I guess that is the problem, I don’t know how to connect the solution to my C program even if I know assembler. But sure it can be a start to see that the demo works and see where I can take it from there.