CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  C/C++ >  C语言

关于psp(程序段前缀)和 argv

楼主SysPlus(万诱引力)2002-09-13 10:11:22 在 C/C++ / C语言 提问

在256个字节的psp数据当中,前127个字节是留给程序名的,而后半字节留给程序参数和其他程序信息,那么除了参数部分的信息,怎么查阅呢?还有他们都会有什么样的功能?  
  书上说当一个程序运行的时候,会把psp数据放到argv指向的缓冲区中,那么说可以用指针查看咯。。。  
  请教!  
  win32程序执行大部分是通过鼠标的双击,那么怎么给他们添加参数呢?  
  问题点数:100、回复次数:3Top

1 楼dsangvei(十年一剑)回复于 2002-09-13 14:55:04 得分 80

:Program   Segment   Prefix:PSP  
  ^PSP   -   DOS   Program   Segment   Prefix   Layout  
   
  %           Offset   Size             Description  
   
  00       word machine   code   ~INT   20~   instruction   (CDh   20h)  
  02       word top   of   memory   in   segment   (paragraph)   form  
  04       byte reserved   for   DOS,   usually   0  
  05     5bytes machine   code   instruction   long   call   to   the   DOS  
  function   dispatcher   (obsolete   CP/M)  
  06       word .COM   programs   bytes   available   in   segment   (CP/M)  
  0A       dword ~INT   22~   terminate   address;     DOS   loader   jumps   to   this  
  address   upon   exit;     the   EXEC   function   forces   a   child  
  process   to   return   to   the   parent   by   setting   this  
  vector   to   code   within   the   parent   (IP,CS)  
  0E       dword ~INT   23~   Ctrl-Break   exit   address;   the   original   INT   23  
  vector   is   NOT   restored   from   this   pointer   (IP,CS)  
  12       dword ~INT   24~   critical   error   exit   address;   the   original  
  INT   24   vector   is   NOT   restored   from   this   field   (IP,CS)  
  16       word parent   process   segment   addr   (Undoc.   DOS   2.x+)  
  COMMAND.COM   has   a   parent   id   of   zero,   or   its   own   PSP  
  18     20bytes file   handle   array   (Undocumented   DOS   2.x+);   if   handle  
  array   element   is   FF   then   handle   is   available.     Network  
  redirectors   often   indicate   remotes   files   by   setting  
  these   to   values   between   80-FE.  
  2C       word segment   address   of   the   environment,   or   zero   (DOS   2.x+)  
  2E       dword SS:SP   on   entry   to   last   INT   21   function   (Undoc.   2.x+)   ?  
  32       word handle   array   size   (Undocumented   DOS   3.x+)  
  34       dword handle   array   pointer   (Undocumented   DOS   3.x+)  
  38       dword pointer   to   previous   PSP   (deflt   FFFF:FFFF,   Undoc   3.x+)   ?  
  3C     20bytes unused   in   DOS   before   4.01     ?  
  50       3bytes DOS   function   dispatcher   CDh   21h   CBh   (Undoc.   3.x+)   ?  
  53       9bytes unused  
  5C     36bytes default   unopened   ~FCB~   #1   (parts   overlayed   by   FCB   #2)  
  6C     20bytes default   unopened   FCB   #2   (overlays   part   of   FCB   #1)  
  80       byte count   of   characters   in   command   tail;     all   bytes  
  following   command   name;     also   default   ~DTA~   (128   bytes)  
  81   127bytes all   characters   entered   after   the   program   name   followed  
  by   a   CR   byte  
   
   
   
  -   offset   5   contains   a   jump   address   which   is   2   bytes   too   low   for  
      PSP's   created   by   the   DOS   EXEC   function   in   DOS   2.x+     ?  
  -   program   name   and   complete   path   can   be   found   after   the   environment  
      in   DOS   versions   after   3.0.     See   offset   2Ch.Top

2 楼dsangvei(十年一剑)回复于 2002-09-13 14:57:55 得分 20

在运行(WIN+R)里输入命令,后接参数,Top

3 楼SysPlus(万诱引力)回复于 2002-09-13 19:35:32 得分 0

thanks...Top

相关问题

  • 在程序代码中,表名前的dbo前缀是加上好呀?还是不加上好?
  • 小弟参考一些网络资料,做了一个下载程序,在下在地址中使用http为前缀可以,以ftp为前缀不可以,怎么办
  • 在程序中不能使用 _argv[1]
  • 变量名前缀
  • 关于AFX_前缀
  • 在Window程序中怎样得到argc ,argv,象控制台程序有main( int argc , char ** argv );
  • 前缀表达式问题
  • main(int argc,char *argv[])格式的程序如何运行?
  • 关于main的argv argc 请大伙帮我看一个程序
  • MFC程序怎么样象控制台程序argc,argv那样取得跟在程序名后面输入的参数?

关键词

  • psp
  • program
  • code
  • ip
  • x+
  • undoc
  • 程序
  • fcb
  • 参数
  • undocumented

得分解答快速导航

  • 帖主:SysPlus
  • dsangvei
  • dsangvei

相关链接

  • C/C++ Blog
  • C/C++类图书
  • C/C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo