From: "Jack Klein" Newsgroups: comp.os.msdos.djgpp Subject: Re: Dumb questions to you but important to me Date: 1 Oct 1997 05:27:55 GMT Organization: AT&T WorldNet Services Lines: 38 Message-ID: <60sn0r$j3v@bgtnsc02.worldnet.att.net> References: NNTP-Posting-Host: 12.66.120.193 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Arthur Bredrick wrote in article ... > I am completely new to DJGPP and relatively inexperienced with C, so I have > a few questions. I downloaded Martynas Kunigelis' keyboard interrupt > handler example and in the keyboard.s file are the following declarations: > > .extern ___djgpp_base_address > .extern ___djgpp_ds_alias > .extern ___djgpp_dos_sel > > Would anyone tell me where these come from and what they are used for? > > Another question not DJGPP specific: Why do extra underscores precede > identifiers when interfacing between assembly and c? For example, the > assembly function _keyboard_init would be c-callable as just keyboard_init, > without the extra underscore. Thanks for any help. > > Art Hi Art, This is necessary for C compilers which generate assembly language and use an assembler as part of the translation. If the compiler did not do this, you would have to be very careful in writing your code not to give any variables or functions names which happen to be reserved words for the assembler (like EAX, JMP, and so on), or they would cause errors in the assembler. Jack