線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1686
推到 Plurk!
推到 Facebook!

讀取CMOS的記錄值取得XMS容量大小

 
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#1 引用回覆 回覆 發表時間:2002-12-11 17:57:35 IP:61.218.xxx.xxx 未訂閱

讀取CMOS的記錄值取得XMS容量大小

讀取CMOS的記錄值取得XMS容量大小,還可以利用它裡面的函式來讀取其它CMOS的設定值哦..
 #include < dos.h >
 #include < stdio.h >
 #pragma inline      const int cmos_port_write = 0x70;
  const int cmos_port_read  = 0x71;      unsigned get_cmos( unsigned char low, unsigned char high );      int main()
  {
      unsigned ext;
      ext = get_cmos(  0x30, 0x31 );
      printf( "Installed extenden memory detected by POST:  %8uk\n", ext);
      return( 0 );
 }     unsigned get_cmos (  unsigned char low, unsigned char high )
 {
     unsigned word;
     unsigned char *p;
     unsigned char  l,h;         p = ( unsigned char *) &word;         disable();         outportb( cmos_port_write,high );
     asm jmp short $ 2
     h = inportb( cmos_port_read );         outportb( cmos_port_write, low );
     asm jmp short $ 2
     l = inportb( cmos_port_read );         *p = l;
     *(p 1) = h;         enable() ;
     return word;
 }
聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]--- 發表人 - axsoft 於 2002/12/11 18:04:50
系統時間:2024-05-06 4:21:03
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!