P Mode Help.

I cant seem to get much help from the news groups. How about a message boardI've been beating around pmode for about three months and decided to go for

it. I used the pmtut002 as a guide. All I want this sample code to do is switch ,print an 'A' and hang. The code reboot's my machine (as do most samples I've found on the net.)Here's what i got:


.model LARGE

.386p

IDEAL


STRUC SEG_DESC

LEN0_15 DW ?

BASE0_15 DW ?

BASE16_23 DB ?

FLAGS DB ?

ACCESS DB ?

BASE24_31 DB ?

ENDS SEG_DESC


SEGMENT DATA

GDT_REG DW GDT_SIZE, 0, 0

DUMMYDESC SEG_DESC < 0FFFFh, 0, 0, 9Ah, 0CFH, 0 >

CODE32 SEG_DESC < 0FFFFh, 0, 0, 92h, 0CFh, 0 >

GDT_SIZE = $- ( OFFSET DUMMYDESC )

ENDS DATA




SEGMENT CODE

ASSUME CS:CODE, DS:DATA

STARTUPCODE

MOV AX, @DATA

MOV DS, AX


XOR EAX, EAX

MOV AX, CODE32SEG

SHL EAX, 4

MOV [DS:CODE32.BASE0_15], AX

SHR EAX, 8

MOV [DS:CODE32.BASE16_23], AH


XOR EAX, EAX

MOV AX, CODE32SEG

SHL EAX, 4

ADD EAX, OFFSET DUMMYDESC

MOV [DWORD DS:GDT_REG + 2], EAX


LGDT [FWORD DS:GDT_REG]

MOV EAX, CR0

OR AL, 1

MOV CR0, EAX

DB 0EAh

DW OFFSET PMODESTART, 08h


ENDS CODE


SEGMENT CODE32SEG

PMODESTART:

MOV AX, 0B800h

MOV ES, AX

NEXTA:

MOV [BYTE ES:0000], 'A'

JMP NEXTA


ENDS CODE32SEG


END


Comments

  • I for one would appreciate a good PM tutorial. It

    seems while there are a lot of good assembler

    tutorials, there aren't many good PM tutorials.

    The few I've looked at aren't much help, as their

    source code will only work with MASM, not NASM,

    which I use religiously. So if there's anyone

    out there that can give me some source code or

    point me in the right direction, I would be grateful.




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories