Board index » delphi » Pascal commands to manipulate computer's interupts

Pascal commands to manipulate computer's interupts

Is there any of the commands in Pascal allows me to manipulate computer's
interupts ?

 

Re:Pascal commands to manipulate computer's interupts


Quote
>Is there any of the commands in Pascal allows me to manipulate computer's
>interupts ?

Greetings,
              I am not sure what you mean by maniuplating interrupts. If you
wish to change your interrupt routines, you can save the old one and install
your own with these two DOS unit routines: SetIntVec and GetIntVec.

Carl Eric Codere (aka The Black One)
Pascal and asm programming
http://www-edu.gel.usherb.ca/codc01

Re:Pascal commands to manipulate computer's interupts


Quote
> Is there any of the commands in Pascal allows me to manipulate computer's
> interupts ?

   Turbo and Borland Pascals support such things.  The subject is
discussed in the manuals and after-market texts.

Re:Pascal commands to manipulate computer's interupts


On 3 Mar 1997 18:11:02 GMT, "Siew Kit" <ys...@pl.jaring.my> wrote:

Quote
>Is there any of the commands in Pascal allows me to manipulate computer's
>interupts ?

        Asm
                cli
        end;
that would manipulate them

_____________________________ __ _  _
Norsk / Hoaxers. ( kb...@sn.no & http://home.sn.no/~kblix )
- -
How do you shoot the devil in the back? What if you miss? -Verbal Kint
---------------------------- -- -  -

Re:Pascal commands to manipulate computer's interupts


Quote
>>Is there any of the commands in Pascal allows me to manipulate computer's
>>interupts ?

I think he means using the Ints. Myself I learned this on day.. three of
learning TP7 (self-teaching) :)

You could use standard ASM (look in the help!) or
use the bit from the DOS unit...

i.e. (from dos unit)
        var regs: registers;
        begin
          regs.ax := $0000;
          Intr($13);
        end;
that example is equivalent to
        asm
          mov ax, $0000
          int $13
        end;

Although the asm version is faster :)
--
    Valdus -/- Hilton Janfield -(- sysop of dark genesis bbs -\- Valdus
dark genesis bbs system * 250/561-2850 * 14400 baud * lots of games * MORE!
** Official Distribution Site for: OutWorld Arts, Outlaw Triad, SWAG,
   SerWiz Com, RTsoft, and more!

Re:Pascal commands to manipulate computer's interupts


On 5 Mar 1997 01:53:53 -0800, ae...@freenet.unbc.edu (Hilton Janfield)
wrote:

Quote
>i.e. (from dos unit)
>    var regs: registers;
>    begin
>      regs.ax := $0000;
>      Intr($13);
>    end;
>that example is equivalent to
>    asm
>      mov ax, $0000
>      int $13
>    end;
>Although the asm version is faster :)

No its not! :) It seems to be common to belive that everything that is
assembler is fast. That is not true. An "int" call is slow, no matter
what language you use.

_____________________________ __ _  _
Norsk / Hoaxers. ( kb...@sn.no & http://home.sn.no/~kblix )
- -
How do you shoot the devil in the back? What if you miss? -Verbal Kint
---------------------------- -- -  -

Re:Pascal commands to manipulate computer's interupts


Quote
Norsk / Hoaxers wrote:

> On 5 Mar 1997 01:53:53 -0800, ae...@freenet.unbc.edu (Hilton Janfield)
> wrote:

> >i.e. (from dos unit)
> >       var regs: registers;
> >       begin
> >         regs.ax := $0000;
> >         Intr($13);
> >       end;
> >that example is equivalent to
> >       asm
> >         mov ax, $0000
> >         int $13
> >       end;

> >Although the asm version is faster :)

> No its not! :) It seems to be common to belive that everything that is
> assembler is fast. That is not true. An "int" call is slow, no matter
> what language you use.

And what, pray tell, do you think the Intr() procedure does?  It's a
wrapper procedure to call an interrupt.  I'm looking at the source to
Intr() in another window, and what it appears to do is load the stack,
make and explicit call to int 0, then pop all the registers back off the
stack.  Add to that the fact that just calling Intr() adds the time of a
far call, how can it possibly be faster?

The only real argument here is that, given this case, speed isn't all
that relevant, and the time difference between the two won't make any
real difference (which is probably what you were getting at anyway  :-).

Quote
> _____________________________ __ _  _
> Norsk / Hoaxers. ( kb...@sn.no & http://home.sn.no/~kblix )
> - -
> How do you shoot the devil in the back? What if you miss? -Verbal Kint
> ---------------------------- -- -  -

--
Scott Earnest        | We now return you to our regularly |
set...@ix.netcom.com | scheduled chaos and mayhem. . . .  |

Re:Pascal commands to manipulate computer's interupts


In article: <331eed75.8133...@news.sn.no>  idontw...@your.spam.mail (Norsk /

Quote
Hoaxers) writes:

>On 5 Mar 1997 01:53:53 -0800, ae...@freenet.unbc.edu (Hilton Janfield)
>wrote:

>>i.e. (from dos unit)
>>        var regs: registers;
>>        begin
>>          regs.ax := $0000;
>>          Intr($13);
>>        end;
>>that example is equivalent to
>>        asm
>>          mov ax, $0000
>>          int $13
>>        end;

>>Although the asm version is faster :)

>No its not! :) It seems to be common to belive that everything that is
>assembler is fast. That is not true. An "int" call is slow, no matter
>what language you use.

Well that rather depends on the interrupt function you're calling. The
total cycle count for "INT xx" and "IRET" instruction is 45~ on a 486 in real
mode. My guestimate of the cycle count for the the Pascal "Intr" function is
somewhere between 150 - 250, not counting the actual call. The "MsDos" call is
even worse, and both rely on self modifying code (yep, even in DPMI and Windows)
to work, because the "xx" of an "Int xx" instruction has to be an immediate
value.

The ASM version is going to be faster therefore. Whether the difference (maybe
400~ when the longer application prolog and epilog code is added) is of course
application and interrupt function dependant.

I do aggree that most of the time the difference in speed will be negligable and
isn't worth doing for the sake of speed, but the ASM versions of Intr/MsDos
calls can also be significantly smaller than their PAS countrparts, and
portability isn't an issue when writing wrapper code for DOS/BIOS calls.

-- Jay

 --------------------------------------------------------------------------
| Jason Burgon - author of Graphic Vision, TV-Like GUI for 256 Colour SVGA |
| g...@jayman.demon.co.uk   ftp://SimTel/msdos/turbopas/gv4svga1.zip         |
| ***NEW VERSION OF GV AVAILABLE FROM*** -> http://www.jayman.demon.co.uk  |
 --------------------------------------------------------------------------

Re:Pascal commands to manipulate computer's interupts


Jason Burgon <Ja...@jayman.demon.co.uk> once said:

Quote
>The ASM version is going to be faster therefore. Whether the difference (maybe
>400~ when the longer application prolog and epilog code is added) is of course
>application and interrupt function dependant.

Anything that is time critical should avoid int/calls alltogether. That was
really no the point. The point was that "Doin' it in asm" does not optimize for
you, like a lot of people think. :]

Quote
>I do aggree that most of the time the difference in speed will be negligable and
>isn't worth doing for the sake of speed, but the ASM versions of Intr/MsDos
>calls can also be significantly smaller than their PAS countrparts.

Agreed

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Kim Robert Blix  ( kb...@sn.no  &  http://home.sn.no/~kblix )

 "How do you shoot the devil in the back?"
 "What if you miss?" -Verbal Kint
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Re:Pascal commands to manipulate computer's interupts


In article: <33229a1a.1722...@news.sn.no>  kb...@sn.no (Kim Robert Blix) writes:

Quote

>Jason Burgon <Ja...@jayman.demon.co.uk> once said:

>>The ASM version is going to be faster therefore. Whether the difference (maybe
>>400~ when the longer application prolog and epilog code is added) is of course
>>application and interrupt function dependant.

>Anything that is time critical should avoid int/calls alltogether. That was
>really no the point. The point was that "Doin' it in asm" does not optimize for
>you, like a lot of people think. :]

I agree, but some things are never fast enough, like application startup
code; where calling the DOS/BIOS is unaviodable.

Quote
>>I do aggree that most of the time the difference in speed will be negligable
>>and isn't worth doing for the sake of speed, but the ASM versions of
>>Intr/MsDos calls can also be significantly smaller than their PAS countrparts.
>Agreed

-- Jay

 --------------------------------------------------------------------------
| Jason Burgon - author of Graphic Vision, TV-Like GUI for 256 Colour SVGA |
| g...@jayman.demon.co.uk   ftp://SimTel/msdos/turbopas/gv4svga1.zip         |
| ***NEW VERSION OF GV AVAILABLE FROM*** -> http://www.jayman.demon.co.uk  |
 --------------------------------------------------------------------------

Other Threads