View Single Post
Old 21 December 2018, 20:01   #1
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Making relocatable code - vasm

Hi all,

I've made use of the basereg directive in vasm today and it is really useful as it results in much cleaner/faster code.

To improve things further I'm looking at making my project completely PC relative and have been wondering the best way to reference memory pointers.

Consider the following snippet.

Code:
START: moveq #0,d0
           lea DATA(pc),a0
           rts

DATA:  dc.l   START
The pointer stored in DATA to START obviously breaks relocating the program, but is there a way in VASM to perhaps create offsets in the longword pointers instead of direct addresses?

The idea is that I need to load my program from a bootstrap that has allocated memory.

I hope this makes sense... I perhaps do not have some of the right terminology but I hope you know what I mean.

Geezer
mcgeezer is offline  
 
Page generated in 0.15038 seconds with 11 queries