[fpc-pascal]wow quite cool example you made there :)

Nikolay Nikolov nickysn at SexMagnet.com
Thu Mar 18 12:04:40 CET 2004


Harald Houppermans wrote:

>WOW very interesting indeed
>
>I thought you did it like this:
>
>asm
>  mov CS, blabla
>  mov IP, blabla
>end
>
>But now I see !!!
>
>You are actually using the parameters:
>
>CS := blabla; :)
>IP := blabla; :)
>  
>
>Those interrupt parameters actually allow something which otherwise isn't
>allowed ?!
>
The CS and IP parameters access the return address stored on the stack. 
(so after the iretd it will continue executing from there) In 16-bit DOS 
you can even simulate multithreading using this. Just hook int8 and 
store the CS/IP and all the other registers for the current thread and 
load CS/IP/registers of the next thread to be executed. Alas I didn't 
find a way to do that in 32-bit DPMI. :)





More information about the fpc-pascal mailing list