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

Harald Houppermans houppermans at home.nl
Thu Mar 18 03:49:33 CET 2004


> procedure Subst;
> begin
>   writeln('Here we are!');
>   repeat until false;
> end;

Lol now I understand why you placed repeat until false; lol

Without it it crashes :D hmmm

Probably no way to recover from it... hmmm

Or is there ?

Hmm maybe there is :)

Storing the CS and IP and then later going back...

But euhm that would be cheating...

Since it has to call/end the interrupt...

Hmm no it's not cheating.

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; :)

That proofs it works :D

And recovering from it should work as well :D

CS := OLDCS;
IP := OLDIP

No lol that's not possible

var
    OLDCS : word;
    OLDIP : word;

> procedure Subst;
> begin
>   writeln('Here we are!');

    CS := OLDCS;  // this ofcourse cant work since parameter is not
available here. unless maybe it is pushed or so i dont know.
     IP := OLDIP;

    mov CS,OLDCS // cant work

    mov CS,ax // cant work invalid combination

> end;

Shit :)

I still wonder if there is a way to make it recover...

Euhmmmm this is very funny.

Those interrupt parameters actually allow something which otherwise isn't
allowed ?!

Hmm. :)

>
> procedure TimerHandler(Flags, CS, IP, AX, BX, CX, DX, SI, DI, DS, ES, BP:
> Word); interrupt;
> begin
>   inc(count);
>   asm
>     pushf;
>   end;
>   Int8Save;
>   { Uncomment the following 2 lines and see what happens. }

    OLDCS := CS;
    OLDIP := IP;

> {
>   CS := Seg(Subst);
>   IP := Ofs(Subst);
> }
> end;
>
> begin
>   GetIntVec(8, @Int8Save);
>   SetIntVec(8, Addr(TimerHandler));
>   writeln('Press ANYKEY to exit');
>   repeat
>     write(count, '     '#13);
>   until Keypressed;
>   SetIntVec(8, @Int8Save);
> end.
>
> Skybuck.
>
>
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal





More information about the fpc-pascal mailing list