Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Misc > Handling except...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 6035 of 6154
Post > Topic >>

Handling exception 218 Privileged Instruction

by "Paul E. Schoen" <pstech@[EMAIL PROTECTED] > Apr 6, 2008 at 11:01 PM

I am using D4 to make a little utility application that reads from and 
writes to a parallel ****t address base 0x378 or 0x3bc. I am using ****ttalk

in a batch file so this will work under NT (Win XP):

copy USB2LPT.exe c:\****ttalk22\
cd c:\****ttalk22
C:\****ttalk22\AllowIO USB2LPT.exe 0x378 0x379 0x37a 0x3bc ox3bd 0x3be

This works well, but I cannot debug my code, and the exception causes an 
immediate termination. I tried to trap the error, but it still hangs up.

The routines that cause the exception are:

FUNCTION ****tIn(IO****t: WORD): BYTE; ASSEMBLER; REGISTER;
asm
  MOV DX,AX
  IN AL,DX
end;

PROCEDURE ****tOut(IO****t: WORD; Value: BYTE); ASSEMBLER; REGISTER;
ASM
  XCHG DX,AX
  OUT DX,AL
END;

Is there a way to ignore this attempted I/O, or somehow predict that it 
will cause an exception by determining the processor's permission map? I 
might be able to do it by running the entire Delphi IDE from the AllowIO 
command line, but I'd rather not.

If I set the debug options to Run Unhandled by User Program or Debugger, I

will get the debugger error message, and I can continue. If I set it to
Run 
Handled by User Program or Debugger, it hangs up, and I must use Program 
Reset.

Thanks,

Paul
 




 8 Posts in Topic:
Handling exception 218 Privileged Instruction
"Paul E. Schoen"  2008-04-06 23:01:17 
Re: Handling exception 218 Privileged Instruction
Andreas Koch <nospam@[  2008-04-07 19:37:56 
Re: Handling exception 218 Privileged Instruction
"Paul E. Schoen"  2008-04-07 14:14:46 
Re: Handling exception 218 Privileged Instruction
Rob Kennedy <me3@[EMAI  2008-04-07 18:40:09 
Re: Handling exception 218 Privileged Instruction
"Paul E. Schoen"  2008-04-08 03:44:40 
Re: Handling exception 218 Privileged Instruction
"Maarten Wiltink&quo  2008-04-08 10:32:41 
Re: Handling exception 218 Privileged Instruction
"Paul E. Schoen"  2008-04-08 18:16:11 
Re: Handling exception 218 Privileged Instruction
Jamie <jamie_ka1lpa_no  2008-04-08 18:33:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 20:10:24 CDT 2008.