Path: utzoo!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!osu-cis!sppy00!jmv From: jmv@sppy00.UUCP (Jim Vickroy) Newsgroups: comp.sys.ibm.pc Subject: Re: Question 1 of 3 for assembly language programmers. Keywords: Is there an equivalent to argc,argv in ass'y? Message-ID: <294@sppy00.UUCP> Date: 18 Apr 89 14:40:17 GMT References: <4496@tekigm2.MEN.TEK.COM> Reply-To: jmv@sppy00.UUCP (Jim Vickroy) Distribution: na Organization: Online Computer Library Center, Dublin, Ohio. Lines: 41 In article <4496@tekigm2.MEN.TEK.COM> alanr@tekigm2.MEN.TEK.COM (Alan Rovner) writes: => =>Can I access DOS command line arguments through assembly language? =>This would be the equivalent to using argc and argv in C. I would =>appreciate a short example if possible. Yes you can. The command line parameters are passed to you through the PSP, specifically at offset 81 hex. Located at offset 80 hex is a byte which is the length of the parameter string. The command line is delivered intact: If you launched a program: MYPROG -a -b -cde filename the PSP would contain this information: Offset Contents ======= ========================================= 80h 13h 81h-94h "-a -b -cde filename" (excluding the "'s) Sorry, I don't have source right here to include. If you have problems, e-mail a request and I'll try to round up the appropriate code segment.. Good luck.... jim -- ============================================================================== :::: ::: :: :: : : Jim Vickroy |OC| ||| || || | | Technical Services Department |LC| ||| || || | | Online Computer Library Center, Inc. :::: ::: :: :: : : Dublin, Ohio ------------------------------------------------------------------------------ UUCP: {att|pyramid|killer}!osu-cis!sppy00!jmv domain: jmv@sppy00.uucp USSNAIL: 6565 Frantz Rd., Dublin, Ohio 43017-0702 ------------------------------------------------------------------------------ "They came. They saw. They kicked butt." -Nike shoe ad ==============================================================================