From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 6 Nov 2009 14:33:06 +0000 From: Eris Discordia To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Re: [9fans] 8l(1) PUSH/POP Topicbox-Message-UUID: 9762834a-ead5-11e9-9d60-3106f5b1d025 > what is the reason behind 8l(1) not allowing unbalanced PUSH/POP? I remember I used to first thing balance and match pushes and pops at the beginning and end of a PROC when I was trying to program in (16-bit) x86 assembly. One unbalanced or mismatched push or pop could result in wrong values ending up in the wrong registers (PUSH AX ... POP SI!). This normally voluntary process and implications of doing it wrong seem important enough to warrant a linker trying to safeguard against the possible mistake. I also seem to remember caveats on the use of certain software interrupts (BIOS routines) and/or MS-DOS (INT 21h) API calls with certain registers because those procedures for one reason or another would modify contents of registers that were not considered part of their output. It was often advised to use a matched push and pop pair around such calls and quite a number of times I forgot to match a push with a pop resulting in serious failure. --On Friday, November 06, 2009 10:22 -0200 Iruata Souza wrote: > hello, > > what is the reason behind 8l(1) not allowing unbalanced PUSH/POP? > > thanks, > iru >