Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOADable binaries on CBM/X16 #379

Open
ToboterXP opened this issue Oct 2, 2024 · 1 comment
Open

LOADable binaries on CBM/X16 #379

ToboterXP opened this issue Oct 2, 2024 · 1 comment

Comments

@ToboterXP
Copy link
Contributor

On CBM machines (including the Commander X16) it is possible to load and execute a new file by pushing an address to the stack, then jmp-ing to LOAD.
But for this to be possible, you have to be able to compile your code to a binary file with a fixed entry point (ideally the start of the file).
Would it be possible to add the necessary CLI options, so that a file with fixed entry point, and ideally no BASIC header and no renewed hardware initialisation (outside of what's actively necessary to run C) could be generated?

@ToboterXP ToboterXP changed the title C-callable binaries on CBM/X16 LOADable binaries on CBM/X16 Oct 2, 2024
@mlund
Copy link
Contributor

mlund commented Oct 3, 2024

What you describe should be possible with a custom linker script; have a look in the mos-hardware/commodore/ and derived directories for the link.ld file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants