Thread View: net.lang.pascal
2 messages
2 total messages
Started by vr0z05
Wed, 03 Apr 1985 21:28
Error in Turbo-Pascal?
Author: vr0z05
Date: Wed, 03 Apr 1985 21:28
Date: Wed, 03 Apr 1985 21:28
41 lines
1560 bytes
1560 bytes
Hello folks,
is there anybody in net-land who is able to help me?
the following program will not work, but why not?
(TURBO-PASCAL V.2.0 on IBM-PC/XT)
>PROGRAM TEST;
>type REGPACK = record
> AX,BX,CX,DX,BP,SI,DI,DS,ES,FLAGS : integer;
> end;
>var RECPACK : REGPACK;
>procedure INTR_TEST;
>begin
> inline($FB/$CF) {STI/IRET}
>end;
>begin
> RECPACK.AX := ($25 shl 8) + $50;
> RECPACK.DS := cseg;
> RECPACK.DX := ofs(INTR_TEST);
> intr($21,RECPACK);
> intr($50,RECPACK);
>end.
The program starts correct, changes the interrupt-vector $50 to the address
of INTR_TEST, then calls via INT the procedure INTR_TEST and executes it
(until now nothing wrong), but after that the program hangs (no BREAK,
no RESET will work, only POWER OFF/ON).
Helpfull hints to
Uwe Hoch
University of Dortmund
Computer Science Department(IRB)
P.O. Box 500500
D-4600 Dortmund 50
West-Germany
via mail or uucp.
Thanks in advance!
Re: Error in Turbo-Pascal?
Author: Holtman Jim
Date: Fri, 05 Apr 1985 16:54
Date: Fri, 05 Apr 1985 16:54
68 lines
2124 bytes
2124 bytes
>
> Hello folks,
>
> is there anybody in net-land who is able to help me?
> the following program will not work, but why not?
> (TURBO-PASCAL V.2.0 on IBM-PC/XT)
>
> >PROGRAM TEST;
> >type REGPACK = record
> > AX,BX,CX,DX,BP,SI,DI,DS,ES,FLAGS : integer;
> > end;
> >var RECPACK : REGPACK;
> >procedure INTR_TEST;
> >begin
> > inline($FB/$CF) {STI/IRET}
> >end;
> >begin
> > RECPACK.AX := ($25 shl 8) + $50;
> > RECPACK.DS := cseg;
> > RECPACK.DX := ofs(INTR_TEST);
> > intr($21,RECPACK);
> > intr($50,RECPACK);
> >end.
>
> The program starts correct, changes the interrupt-vector $50 to the address
> of INTR_TEST, then calls via INT the procedure INTR_TEST and executes it
> (until now nothing wrong), but after that the program hangs (no BREAK,
> no RESET will work, only POWER OFF/ON).
>
> Helpfull hints to
>
> Uwe Hoch
> University of Dortmund
> Computer Science Department(IRB)
> P.O. Box 500500
> D-4600 Dortmund 50
> West-Germany
>
> via mail or uucp.
>
> Thanks in advance!
The problem is not in TURBO, it is in you INLINE statement. If you
take a look at the code that is generated at INTR_TEST, you will
see the following:
PUSH BP
MOV BP,SP
PUSH BP
JMP L1
L1: STI ; STATMENTS FROM inline
IRET
What you have to do is to modify your INLINE to include the POPs
of 2 BPs; e.g.
inline($FB/$5D/$5D/$CF)
which will generate the following:
PUSH BP
MOV BP,SP
PUSH BP
JMP L1
L1: STI ; STATMENTS FROM inline
POP BP
POP BP
IRET
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads