Why do my programs keep coming up as NTVDM CPU illegal instruction?

In summary, The person is using Windows XP Version 2002 and freecommandLinetools as a compiler for c++ language. However, every time they write a program, it gives an NTVDM CPU illegal instruction error. They are wondering if there is something wrong with their program or if they need a new compiler. It is likely a compiler problem due to XP systems no longer being supported. A potential fix is suggested, but it is uncertain if it will work.
  • #1
nst.john
163
1
I am using Windows XP Version 2002 and I am using freecommandLinetools as a compiler for the c++ language. Every time I write a program it always says it is an NTVDM CPU illegal instruction and it doesn't work, what's wrong with my programs? Here is an example:
C:
#include <iostream>

using namespace std;

int main()
{
  cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";
  cin.get();

  return 1;
}
Is something wrong with my program? Or do I need a new compiler for my computer, or what ever? What's the problem? Thanks in advance!
 
Last edited by a moderator:
Technology news on Phys.org
  • #2
XP systems stopped being supported in the summer of 2010. Getting a new compiler will be difficult, but it does appear to me to be a compiler problem - it requests a hardware opcode your system does not support. As a last ditch effort try this as a fix - it is a guess on my part.:

 

1. Why is my program showing an NTVDM CPU illegal instruction error?

This error typically occurs when a 16-bit program is trying to run on a 64-bit Windows operating system. The NTVDM (NT Virtual DOS Machine) is a component of Windows that allows 16-bit programs to run on 32-bit systems. However, 64-bit systems do not support this and thus the error is displayed.

2. How can I fix the NTVDM CPU illegal instruction error?

One way to fix this error is to run the program in compatibility mode. Right-click on the program's executable file, go to Properties, and then click on the Compatibility tab. From there, you can select an earlier version of Windows to run the program in.

3. Can outdated drivers cause the NTVDM CPU illegal instruction error?

Yes, outdated or corrupted drivers can also cause this error. It is important to regularly update your drivers to ensure compatibility with your operating system and programs.

4. Is there a possibility of malware causing this error?

Yes, malware can also cause this error by corrupting system files or interfering with the NTVDM process. It is recommended to run a thorough virus scan to check for any malicious programs.

5. Can a faulty RAM stick be the reason for the NTVDM CPU illegal instruction error?

In some cases, a faulty RAM stick can also cause this error. It is important to run a memory diagnostic test to check for any issues with your computer's memory. If a faulty RAM stick is detected, it will need to be replaced.

Similar threads

  • Programming and Computer Science
Replies
12
Views
1K
  • Programming and Computer Science
Replies
11
Views
1K
  • Programming and Computer Science
3
Replies
73
Views
4K
  • Programming and Computer Science
Replies
2
Views
869
  • Programming and Computer Science
Replies
32
Views
2K
  • Programming and Computer Science
2
Replies
40
Views
2K
  • Programming and Computer Science
Replies
5
Views
1K
  • Programming and Computer Science
Replies
30
Views
2K
  • Programming and Computer Science
2
Replies
39
Views
3K
Replies
6
Views
1K
Back
Top