Re: Making 6809 position independent
David Broman via Coco <coco-uNHYcr1XS/wmlAP/[email protected]>
| Newsgroups | gmane.comp.hardware.tandy.coco |
|---|---|
| Message-ID | <LV3P220MB141103652C77C862B7831792CFFAA@LV3P220MB1411.NAMP220.PROD.OUTLOOK.COM> |
If you want your data to move around with your code, you'll need to use PC-relative addressing for your loads & stores. I think LOADM"FILE",xxx loads the binary, applying the offset xxx to the original load address. So you'd need to know the original load address to calculate the offset to get it to load where you want to. Or make the original load address 0, perhaps, to make it easier. -----Original Message----- From: Coco <[email protected]> On Behalf Of Allen Huffman via Coco Sent: Wednesday, October 29, 2025 10:01 AM To: CoCoList for Color Computer Enthusiasts <[email protected]> Cc: Allen Huffman <[email protected]> Subject: [Coco] Making 6809 position independent Surely I knew this, because I wrote OS-9/6809 code which has to be position independent… But… As long as I avoid things like JMP (unless jumping to a fixed location such as in ROM), should my code be loadable anywhere in BASIC? I completely forget how to do this. I have built a routine to load at &H7F00 but I want it to be loadable anywhere — such as a lower address for a 16K system. Can someone here remind me how that worked? I recall LOADM “FILE”,xxx …or something. It’s been way too long for me! — A -- Coco mailing list [email protected] https://pairlist5.pair.net/mailman/listinfo/coco -- Coco mailing list [email protected] https://pairlist5.pair.net/mailman/listinfo/coco