注册 登录
编程论坛 C++教室

请教高手注解程序

xiaodengzi1981 发布于 2008-01-21 21:37, 778 次点击
typedef unsigned short ushort;
typedef unsigned char uchar;

ushort inport( ushort portid )
 {
  _DX = portid;
  __emit__( 0x66, 0xED );
  return _AX;
 }

void outport( ushort portid, ushort data )
 {
  _DX = portid;
  _AX = data;
  __emit__( 0x66, 0xEF );
 }

uchar inportb( ushort portid )
 {
  _DX = portid;
  __emit__( 0xEC );
  return _AL;
 }

void outportb( ushort portid, uchar data )
 {
  _DX = portid;
  _AL = data;
  __emit__( 0xEE ); }

void cli( void )
{
 __emit__( 0xFA );
}

void sti( void )
{
 __emit__( 0xFB );
}

#else
#error NOT FLAT memory model
#endif
请教高手,为何在运行时错误总指向上述红色代码。急...!在线等...
2 回复
#2
xiaodengzi19812008-01-21 21:43
错误提示为:
thread stopped C:\Docments and Settings\Administrator\桌面\BBD.NEW\AC_MDI.exe:Fault:privileged instruction at 0x4019ba
#3
天使梦魔2008-01-22 09:40
把AL寄存器中的值送到端口?
大哥你贴这点东西谁看的懂?

自己去检查有没有冲突
1