9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Eris Discordia <eris.discordia@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] 8l(1) PUSH/POP
Date: Fri,  6 Nov 2009 14:33:06 +0000	[thread overview]
Message-ID: <BDC3B4D8CF958BE4FEC427D5@[192.168.1.2]> (raw)
In-Reply-To: <d1c554290911060422q45dd90cq4a37ec9a9c6ecce6@mail.gmail.com>

> 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
<iru.muzgo@gmail.com> wrote:

> hello,
>
> what is the reason behind 8l(1) not allowing unbalanced PUSH/POP?
>
> thanks,
> iru
>







  reply	other threads:[~2009-11-06 14:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-06 12:22 Iruata Souza
2009-11-06 14:33 ` Eris Discordia [this message]
2009-11-06 16:58 ` Charles Forsyth
2009-11-06 17:02   ` Iruata Souza
     [not found] <<d1c554290911060422q45dd90cq4a37ec9a9c6ecce6@mail.gmail.com>
2009-11-06 13:24 ` erik quanstrom
2009-11-06 13:50   ` Bruce Ellis
2009-11-06 13:58   ` Iruata Souza
     [not found] <<775b8d190911060550u49d33fcaj193f053657e55159@mail.gmail.com>
2009-11-06 14:08 ` erik quanstrom
2009-11-06 14:49   ` Bruce Ellis
     [not found] <<d1c554290911060558vbab3e89le6d45c1aa2565bce@mail.gmail.com>
2009-11-06 14:09 ` erik quanstrom
2009-11-06 14:25   ` Iruata Souza

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BDC3B4D8CF958BE4FEC427D5@[192.168.1.2]' \
    --to=eris.discordia@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).