我期待读取位于地址302H的值.目的是从硬件(104pc堆栈的一部分)读取输入.当我运行以下代码时出现此错误:Unhandled exception at 0x004134b9 in setOutput.exe: 0xC0000005: Access violation reading location 0x00000302.
#include <stdlib.h>
#define PORTBASE 0x302
int _tmain(int argc, char *argv[])
{
int value;
int volatile * port = (int *) PORTBASE;
printf("port = %d\n", port);
value = *port;
printf("port value = %d\n", value);
}
Run Code Online (Sandbox Code Playgroud)
编辑:
我在寡妇xp下运行这个.我只能在电路板上找到的文档如下
编辑:
从下面的答案中,我可以看到我需要为电路板编写驱动程序.有人能指出我如何这样做的资源?
| 归档时间: |
|
| 查看次数: |
772 次 |
| 最近记录: |