Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Need help with DPMI function 301h (Developers)

posted by Japheth(R) Homepage, Germany (South), 18.08.2019, 09:56
(edited by Japheth on 18.08.2019, 10:23)

> I can not just call the realmode BIOS entrypoint from protected mode so I
> have to use the emulation via DPMI function 301h.

Yes

> FillChar(r,sizeof(TRealRegs),0);
> r.cs:=seg_entry;
> r.ip:=offs_entry;

So far it's ok, real-mode CS:IP and SS:SP are set.

> push $b800
> push 0
> push $b800
> push 2
>
> push 0

In 32-bit protected-mode, when you're pushing a constant value, a 32-bit value is pushed! So the code above pushes 5 DWORDS, not 5 WORDS ( as was your intention, probably ).

Simplest workround: replace "push CONST" by "mov ax,CONST" & "push ax".

---
MS-DOS forever!

 

Complete thread:

Back to the forum
Board view  Mix view
16017 Postings in 1483 Threads, 271 registered users, 7 users online (0 registered, 7 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum