Page 1 of 1
Something about NASM.
Posted: Wed Jan 29, 2025 6:33 am
by wishedtobe
Is there any way to import external labels without directly including their corresponding files?
I have written a program that loads a file into the memory, and then jump to a certain address, which needs an external label to locate it.
Re: Something about NASM.
Posted: Wed Jan 29, 2025 10:13 am
by MichaelPetch
Are you using a linker like LD to link? Or are you using NASM to generate a binary file with no link step?
Re: Something about NASM.
Posted: Wed Jan 29, 2025 9:27 pm
by wishedtobe
MichaelPetch wrote: ↑Wed Jan 29, 2025 10:13 am
Are you using a linker like LD to link? Or are you using NASM to generate a binary file with no link step?
No.
Re: Something about NASM.
Posted: Thu Jan 30, 2025 5:04 am
by iansjack
The bin format doesn't support external symbols.
But, presumably, you are defining the second file to load at a particular location. Why can't you just use EQU to define that location? More details about exactly what you are trying to achieve would help.
Re: Something about NASM.
Posted: Thu Jan 30, 2025 7:11 am
by wishedtobe
iansjack wrote: ↑Thu Jan 30, 2025 5:04 am
The bin format doesn't support external symbols.
But, presumably, you are defining the second file to load at a particular location. Why can't you just use EQU to define that location? More details about exactly what you are trying to achieve would help.
If I don't have a simpler way, I can only adopt the one you mentioned.