Chinaunix首页 | 论坛 | 博客
  • 博客访问: 14490310
  • 博文数量: 5645
  • 博客积分: 9880
  • 博客等级: 中将
  • 技术积分: 68081
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-28 13:35
文章分类

全部博文(5645)

文章存档

2008年(5645)

我的朋友

分类:

2008-04-28 20:47:37

下载本文示例代码
  1 .端口读写function ReadPortB( wPort : Word ) : Byte; begin  asm  mov dx, wPort  in al, dx  mov result, al end;end;procedure WritePortB( wPort : Word; bValue : Byte ); begin  asm    mov dx, wPort   mov al, bValue   out dx, al end;end;  2.获知当前机器CPU的速率(MHz)function CPUSpeed: Double; const  DelayTime = 500; var  TimerHi, TimerLo: DWORD;  PriorityClass, Priority: Integer; begin PriorityClass := GetPriorityClass(GetCurrentProcess); Priority := GetThreadPriority(GetCurrentThread); SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS); SetThreadPriority(GetCurrentThread, THREAD_PRIORITY_TIME_CRITICAL); Sleep(10);共2页。 1 2 8 :   1 .端口读写function ReadPortB( wPort : Word ) : Byte; begin  asm  mov dx, wPort  in al, dx  mov result, al end;end;procedure WritePortB( wPort : Word; bValue : Byte ); begin  asm    mov dx, wPort   mov al, bValue   out dx, al end;end;  2.获知当前机器CPU的速率(MHz)function CPUSpeed: Double; const  DelayTime = 500; var  TimerHi, TimerLo: DWORD;  PriorityClass, Priority: Integer; begin PriorityClass := GetPriorityClass(GetCurrentProcess); Priority := GetThreadPriority(GetCurrentThread); SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS); SetThreadPriority(GetCurrentThread, THREAD_PRIORITY_TIME_CRITICAL); Sleep(10);共2页。 1 2 8 : 下载本文示例代码


Delphi三十六之硬件篇Delphi三十六之硬件篇Delphi三十六之硬件篇Delphi三十六之硬件篇Delphi三十六之硬件篇Delphi三十六之硬件篇Delphi三十六之硬件篇Delphi三十六之硬件篇Delphi三十六之硬件篇Delphi三十六之硬件篇Delphi三十六之硬件篇Delphi三十六之硬件篇Delphi三十六之硬件篇Delphi三十六之硬件篇Delphi三十六之硬件篇
阅读(226) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~