NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: T145 on November 21, 2019, 03:50:49 AM

Title: How is Protected Mode enabled in 16 Bit NASM?
Post by: T145 on November 21, 2019, 03:50:49 AM
I've scoured the web trying to find any mention of enabling protected mode, to no avail. If anyone here happens to know I'd love to learn how!
Title: Re: How is Protected Mode enabled in 16 Bit NASM?
Post by: Frank Kotler on November 21, 2019, 06:34:55 AM
Hi T145,

Welcome o the forum!

The net used to be full of this information. Can't find much now...

This is not a useful answer:
Code: [Select]
mov eax, cr0
or al, 1
mov cr0, eax
... now you're in protected mode. However... first you need to load a global descriptor table. This is an array of selectors. The format if these selectors must be for the convenience if the hardware - it sure isn't for the convenience if programmers!

I used to have examples up until about two years ago when my computer crashed with no recent backup. Older backup is on CD... and the new machine has no CD player. So I can't help you much.

I'll look more...

Best,
Frank

Title: Re: How is Protected Mode enabled in 16 Bit NASM?
Post by: T145 on November 28, 2019, 03:19:02 AM
I assume that also utilizes %use altreg?
Title: Re: How is Protected Mode enabled in 16 Bit NASM?
Post by: Frank Kotler on November 28, 2019, 06:09:40 AM
I don't think so, no.

Thanks for reminding me I'm supposed to be looking for an example.

Best,
Frank


not what I was looking for but try this:

http://www.osdever.net/tutorials/view/the-world-of-protected-mode