Something about NASM.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
wishedtobe
Member
Member
Posts: 34
Joined: Sat May 04, 2024 7:48 am
Libera.chat IRC: wishedtobe

Something about NASM.

Post 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.
MichaelPetch
Member
Member
Posts: 813
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re: Something about NASM.

Post 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?
wishedtobe
Member
Member
Posts: 34
Joined: Sat May 04, 2024 7:48 am
Libera.chat IRC: wishedtobe

Re: Something about NASM.

Post 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.
User avatar
iansjack
Member
Member
Posts: 4750
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Something about NASM.

Post 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.
wishedtobe
Member
Member
Posts: 34
Joined: Sat May 04, 2024 7:48 am
Libera.chat IRC: wishedtobe

Re: Something about NASM.

Post 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.
Post Reply