From: "Fredrik Hellman" Newsgroups: comp.os.msdos.djgpp References: <3A5A150E DOT E6EE5A6 AT telia DOT com> <200101081952 DOT OAA05184 AT envy DOT delorie DOT com> <200101082101 DOT QAA05779 AT envy DOT delorie DOT com> Subject: SV: SV: Strange function addresses Lines: 73 Organization: Freli X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Message-ID: <05H66.4381$AH6.751273@newsc.telia.net> Date: Tue, 09 Jan 2001 16:35:08 GMT NNTP-Posting-Host: 62.20.144.121 X-Complaints-To: abuse AT telia DOT com X-Trace: newsc.telia.net 979058108 62.20.144.121 (Tue, 09 Jan 2001 17:35:08 CET) NNTP-Posting-Date: Tue, 09 Jan 2001 17:35:08 CET To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com DJ Delorie skrev i diskussionsgruppsmeddelandet:200101082101 DOT QAA05779 AT envy DOT delorie DOT com... > > > I'll test that. But the strange thing is that the code doesn't work on a > > 386DX..... > > DJGPP was originally written on a 386DX. What, exactly, happens when > you try to run it? Here is the code: init_con(&main_con); /* Init the main-console */ cls(); /* Clear the screen */ asm("nop\nnop\nnop\n"); /* Debugging information */ asm("nop\nnop\nnop\n"); asm("nop\nnop\nnop\n"); asm("nop\nnop\nnop\n"); asm("nop\nnop\nnop\n"); printsa("test before entering printk", 3, 3, 1); printk("|| <= The printsa call. The printsa function is in the same .o file while.... 112: 83 c4 10 add $0x10,%esp 115: 83 c4 f4 add $0xfffffff4,%esp 118: 68 cc 00 00 00 push $0xcc 11d: e8 de fe ff ff call 0 <.text> <= ....printk isn't 122: 83 c4 10 add $0x10,%esp 00000088 <_printsa>: 88: 55 push %ebp 89: 89 e5 mov %esp,%ebp 8b: 83 ec 18 sub $0x18,%esp 8e: 8b 45 0c mov 0xc(%ebp),%eax 91: 8b 55 10 mov 0x10(%ebp),%edx I don't really understand why the program is linked in this strange way... Fredrik Hellman