cc65: How to get assembly _main called by BASIC starter?
Moderator: Moderators
- pixel
- Vic 20 Scientist
- Posts: 1359
- Joined: Fri Feb 28, 2014 3:56 am
- Website: http://hugbox.org/
- Location: Berlin, Germany
- Occupation: Pan–galactic shaman
cc65: How to get assembly _main called by BASIC starter?
Have defined "_main" and exported it but instead __MAIN_START__ is getting called. Anyone an idea what's wrong? Thanks a lot in advance.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
https://github.com/SvenMichaelKlose
Re: cc65: How to get assembly _main called by BASIC starter?
What you need to do is creating a linker config for assembly, look at the C64 config: https://github.com/cc65/cc65/blob/maste ... 64-asm.cfg ... copy this to vic20-asm.cfg and adjust the memory addresses. now you link the program like described (for C64) here: https://cc65.github.io/doc/c64.html#ss4.2 (and once you made it work, please submit the linker config and updated docs to cc65 repo)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
- pixel
- Vic 20 Scientist
- Posts: 1359
- Joined: Fri Feb 28, 2014 3:56 am
- Website: http://hugbox.org/
- Location: Berlin, Germany
- Occupation: Pan–galactic shaman
Re: cc65: How to get assembly _main called by BASIC starter?
Thanks man, but I really need to know the trick to getting _main called.groepaz wrote: ↑Fri May 29, 2020 3:53 am What you need to do is creating a linker config for assembly, look at the C64 config: https://github.com/cc65/cc65/blob/maste ... 64-asm.cfg ... copy this to vic20-asm.cfg and adjust the memory addresses. now you link the program like described (for C64) here: https://cc65.github.io/doc/c64.html#ss4.2 (and once you made it work, please submit the linker config and updated docs to cc65 repo)
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
https://github.com/SvenMichaelKlose
Re: cc65: How to get assembly _main called by BASIC starter?
there is no trick you'll have to post all of your non working code (including the exact commands used to build it) in order to find out whats wrong.
mind you, if you are not using C, then using the default linker config and _main as entry point is probably not what you want - since a lot of unnecessary things will happen, and you'll have to link library stuff that you probably dont need.
("__MAIN_START__" shouldnt ever get "called" btw, its not a code entry point at all - when that really happens its an indication of something else being wrong in your setup)
mind you, if you are not using C, then using the default linker config and _main as entry point is probably not what you want - since a lot of unnecessary things will happen, and you'll have to link library stuff that you probably dont need.
("__MAIN_START__" shouldnt ever get "called" btw, its not a code entry point at all - when that really happens its an indication of something else being wrong in your setup)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
- pixel
- Vic 20 Scientist
- Posts: 1359
- Joined: Fri Feb 28, 2014 3:56 am
- Website: http://hugbox.org/
- Location: Berlin, Germany
- Occupation: Pan–galactic shaman
Re: cc65: How to get assembly _main called by BASIC starter?
Here it is. https://github.com/SvenMichaelKlose/ing ... tifs-wedge
Went into Terminator mode trying to contribute once too often.
Went into Terminator mode trying to contribute once too often.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
https://github.com/SvenMichaelKlose
Re: cc65: How to get assembly _main called by BASIC starter?
the problem is that you are only linking to vic20.lib... you either must link to the crt0.o explicitly, or use .forceimport __STARTUP__ (which will pull in the crt0.o) in the asm file (or really...anywhere).
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
Re: cc65: How to get assembly _main called by BASIC starter?
Did it work?
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
- pixel
- Vic 20 Scientist
- Posts: 1359
- Joined: Fri Feb 28, 2014 3:56 am
- Website: http://hugbox.org/
- Location: Berlin, Germany
- Occupation: Pan–galactic shaman
Re: cc65: How to get assembly _main called by BASIC starter?
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
https://github.com/SvenMichaelKlose