Protectmode handler called from realmode (Developers)
> 1) the original SP is necessary to shift by 6 (as cm suggested) not by 4
> (as microsoft suggested)
It depends on how your FAR routine is supposed to exit: a RETF requires 4 bytes, an IRET requires 6 bytes. 
> {I know, it does nothing but in first step would be enough not to crash}
> asm
> cld
> lodsd;mov es:[edi+2Ah],eax                 {restores CS:IP}
> lodsd;mov es:[edi+20h],ax                  {flags}
> add word ptr es:[edi+2Eh],6                {sets SP}
> iret
> end;
The second "lodsd" should be a "lodsw". There's a small risk that lodsd might cause a crash.
There is another risk that Int 13h might be called recursively. IIRC, Jack R. Ellis told me that USBDRIVE.SYS is supposed to do this occasionally.
---
MS-DOS forever!
Complete thread:
- Protectmode handler called from realmode - Laaca, 12.08.2010, 21:12 ![Open in board view [Board]](img/board_d.gif) ![Open in mix view [Mix]](img/mix_d.gif) - Protectmode handler called from realmode - ecm, 12.08.2010, 21:24- Protectmode handler called from realmode - Laaca, 13.08.2010, 01:46- Protectmode handler called from realmode - Japheth, 13.08.2010, 07:31- Protectmode handler called from realmode - bretjohn, 13.08.2010, 18:43- EDIT: Protectmode handler called from realmode - bretjohn, 13.08.2010, 19:25- Volumes vs physical storage media | WAS "Protectmod handl" - DOS386, 26.08.2010, 09:33- Volumes vs physical storage media | WAS "Protectmod handl" - bretjohn, 26.08.2010, 19:03- Volumes vs physical storage media | WAS "Protectmod handl" - DOS386, 27.08.2010, 03:25- Volumes vs physical storage media | WAS "Protectmod handl" - bretjohn, 27.08.2010, 16:47- Volumes vs physical storage media | WAS "Protectmod handl" - DOS386, 28.08.2010, 01:26- Volumes vs physical storage media | WAS "Protectmod handl" - bretjohn, 28.08.2010, 16:35- Volumes vs physical storage media | WAS "Protectmod handl" - DOS386, 06.09.2010, 20:10
 
 
- Volumes vs physical storage media | WAS "Protectmod handl" - bretjohn, 28.08.2010, 16:35
 
- Volumes vs physical storage media | WAS "Protectmod handl" - DOS386, 28.08.2010, 01:26
 
- Volumes vs physical storage media | WAS "Protectmod handl" - bretjohn, 27.08.2010, 16:47
 
- Volumes vs physical storage media | WAS "Protectmod handl" - DOS386, 27.08.2010, 03:25
 
- Volumes vs physical storage media | WAS "Protectmod handl" - bretjohn, 26.08.2010, 19:03
 
- Volumes vs physical storage media | WAS "Protectmod handl" - DOS386, 26.08.2010, 09:33
 
- EDIT: Protectmode handler called from realmode - bretjohn, 13.08.2010, 19:25
 
- Protectmode handler called from realmode - bretjohn, 13.08.2010, 18:43
 
- Protectmode handler called from realmode - Japheth, 13.08.2010, 07:31
 
- Protectmode handler called from realmode - Laaca, 13.08.2010, 01:46
 
- Protectmode handler called from realmode - ecm, 12.08.2010, 21:24
 Board view
Board view Mix view
Mix view
