010000: 237777 lac 017777 i " Have we got any arguments? 010001: 550101 sad d4 010002: 610073 jmp error " No, give an error 010003: 217777 lac 017777 010004: 350101 tad d4 " Skip past argc 010005: 040010 dac 8 " and save the ptr to the octal value at location 8 010006: 350100 tad d1 " Why only 1 here? 010007: 050053 dac name " Save the filename pointer 010010: 150111 dzm octal " Zero the octal value and 010011: 150107 dzm nchar " the number of characters 010012: 777770 -8 " Set c1 to -8 so we can increment up to zero 010013: 050110 dac c1 " and thus count the number of chars in the argument 010014: 210107 lac nchar " Get any left-over character from the last loop 010015: 150107 dzm nchar " and set nchar to empty now 010016: 740200 sza " It was already empty, so get a new word 010017: 610026 jmp 2f " Not empty, it has the second ASCII value, goto 2f 010020: 220010 lac 8 i " Read the next word with two chars in it 010021: 652000 lmq " Copy it to MQ 010022: 510105 and o177 " Trim off all but the second ASCII value 010023: 050107 dac nchar " Save it into nchar 010024: 641002 lacq " Bring it back from MQ 010025: 660511 lrss 9 " and shift down the first ASCII value 010026: 550104 sad o40 " If the character is a space 010027: 610037 jmp 3f " don't try to make it part of the octal value 010030: 350106 tad om60 " Not a space, subtract 060 i.e. '0' 010031: 652000 lmq " Move it into MQ 010032: 210111 lac octal " Load the octal value up to here 010033: 744000 cll; als 3 " Shift it left 3 bits 010034: 640703 010035: 640002 omq " OR in the digit from MQ 010036: 050111 dac octal " and save back in the octal value 010037: 450110 isz c1 " Is that the last character? 010040: 610014 jmp 1b " No, go back and get another one 010041: 237777 lac 017777 i " How many arguments left? 010042: 550102 sad d8 010043: 020016 sys exit " None, exit 010044: 350103 tad dm4 " Subtract 4 to indicate one less argument 010045: 077777 dac 017777 i " and save for next time 010046: 210053 lac name " Also move to the next filename 010047: 350101 tad d4 010050: 050053 dac name 010051: 210111 lac octal " Set AC to have the new file mode 010052: 020022 sys chmod; name:0 " and change the file's mode 010053: 000000 010054: 740100 sma 010055: 610041 jmp loop " Loop if no error 010056: 210053 lac name " We got back -1, error 010057: 050062 dac 1f " Write out the filename on stdout 010060: 210100 lac d1 " followed by the " ?\n" string 010061: 020005 sys write; 1:0; 4 " and loop back 010062: 000000 010063: 000004 010064: 210100 lac d1 010065: 020005 sys write; 1f; 2 010066: 010071 010067: 000002 010070: 610041 jmp loop 010071: 000040 040;077012 " String literal " ?\n" 010072: 077012 010073: 210100 lac d1 " Write " "\n" to stdout and exit 010074: 020005 sys write; 1b+1; 1 010075: 010072 010076: 000001 010077: 020016 sys exit 010100: 000001 d1: 1 " Numeric constants 010101: 000004 d4: 4 010102: 000010 d8: 8 010103: 777774 dm4: -4 010104: 000040 o40: 040 010105: 000177 o177: 0177 010106: 777720 om60: -060