Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[9fans] 8l(1) PUSH/POP

4 views
Skip to first unread message

Iruata Souza

unread,
Nov 6, 2009, 7:26:58 AM11/6/09
to
hello,

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

thanks,
iru

erik quanstrom

unread,
Nov 6, 2009, 8:33:16 AM11/6/09
to
> 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

Bruce Ellis

unread,
Nov 6, 2009, 8:53:51 AM11/6/09
to
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

Iruata Souza

unread,
Nov 6, 2009, 9:01:48 AM11/6/09
to

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

erik quanstrom

unread,
Nov 6, 2009, 9:11:38 AM11/6/09
to
> 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

Iruata Souza

unread,
Nov 6, 2009, 9:36:12 AM11/6/09
to

my naive patch is just

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

erik quanstrom

unread,
Nov 6, 2009, 9:35:56 AM11/6/09
to
On Fri Nov 6 08:51:45 EST 2009, bruce...@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

Eris Discordia

unread,
Nov 6, 2009, 9:38:53 AM11/6/09
to
> 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

Bruce Ellis

unread,
Nov 6, 2009, 9:52:15 AM11/6/09
to
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

Charles Forsyth

unread,
Nov 6, 2009, 11:59:45 AM11/6/09
to
>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!

Iruata Souza

unread,
Nov 6, 2009, 12:05:26 PM11/6/09
to

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

iru

0 new messages