Hi OsDevers.
I'm new to OS Developing and Assembler, and I've never got the thing about extrn . What does it do, and what do I have to specify etc?
I couldn't find anything on Google.
Oliver
Newbie Question: extrn
Re: Newbie Question: extrn
It tells the assembler that the label is within a different object file.
This is necessary when you want to link several object files.
This is necessary when you want to link several object files.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Newbie Question: extrn
It helps if you fix your spelling and search on "extern" insteadTheDaneProgrammer wrote:I've never got the thing about extrn .
-
- Posts: 14
- Joined: Wed Jun 23, 2010 11:08 pm
Re: Newbie Question: extrn
I'm guessing it depends on your assembler. I use TASM 5.0 (in MASM mode) and extern gives an error (just tried it) -- all my code uses extrn. But I suppose no one uses TASM any more.Combuster wrote:It helps if you fix your spelling and search on "extern" instead
Anyway to answer the OP in a tiny bit of detail, it goes something like this (um, in TASM/MASM, so YMMV if you're using NASM or something):
In one source file:
Code: Select all
foo: public foo
... does something ...
ret
Code: Select all
extrn foo:near
call foo
John Wilson
D Bit