9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] 8l(1) PUSH/POP
       [not found] <<d1c554290911060558vbab3e89le6d45c1aa2565bce@mail.gmail.com>
@ 2009-11-06 14:09 ` erik quanstrom
  2009-11-06 14:25   ` Iruata Souza
  0 siblings, 1 reply; 11+ messages in thread
From: erik quanstrom @ 2009-11-06 14:09 UTC (permalink / raw)
  To: 9fans

> the application is a pbs. for now i'm doing a stack-relative move, but
> i'd rather use a pop.
> disabling the restriction has shown no regressions in the pbs yet.
>
> and i couldn't seem to find the same restriction in vl(1) for example.

that restriction did save me quite a bit of time recently.
i had forgotten a pop in a place where it would have been
quite disasterous.  8l kindly reminded me.

i wouldn't be interested in your patch as the forgotton pop
would seem to be a much more common case.

- erik



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] 8l(1) PUSH/POP
  2009-11-06 14:09 ` [9fans] 8l(1) PUSH/POP erik quanstrom
@ 2009-11-06 14:25   ` Iruata Souza
  0 siblings, 0 replies; 11+ messages in thread
From: Iruata Souza @ 2009-11-06 14:25 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Nov 6, 2009 at 12:09 PM, erik quanstrom <quanstro@quanstro.net> wrote:
>> the application is a pbs. for now i'm doing a stack-relative move, but
>> i'd rather use a pop.
>> disabling the restriction has shown no regressions in the pbs yet.
>>
>> and i couldn't seem to find the same restriction in vl(1) for example.
>
> that restriction did save me quite a bit of time recently.
> i had forgotten a pop in a place where it would have been
> quite disasterous.  8l kindly reminded me.
>
> i wouldn't be interested in your patch as the forgotton pop
> would seem to be a much more common case.
>

my naive patch is just

538c538
< 			diag("unbalanced PUSH/POP");
---
> 			print("warning: unbalanced PUSH/POP\n");



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] 8l(1) PUSH/POP
  2009-11-06 16:58 ` Charles Forsyth
@ 2009-11-06 17:02   ` Iruata Souza
  0 siblings, 0 replies; 11+ messages in thread
From: Iruata Souza @ 2009-11-06 17:02 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Nov 6, 2009 at 2:58 PM, Charles Forsyth <forsyth@terzarima.net> wrote:
>>what is the reason behind 8l(1) not allowing unbalanced PUSH/POP?
>
> what does 8l do immediately after that?
> given that, is a warning adequate, or is something more required?
> how is this code accounting plan 9 code conventions on x86?
> there are even some comments in the function!
>
>

we all know how this is called: lazyness.
shame on me.

iru



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] 8l(1) PUSH/POP
  2009-11-06 12:22 Iruata Souza
  2009-11-06 14:33 ` Eris Discordia
@ 2009-11-06 16:58 ` Charles Forsyth
  2009-11-06 17:02   ` Iruata Souza
  1 sibling, 1 reply; 11+ messages in thread
From: Charles Forsyth @ 2009-11-06 16:58 UTC (permalink / raw)
  To: 9fans

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

what does 8l do immediately after that?
given that, is a warning adequate, or is something more required?
how is this code accounting plan 9 code conventions on x86?
there are even some comments in the function!



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] 8l(1) PUSH/POP
  2009-11-06 14:08 ` erik quanstrom
@ 2009-11-06 14:49   ` Bruce Ellis
  0 siblings, 0 replies; 11+ messages in thread
From: Bruce Ellis @ 2009-11-06 14:49 UTC (permalink / raw)
  To: 9fans

oh gee .. you think i have never contributed to 8c/8l. i could answer
every 9fans question with "i don't know but ..." but that would not be
useful information. if anyone wants to know about 8c/8l please contact
me off this open sewer.

i can explain every line of either to anyone who will listen, rather
than standing up in a crowded cinema and shouting "anybody want to buy
a used car".

i hardly read or post to this list anymore because someone seems to
answer every question anyway. oh the same person. i miss boyd.

the only people interested in my work communicate off list, rather
than risk the wrath of the incompetent. and i answer any query from
someone who wants to learn.

time to turn on filtering again. sorry for the inconvenience.

if anyone wants to know about multi-processor inferno -- well you
wasted your time going to georgia.

brucee

On Sat, Nov 7, 2009 at 1:08 AM, erik quanstrom <quanstro@quanstro.net> wrote:
> On Fri Nov  6 08:51:45 EST 2009, bruce.ellis@gmail.com wrote:
>> No room in the compiler world for amateurs. "I think ...", 'But maybe
>> ...", "I don't understand ...", etc. doesn't work for me. No problems
>> here with curiosity here, but I'm sure your not sure.
>
> i am sure that this post lacks any useful information. :-)
>
> i do not see the author of 8l standing
> up and explaining why 8l has such a restriction.  it's
> not like there is only one possible reason.  so only
> the author would know for certain.
>
> - erik
>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] 8l(1) PUSH/POP
  2009-11-06 12:22 Iruata Souza
@ 2009-11-06 14:33 ` Eris Discordia
  2009-11-06 16:58 ` Charles Forsyth
  1 sibling, 0 replies; 11+ messages in thread
From: Eris Discordia @ 2009-11-06 14:33 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> 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
>







^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] 8l(1) PUSH/POP
       [not found] <<775b8d190911060550u49d33fcaj193f053657e55159@mail.gmail.com>
@ 2009-11-06 14:08 ` erik quanstrom
  2009-11-06 14:49   ` Bruce Ellis
  0 siblings, 1 reply; 11+ messages in thread
From: erik quanstrom @ 2009-11-06 14:08 UTC (permalink / raw)
  To: bruce.ellis, 9fans

On Fri Nov  6 08:51:45 EST 2009, bruce.ellis@gmail.com wrote:
> No room in the compiler world for amateurs. "I think ...", 'But maybe
> ...", "I don't understand ...", etc. doesn't work for me. No problems
> here with curiosity here, but I'm sure your not sure.

i am sure that this post lacks any useful information. :-)

i do not see the author of 8l standing
up and explaining why 8l has such a restriction.  it's
not like there is only one possible reason.  so only
the author would know for certain.

- erik



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] 8l(1) PUSH/POP
  2009-11-06 13:24 ` erik quanstrom
  2009-11-06 13:50   ` Bruce Ellis
@ 2009-11-06 13:58   ` Iruata Souza
  1 sibling, 0 replies; 11+ messages in thread
From: Iruata Souza @ 2009-11-06 13:58 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Nov 6, 2009 at 11:24 AM, erik quanstrom <quanstro@quanstro.net> wrote:
>> what is the reason behind 8l(1) not allowing unbalanced PUSH/POP?
>
> i'm not sure of the original reason, but unbalanced
> push/pop could conflict with the linker's automatic
> stack management.  also, i'm not sure what the
> general application would be unless you want to do
> continuations.
>
> what's the application?
>
> if you're setting up a first process, i believe you can
> still modify the stack pointer directly and do a stack-
> relative move.
>

the application is a pbs. for now i'm doing a stack-relative move, but
i'd rather use a pop.
disabling the restriction has shown no regressions in the pbs yet.

and i couldn't seem to find the same restriction in vl(1) for example.

iru



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] 8l(1) PUSH/POP
  2009-11-06 13:24 ` erik quanstrom
@ 2009-11-06 13:50   ` Bruce Ellis
  2009-11-06 13:58   ` Iruata Souza
  1 sibling, 0 replies; 11+ messages in thread
From: Bruce Ellis @ 2009-11-06 13:50 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

No room in the compiler world for amateurs. "I think ...", 'But maybe
...", "I don't understand ...", etc. doesn't work for me. No problems
here with curiosity here, but I'm sure your not sure.

Same with crypto. That's why there are still > 10,000,000 insecure
linux machines out there - because the users/corporations don't
know/care about updates - and some monkey broke everything, and it
took over a year for someone to find it.

brucee

On Sat, Nov 7, 2009 at 12:24 AM, erik quanstrom <quanstro@quanstro.net> wrote:
>> what is the reason behind 8l(1) not allowing unbalanced PUSH/POP?
>
> i'm not sure of the original reason, but unbalanced
> push/pop could conflict with the linker's automatic
> stack management.  also, i'm not sure what the
> general application would be unless you want to do
> continuations.
>
> what's the application?
>
> if you're setting up a first process, i believe you can
> still modify the stack pointer directly and do a stack-
> relative move.
>
> - erik
>
>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] 8l(1) PUSH/POP
       [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
  0 siblings, 2 replies; 11+ messages in thread
From: erik quanstrom @ 2009-11-06 13:24 UTC (permalink / raw)
  To: 9fans

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

i'm not sure of the original reason, but unbalanced
push/pop could conflict with the linker's automatic
stack management.  also, i'm not sure what the
general application would be unless you want to do
continuations.

what's the application?

if you're setting up a first process, i believe you can
still modify the stack pointer directly and do a stack-
relative move.

- erik



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [9fans] 8l(1) PUSH/POP
@ 2009-11-06 12:22 Iruata Souza
  2009-11-06 14:33 ` Eris Discordia
  2009-11-06 16:58 ` Charles Forsyth
  0 siblings, 2 replies; 11+ messages in thread
From: Iruata Souza @ 2009-11-06 12:22 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

hello,

what is the reason behind 8l(1) not allowing unbalanced PUSH/POP?

thanks,
iru



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-11-06 17:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <<d1c554290911060558vbab3e89le6d45c1aa2565bce@mail.gmail.com>
2009-11-06 14:09 ` [9fans] 8l(1) PUSH/POP erik quanstrom
2009-11-06 14:25   ` Iruata Souza
     [not found] <<775b8d190911060550u49d33fcaj193f053657e55159@mail.gmail.com>
2009-11-06 14:08 ` erik quanstrom
2009-11-06 14:49   ` Bruce Ellis
     [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
2009-11-06 12:22 Iruata Souza
2009-11-06 14:33 ` Eris Discordia
2009-11-06 16:58 ` Charles Forsyth
2009-11-06 17:02   ` Iruata Souza

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).