what's an "Illegal Instruction"?? 
Author Message
 what's an "Illegal Instruction"??

what's an "Illegal Instruction"??


Mon, 14 Nov 2005 09:01:53 GMT  
 what's an "Illegal Instruction"??

Quote:

> What's an "Illegal Instruction"?

A machine instruction that your computer does not recognize
or that is reserved for privileged users (the operating system).

You are attempting to run your program on a host computer
other than the one for which your program was compiled.
Or you have a function pointer to a location in memory
that is actually data.

Try recompiling your program on the computer where you want to run it
and this problem may disappear.



Mon, 14 Nov 2005 09:44:03 GMT  
 what's an "Illegal Instruction"??

Quote:

> what's an "Illegal Instruction"??

It depends on the context in which it is used.

Since this is a programming related newsgroup, I assume you encountered it
in some kind of programming context.

Since illegal instructions in source code are normally called "syntax
errors" by the compiler, I assume you saw it when you were running the
program.

When a program is running, you normally encounter a message about an
"illegal instruction" when the program attempts to execute something that
is impossible for the cpu to do, such as divide by a number by zero.



Mon, 14 Nov 2005 13:42:19 GMT  
 what's an "Illegal Instruction"??

Quote:


> > what's an "Illegal Instruction"??

> It depends on the context in which it is used.

[...]

   "Illegal instruction" is machine instruction that is not recognized
by CPU decoder (either opcode or operands combination are wrong).

/BP



Mon, 14 Nov 2005 17:32:38 GMT  
 what's an "Illegal Instruction"??

Quote:
> what's an "Illegal Instruction"??

An op-code that is not recognized by the processor. IOW, the sign that you
code is seriously ill. (I suspect the use of an uninitialized pointer to
function).

--
-ed- emdel at noos.fr
The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
C-library: http://www.dinkumware.com/htm_cl/index.html
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/

"Clearly your code does not meet the original spec."
"You are sentenced to 30 lashes with a wet noodle."
                          -- Jerry Coffin in a.l.c.c++



Mon, 14 Nov 2005 19:20:53 GMT  
 what's an "Illegal Instruction"??

Quote:

> > what's an "Illegal Instruction"??

An invalid instruction.  Another example of horribly misused words in the
computer field.  It grates on my nerves every time I hear it.


Mon, 14 Nov 2005 23:30:17 GMT  
 what's an "Illegal Instruction"??

Quote:


>> > what's an "Illegal Instruction"??

> An invalid instruction.  Another example of horribly misused words in the
> computer field.  It grates on my nerves every time I hear it.

I agree.  If I order someone to sell me crack, that also is an illegal
instruction.


Mon, 14 Nov 2005 22:39:44 GMT  
 what's an "Illegal Instruction"??

Quote:



> >> > what's an "Illegal Instruction"??

> > An invalid instruction.  Another example of horribly misused words in the
> > computer field.  It grates on my nerves every time I hear it.

> I agree.  If I order someone to sell me crack, that also is an illegal
> instruction.

No, not in the U.S. it's not.  At least not as far as I know.  The only
illegal instructions over here are things like "Kill the president" and
so on.  Actually *selling* crack, OTOH, is still illegal.

:)

-Arthur



Tue, 15 Nov 2005 01:00:29 GMT  
 what's an "Illegal Instruction"??

Quote:

> what's an "Illegal Instruction"??

If you've got "illegal instruction" as an error message when the program is
run, then it means that the program has attempted to do something that it is
not allowed to do.
Almost always in a C context this will be an illegal memory read/write,
often to the NULL pointer but possibly also to some other invalid value - an
array out of bounds error or attempting to use memory that has be free()ed.
The name "illegal instruction" implies that the CPU has been told to execute
a machine code instruction that isn't in its instruction set. This could be
your problem (you might have corrupted the code portion of your program
somehow, or used a bad function pointer). However unless your platform
documentation specifically says that "illegal instruction" is given for this
error (and "segmentation fault" or something similar for bad memory access)
then this isn't terribly likely to be your problem.


Tue, 15 Nov 2005 03:20:24 GMT  
 what's an "Illegal Instruction"??


Quote:

>> > what's an "Illegal Instruction"??

>An invalid instruction.  Another example of horribly misused words in the
>computer field.  It grates on my nerves every time I hear it.

These are, to my mind, two different classes. There are invalid
op-codes that have no meaning. There are instructions that are
forbidden by hardware modes. One could call attempting a privileged
instruction from non-privileged context "illegal."

(Of course, the one true example of "Illegal Instruction" is beginning
a textbook example "void main ()...")



Tue, 15 Nov 2005 11:08:16 GMT  
 what's an "Illegal Instruction"??

Quote:



>>> > what's an "Illegal Instruction"??

>>An invalid instruction.  Another example of horribly misused words in the
>>computer field.  It grates on my nerves every time I hear it.

>These are, to my mind, two different classes. There are invalid
>op-codes that have no meaning. There are instructions that are
>forbidden by hardware modes. One could call attempting a privileged
>instruction from non-privileged context "illegal."

It's more than "one *could* call", it's current terminology.

Dan
--
Dan Pop
DESY Zeuthen, RZ group



Tue, 15 Nov 2005 22:47:23 GMT  
 what's an "Illegal Instruction"??

Quote:



> >> > what's an "Illegal Instruction"??

> >An invalid instruction.  Another example of horribly misused words in the
> >computer field.  It grates on my nerves every time I hear it.

> These are, to my mind, two different classes. There are invalid
> op-codes that have no meaning. There are instructions that are
> forbidden by hardware modes.

   There is also a third class (or mixture of the two, if you wish) -
instructions that are not recognized (undefined) in certain CPU modes
(e.g. ARPL in real mode on x86).

Quote:
> One could call attempting a privileged
> instruction from non-privileged context "illegal."

   Yes, but everybody else would call that "protection violation" or
"access violation" :-)

/BP



Thu, 17 Nov 2005 17:07:32 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. Displaying binary data as ascii "1"'s and "0"'s

2. Displaying binary data as ascii "1"'s and "0"'s

3. '.', '::", "->"

4. IDispatch::Invoke causes "Privileged Instruction" exception

5. "illegal pointer combination" problem

6. "illegal qualified name in member declaration"??

7. "Illegal operation" ERROR under VC++ development

8. "Illegal Pointer Arithmetic" error

9. "Illegal operation" during CPropertySheet::OnInitDialog()

10. Warning C4927 - "Illegal conversion"

11. Equivalent in C of the assembly instruction "rol" (and "ror")

12. Instruction at "0x00000000" referenced memory at "0x00000000" error

 

 
Powered by phpBB® Forum Software