Thanks both for your suggestions.
ThorstenOtto wrote:Solution 1: define the value for the label in a separate file, and include that in both sourcefiles
Solution 2: export the label by using something like ".globl graphicsdata" in file1, and also ".globl graphicsdata" in file2 to import it there (but that only works if file1 and file2 are linked together)
Solution 2 would be ideal, but unfortunately I won't be linking the files together.
With respect to Solution 1, the issue I have is that I need access to the absolute memory address at which the label resides, and this can only be established once file1.s has been assembled. So in order for file2.s to get the value it needs, file1.s first needs to be assembled, during which the absolute address of the label is provided as a side-effect. This information can then be used within file2.s.
I have come across an option in VASM (-L) that provides a line-by-line log of the assembly process:
Code: Select all
F00:0001 ORG $7a312
F00:0003 tst.w d2 ; set flags for d2
S01:0007A312: 4A 42
F00:0004 bpl.s label_7a32c ; branch if d2>0
S01:0007A314: 6A 16
F00:0005 tst.w d6
S01:0007A316: 4A 46
F00:0006 bmi label_7a63a
S01:0007A318: 6B 00 00 94
This log looks (with some parsing) as if it'll give me the information I need - I can parse the file to output an include file that will contain a list of labels along with the addresses to which they've been assembled. The file doesn't really look like it's intended to be machine-readable but I suspect that it's the best option open to me as things stand
charles wrote:store a loader in the tos at fixed address or ram disk with data ?
Thanks for your suggestions. I'm looking to avoid fixed addresses if possible (for a couple of reasons) and a ram disk might be a bit overkill for this need