Search code examples
locationpdp-11

Ask for explain of some code of UNIX V6


Currently I am reading the book: Lions_Commentary_on_UNIX_6th_Edition, together I am trying to understand the source code of unix v6, and I found some code intriguing: e.g.

. = 40^.
...
. = 60^.

This is some PDP-11 assembly which I am not very good at, so could anyone explain to me what did these codes try to do here? Also, in PDP-11, there is another symbol : "..", can anyone explain what does this symbol do , as well?


Solution

  • . is the location counter so assembly language statement is adjusting the position of the location counter by the the expressions 40^. or 60^. so the intent is to move the assembler location counter around.

    If the statement read

    . = 40 + .
    

    it would mean change the location counter to 40 (octal) + the current value of the location counter. What confuses me is that the ^ is an unary operator that according to the MACRO11 manual I have doesn't make sense in this usage.