Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site princeton.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!wei From: wei@princeton.UUCP (P Wei) Newsgroups: net.micro.pc,net.lang.pascal Subject: what might go wrong in these code (TURBO PASCAL)??? Message-ID: <1170@princeton.UUCP> Date: Thu, 21-Nov-85 13:34:31 EST Article-I.D.: princeto.1170 Posted: Thu Nov 21 13:34:31 1985 Date-Received: Sat, 23-Nov-85 01:32:54 EST Distribution: net Organization: Princeton University EECS Dept Lines: 29 Xref: watmath net.micro.pc:5948 net.lang.pascal:384 program test; var a,b : integer; procedure call_int7e(a : integer; var b : integer); begin inline($b8/$01/$cd/$7e); end; {mov ax,01 int 7eh} begin a := 0; b := 0; call_int7e(a,b); . . . When I call call_int in the main program, I suppose that the TURBO first pushes the value of a onto the stack, and then pushes the pointer of b onto the stack, finally pushes the return address on top of the stack. When the program reaches the inline code in call_int7e, it will transfer control to the interrupt routine 7eh with a parameter in ax register. When the interrupt routine 7eh is reached, the stack will look like : sp----> IP (low address) CS flags return address offset b segment b value of a (high address) and SS is the one set by TURBO. Can anyone tell me if there is anything wrong ? HP Wei (wei@princeton)