What is the true difference between a real mode program and a protected mode program?

KawaiKx picture KawaiKx · Oct 27, 2013 · Viewed 21k times · Source

I know the difference between a real mode and protected mode from the OS and hardware perspective.

But I am trying to figure out What does a program 'knows' about real mode or protected mode? how can you say while looking at an source code/object code that it is a real mode program or not?

Looking for an answer, All I could come up with is that a 'real mode' program uses BIOS subroutines along with OS subroutines whereas a 'protected mode' program uses only OS subroutines. instruction code differs since opcodes for registers are different and offset addresses are of different length. Is there any other feature that differentiates a real and protected mode program?

Answer

KawaiKx picture KawaiKx · Oct 28, 2013

a 'real mode' program uses BIOS subroutines along with OS subroutines whereas a 'protected mode' program uses only OS subroutines.

instruction code differs since opcodes for registers are different and offset addresses are of different length.