delorie.com/djgpp/faq/converting/asmfault.html   search  
OK, I've succeeded to convert and compile my assembly-language program, but when I run it, I get Segmentation Violation and General Protection Faults. This program works when compiled with MASM, so how can it be?

In djgpp, your program runs in protected mode. There are certain things you can't do in protected-mode programs (that's why it is called protected mode). This issue is too complex to describe here, so only a few of the more important aspects will be briefly mentioned. If you are serious about writing assembly language protected-mode code, or have a large body of existing code to convert to protected mode, you should read any of the books about protected-mode programming with 80x86 processors.

Here is a short list of some of the techniques found in many real-mode programs, which will trigger protection violation or erratic behavior in protected mode:


  webmaster     delorie software   privacy  
  Copyright © 1995     Updated Feb 1995