From mboxrd@z Thu Jan 1 00:00:00 1970 Mime-Version: 1.0 (Apple Message framework v753) In-Reply-To: <45219fb00802160029s2087f479xd6654e65a7b6a29c@mail.gmail.com> References: <781EB76B-227C-4E7F-BAF3-2161589DE8F4@orthanc.ca> <9f3897940802151547u69c34d7dr1e1b26d36501f71e@mail.gmail.com> <45219fb00802160029s2087f479xd6654e65a7b6a29c@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed Message-Id: <8045405E-3A7F-4D7F-9506-B5001300FEB6@mac.com> Content-Transfer-Encoding: quoted-printable From: Pietro Gagliardi Subject: Re: [9fans] Non-stack-based calling conventions Date: Mon, 18 Feb 2008 16:50:05 -0500 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Topicbox-Message-UUID: 59a88312-ead3-11e9-9d60-3106f5b1d025 It says here that setjmp can be used to make coroutines: http://my.execpc.com/~geezer/osd/tasks/index.htm On Feb 16, 2008, at 3:29 AM, Llu=C3=ADs Batlle wrote: > Talking about The Art of Computer Programming... this non-stack based > calling convention made me think of Knuth's Coroutines. I'm quite > interested on them, but although I've seen libraries for managing > them, I've never seen a real useful program based on them. I think > they could be used with advantages over the thread or normal function > call abstractions. > > Maybe someone in this list can provide a good example of coroutines =20= > use? > > 2008/2/16, Pawe=C5=82 Lasek : >> I don't have latest version of fascicle one (MMIX processor >> architecture and MMIXAL assembler language, from new version of The >> Art of Computer Programming) at hand, so I can't confirm it, but I >> remember that MMIX had a special register which implemented a >> "border", shifting register numbers to use them for procedure data >> separation. >> >> And as in all RISC architectures, storing as many parameters in the >> call stack is the way to go. Especially when you have 256 64-bit >> general purpose registers :-) (Now if only someone implemented a sane >> architecture using MMIX as main processor...) >> >> >> On 2/16/08, Pietro Gagliardi wrote: >>> - DOS interrupt function calls use the registers, not the stack. >>> - SPARC and MIPS registers are provided to pass parameters. >>> >>> On Feb 15, 2008, at 6:37 PM, Lyndon Nerenberg wrote: >>> >>>>> >>>>> The calling conventions I have seen are the ccall, stdcall >>>>> (Windows' slightly modified version of the ccall), and pascal. All >>>>> of them push parameters on the stack. >>>> >>>> Take a look at the R-call and S-call conventions used on the IBM >>>> System 360 architecture. These machines didn't even have a stack. >>>> >>>> --lyndon >>> >>> >> >> >> -- >> Paul Lasek >>