🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: iret and retf

#5232
From: kevin.laux
Date: Fri, 15 Mar 1991 13:35
26 lines
1812 bytes
In article <valley.668976840@gsbsun>, valley@uchicago (Doug Dougherty) writes:
> 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.

	Yep - is purely conjecture.  Debug/unassemble your BIOS and you'll
find what I said is exactly correct.

-- 
________________________________________________________________________________
	R. Kevin Laux				Email: rkl1@hound.att.com
	AT&T Bell Labs				Voice: (908) 949-1160
	Holmdel, NJ 07733			Fax:   (908) 949-0959
Technical Details
Message-ID: <1991Mar15.133548.24847@cbnewsh.att.com>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!cbnewsh!rkl
References: <1991Mar14.031024.12576@msuinfo.cl.msu.edu> <valley.668976840@gsbsun>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!cbnewsh!rkl
From: rkl@cbnewsh.att.com (kevin.laux)
Newsgroups: comp.os.msdos.programmer
Subject: Re: iret and retf
Message-ID: <1991Mar15.133548.24847@cbnewsh.att.com>
Date: 15 Mar 91 13:35:48 GMT
References: <1991Mar14.031024.12576@msuinfo.cl.msu.edu> <valley.668976840@gsbsun>
Distribution: na
Organization: AT&T Bell Laboratories
Lines: 26