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