X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Rod Pemberton" Newsgroups: comp.os.msdos.djgpp Subject: Re: argv[0] Date: Thu, 1 Dec 2011 20:49:45 -0500 Organization: Aioe.org NNTP Server Lines: 40 Message-ID: References: <16b04d29-8317-4c7f-929c-1a22a328fa32 AT p9g2000vbb DOT googlegroups DOT com> <9bf257a7-a0f8-43ba-a65f-36c6027f68cb AT r28g2000yqj DOT googlegroups DOT com> NNTP-Posting-Host: qBjb0U1QTH77eiTXJSCpEw.user.speranza.aioe.org X-Complaints-To: abuse AT aioe DOT org X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.2001 X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Microsoft Outlook Express 6.00.2800.2001 X-Priority: 3 X-MSMail-Priority: Normal Bytes: 2683 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Georg" wrote in message news:cc43d375-8e59-425d-a32e-b4ca200ae5cc AT 4g2000yqu DOT googlegroups DOT com... > > I tried to follow your suggestion 2, but > did not succeed. It seems to read the environment segment ok > but does not read the right environment data. Below are my experiences with your code. Maybe ... sometime this weekend, I'll try my suggestions to see what I can determine. > Can you spot what I am doing > wrong? I am testing in a Windows XP DOS box. > > [code] I tried that code out. It has the problem that you mention above. :-) From what I can tell, it seems the "environment block" is *somewhere* in the segment returned by the value at 0x2C. Where exactly it is within the segment seems to be the issue. It seems to move when I recompile... (?!?!) Within the environment block, there will be a full pathname. The "environment block" was well over 27K above the segment start given by value at 0x2C. The PSP segment seems to change, but the value at 0x2C always seems to be 9F 00 here... (?!?!) So far, I'm not familiar enough with this to determine if something is incorrect or what is wrong if something is incorrect. I'm getting some strange results. I'm not sure what to make of them at this point in time. I hope you have a good, in-depth, book on programming DOS. You might drop a post to comp.os.msdos.programmer and ask if anyone knows how to get the filename. Mention the PSP and RBIL table 01739. Their solution will likely be in assembly or a text description, but that may help. I haven't searched the Usenet archives yet. c.o.m.d. might have something, or another group might. Rod Pemberton