#include <stdio.h>
#include <string.h>
#include <dos.h>
int getvm()
{
union REGS r;  
int86( 0x10, &r, &r ); 
r.h.ah = 0x0f;
return (int)r.h.al;
}我查了MSDN,但仍不知所云,麻烦指点一下

解决方案 »

  1.   

    调用0x0f中断,见<<C语言大全>>
      

  2.   

    union REGS r
    请问这个构造是做什么用的,有那些特性?
      

  3.   

    REGS 是用来保存寄存器值的。
      

  4.   

    那段代码与这段等价_AH=0xf;
    geninterrupt(0x10);
    return _AL;
      

  5.   

    to  binarier(沙子) 
    geninterrupt(0x10)也是中断?怎么在MSDN里找不到?
      

  6.   

    #include <stdio.h>
    #include <string.h>
    #include <dos.h>
    int getvm()
    {
    union REGS r;  
    int86( 0x10, &r, &r ); 
    r.h.ah = 0x0f;
    return (int)r.h.al;
    }can not run in win32. only can run in win16.
    it call interupt 16(0x010).
    function code 0xf.
    return is set in AL register.
      

  7.   

    我的这段例程是串口通讯用的,是否直接用Createfile,Readfile,Writefile可自动实现上述中断?
      

  8.   

    我的这段例程是串口通讯用的,是否直接用Createfile,Readfile,Writefile可自动实现上述中断?
      

  9.   

    DOS 下好像不行。
    int86 和 geninterrupt 都是dos 下的库函数。
      

  10.   

    调用中断啦,在Windows下当然不可以啦!
    int86( 0x10, &r, &r ); 
    调用0x10中断,可能是显示中断.
      

  11.   

    我不太明白,为什么16位就需使用中断,而32位就不可?还是写句老话:我的这段例程是串口通讯用的,是否直接用Createfile,Readfile,Writefile可自动实现上述中断?
      

  12.   

    10中断应该是显示,但是是不是顺序反了,应该是这样吧
    union REGS r;  
    r.h.ah = 0x0f;
    int86( 0x10, &r, &r ); 
    ,不然r.h.ah = 0x0f;岂不是废代码
      

  13.   

    在win32下不能用。在DOS下可以的.