Date: Wed, 14 Apr 1999 21:35:59 -0500 From: "Miguel A. Ordorica V." Subject: Is it possible...? To: djgpp AT delorie DOT com Message-id: <000b01be86e8$b48062c0$d193e994@df1.telmex.net.mx> MIME-version: 1.0 X-Mailer: Microsoft Outlook Express 5.00.2014.211 Content-type: MULTIPART/ALTERNATIVE; BOUNDARY="Boundary_(ID_jFBjfUtG3VL98j5dlmrZdw)" X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 X-Priority: 3 Reply-To: djgpp AT delorie DOT com This is a multi-part message in MIME format. --Boundary_(ID_jFBjfUtG3VL98j5dlmrZdw) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable Hello! I'm working on a program that needs to copy a large block of = data (approximately 1MB) to a different memory location every time a = specific time period has passed, and record the elapsed program time. To = that effect, I have tried reprogramming the timer interrupt and doing = the copy inside the interrupt handler, but I've had some problems = because the copy takes too much time and so my handler misses the next = event, screwing up my timekeeping and other parts of the program. =20 After reading a bit, I found an interesting technique: you pop = the contents of the stack until you reach the return address used by the = iret instruction, and insert the return address of the copy function, = then push back all the values you had just popped. This way, the iret = would make the program jump back to the copy function, which would in = turn ret back to the part of the program that was executing before the = interrupt ocurred (provided you save and restore the appropiate = registers). Now, my question is: would it be possible to do something like = that in djgpp? If it can be done, exactly how would that be? Thanks. Miguel Angel Ordorica V. sleeptk AT geocities DOT com , = ordorica AT df1 DOT telmex DOT net DOT mx --Boundary_(ID_jFBjfUtG3VL98j5dlmrZdw) Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: quoted-printable
        = Hello!
 
        I'm working on = a program=20 that needs to copy a large block of data (approximately 1MB) to a=20 different memory location every time a specific time period has = passed, and=20 record the elapsed program time. To that effect, I have tried = reprogramming the=20 timer interrupt and doing the copy inside the interrupt = handler, but=20 I've had some problems because the copy takes too much time and so my = handler=20 misses the next event, screwing up my timekeeping and other parts of the = program.
 
        After = reading a=20 bit, I found an interesting technique: you pop the contents of the stack = until=20 you reach the return address used by the iret instruction, and insert = the return=20 address of the copy function, then push back all the values you had just = popped.=20 This way, the iret would make the program jump back to the copy = function, which=20 would in turn ret back to the part of the program that was = executing before=20 the interrupt ocurred (provided you save and restore the appropiate=20 registers).
        Now, my = question is:=20 would it be possible to do something like that in djgpp? If it can be = done,=20 exactly how would that be?
 
 
          &nbs= p;            = ;=20 Thanks.
          &nbs= p;            = ;=20 Miguel Angel Ordorica V. sleeptk AT geocities DOT com , = ordorica AT df1 DOT telmex DOT net DOT mx=
--Boundary_(ID_jFBjfUtG3VL98j5dlmrZdw)--