Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > Delphi > 变速齿轮Delphi实现
【标  题】:变速齿轮Delphi实现
【关键字】:变速齿轮,Delphi
【来  源】:http://blog.csdn.net/jazzyfree

变速齿轮Delphi实现

Your Ad Here {D7+Win98,不能用于2000}
unit MainUnit;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}
procedure speed(count:word);stdcall;
const
ExceptionUsed=$03;
var
IDT:array [0..5]of byte;
lpOldGate:dword;
begin
asm
sidt IDT
mov ebx,dword ptr [IDT+2]
add ebx,8*ExceptionUsed
cli
mov dx,word ptr [ebx+6]
shl edx,16d
mov dx,word ptr [ebx]
mov [lpOldGate],edx
mov eax,offset @@Ring0Code
mov word ptr [ebx],ax
shr eax,16d
mov word ptr [ebx+6],ax
int ExceptionUsed
mov ebx,dword ptr[IDT+2]
add ebx,8*ExceptionUsed
mov edx,[lpOldGate]
mov word ptr [ebx],dx
shr edx,16d
mov word ptr [ebx+6],dx
jmp @@exit


@@Ring0Code:
mov al,$34
out $43,al
mov ax,Count
out $40,al
mov al,ah
out $40,al
iretd
@@exit:
end;

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
speed($6000);//慢
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Speed($1044);
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
speed($500);
end;

end.

变速齿轮 核心实现:【上一篇】
“变速齿轮”再研究:【下一篇】
【相关文章】
没有相关文章
【随机文章】
  • Apache2+php DSO源码安装+GD
  • Flash中oop的设计模式(2)
  • 介绍一个判断plug-ins/ActiveX 是否存在的例子
  • 精用Boolean表达式,让代码再减肥
  • TinyDB v2.93 Full Sources (小型数据库引擎)
  • 有人在用 SharePoint 吗?
  • 利用JNI调用C/C++方法实现从控制台输入密码
  • 走近Linux世界:Linux与Windows特性比较
  • How to Play CounterStrike 1.6 in Linux
  • 《仙境传说RO》当刺客把猎人干掉后
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.