News for hackers. Stuff that matters.
Re:The Earliest Unix Code: An Anniversary Source Code Release by Pete_D on Thursday October 17, 2019 @09:15PM (#21287821)
If my reading is right, it filters out any with a leading null-byte before writing back out. My guess is that that is how they implemented unlink/rm - just write zeroes over the entry.

As for the sys write: my current hypothesis is that .. there is a placeholder for an argument which is written to by the preceding dac .+4. ('"If a program can't rewrite its own code", he asked, "what good is it?"'). But I can't make sense of what it's actually putting there - I'd guess length, but it looks like ~(dir - 2) + 8.

Re:The Earliest Unix Code: An Anniversary Source Code Release by kps on Friday October 18, 2019 @12:47AM (#21288766)
> but it looks like ~(dir - 2) + 8.

That took me a while. The ‘8’ in ‘tad 8' is the contents of memory location 8, i.e. the destination pointer in the memory copy, so it's ~(dir - 2) + dst. And since -x = ~x + 1 (there being no negation instruction), that works out to the length, dst - dir + 1.