[TUHS] as(1) on Ultrix-11 vs 2.11BSD

Ronald Natalie ron at ronnatalie.com
Tue Apr 28 23:03:16 AEST 2020


Yes, you aren’t programming 2.11 BSD correctly.

Your examples are the older UNIX syscalls (your programs work correctly in Version 6 by the way as well).

In 2.11 BSD, all the arguments for the syscalls are inline (i.e., none are passed in registers.   This appears to be the beginnings of making the kernel protable across architectures.
The systent table no longer has separate fields for args in registers and not in registers and the code in sys/pdp/trap.c doesn’t look at the registers anymore.


> On Apr 27, 2020, at 9:56 PM, Jacob Ritorto <jacob.ritorto at gmail.com> wrote:
> 
>         mov     $1,r0
>         sys     4
>         a
>         6
>         sys     1

Proper code now should be:
          sys 4
         1
         a
         6
        sys 1
        0


Note your previous code used to just return 6 from the program (the return value of write).


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20200428/ace05c98/attachment.html>


More information about the TUHS mailing list