Hacker News new | ask | show | jobs
by 101914 4007 days ago
The shell I use on x86 returns the value in ax as the shell variable $?.

I have always thought about the idea of a shell that could return values from other registers.

I guess there are reasons this would be a stupid experiment. Or maybe I am the only one could see the utility of it.

Did anyone see Bourne's keynote at BSDCan about how sh was developed? I only looked at the slides.

Meanwhile I use a debgger for asm programs called ald to trace register values. I found a nasty bug in this program but I am not aware of any similar debuggers aimed at asm (cf. C).

1 comments

I think eax is the only register guaranteed to have its value preserved by the ABI. So the other registers might end up with junk loaded during the exit() syscall.

Plus IMHO, the added confusion of having extra output channels doesn't seem worth it.