🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #5208

Re: iret and retf

#5208
From: Doug Dougherty
Date: Thu, 14 Mar 1991 18:54
16 lines
1443 bytes
rkl@cbnewsh.att.com (kevin.laux) writes:

>	RETF is used when interrupt handlers want to return one of the Flags
>bits.  The INT instruction pushes the Flags onto the current stack, then CS,
>then IP.  When the interrupt handler uses the flags bits to return success,
>failure or whatever, it cannot use an IRET as this will end up popping the
>old flags off the stack destroying the bits that were purposely set up.
>The RETF 0002h instruction will pop CS:IP off the stack and then will discard
>two bytes.

I think you are wrong.  (Purely conjecture, since I haven't debugged the
code, of course).  I think routines that return information in the
flags (such as, e.g., almost all of the INT 21 routines) do it by
manipulating the word on the stack itself (at, I believe, [SP+4]), so
that the final IRET returns a diferent flags value than the one
originally pushed by the INT instruction.
Technical Details
Message-ID: <valley.668976840@gsbsun>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!midway!valley
References: <1991Mar14.031024.12576@msuinfo.cl.msu.edu> <1991Mar14.143454.18993@cbnewsh.att.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!midway!valley
From: valley@uchicago (Doug Dougherty)
Newsgroups: comp.os.msdos.programmer
Subject: Re: iret and retf
Message-ID: <valley.668976840@gsbsun>
Date: 14 Mar 91 18:54:00 GMT
References: <1991Mar14.031024.12576@msuinfo.cl.msu.edu> <1991Mar14.143454.18993@cbnewsh.att.com>
Sender: news@midway.uchicago.edu (News Administrator)
Distribution: na
Organization: University of Chicago
Lines: 16