用VC写的汇编程序在WIN98下能用可在WIN2000下却不能用,大家帮忙看看是怎么回事!

cfqmxh 2005-10-10 05:00:49
别人提供给我用VC写的读取IC卡读卡器的DLL(有原代码),其中有几段汇编程序,在WIN2000下调试到该汇编代码时报地址错,可在WIN98下没错!我对汇编一无所知,这几段代码具体什么功能我也不知道,特将该代码贴出以求救!

void _outp(int output,unsigned char al_data)
{
__asm
{
push dx;
push ax;
mov dx,word ptr output;
mov al,byte ptr al_data;
out dx,al;
pop ax;
pop dx;
}
return;
}

unsigned char _inp(int input)
{
unsigned char inp;
__asm
{
push dx;
push ax;
mov dx,word ptr input;
in al,dx;
mov byte ptr inp,al
pop ax;
pop dx;
}
return inp;
}

int _read_port(void)
{
int port_r;
__asm
{
push es;
push ax;
mov ax,40h;
mov es,ax;
mov ax,es:word ptr [0ah];
cmp ax,0;
jne end_asm;
mov ax,es:word ptr [08h];
end_asm:
mov word ptr port_r,ax;
pop ax;
pop es;
}
return port_r;
}
...全文
178 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
wequal 2005-10-14
  • 打赏
  • 举报
回复
下载
DirectPort.dll

很好用.
VxD1 2005-10-13
  • 打赏
  • 举报
回复
从ring3 转 ring0,具体实现方法要么写驱动,要么用像CIH病毒那样的方法
  • 打赏
  • 举报
回复
写驱动
flowercity 2005-10-11
  • 打赏
  • 举报
回复
错了

cptang@126.com
flowercity 2005-10-11
  • 打赏
  • 举报
回复
cptang@tfol.com
flowercity 2005-10-11
  • 打赏
  • 举报
回复
nt 2000 xp 底层端口不允许访问

用winio.dll

只要在主窗体的时候调用打开端口函数
你原来的汇编就可以用了
有问题和我联系
我一直在用
sunnysmile 2005-10-10
  • 打赏
  • 举报
回复
2000下不好直接操作硬件
cfqmxh 2005-10-10
  • 打赏
  • 举报
回复
那我要访问端口该怎么办呢?请指教!急呀!
大熊猫侯佩 2005-10-10
  • 打赏
  • 举报
回复
nt 平台下不得随意访问端口。
csdsjkk 2005-10-10
  • 打赏
  • 举报
回复
端口不能随意访问,要设置访问权限

21,458

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧