[pdp7-unix] A.out format and instruction encoding

Angelo Papenhoff aap at papnet.eu
Wed Oct 23 02:10:10 AEST 2019


On 22/10/19, Will Senn via pdp7-unix wrote:
> @ od system cat
> 000000: 000004 144144 040040 040040 040040 000000 000000 000000
> 000010: 000006 164164 171151 156040 040040 000000 000000 000000
> 000020: 000007 153145 171142 157141 162144 000000 000000 000000
> 000030: 000010 160160 164151 156040 040040 000000 000000 000000
> 000040: 000013 164164 171157 165164 040040 000000 000000 000000
> 000050: 000014 144151 163160 154141 171040 000000 000000 000000
> 000060: 000015 160160 164157 165164 040040 000000 000000 000000
>> and relate it back to cat.s
> “ cat.s
>    lac 017777 i
>    sad d4
>>  
> So far, I’m not seeing it. I’m sure it’s there, but not to my untrained eye. According to the pdp7 manual lac is opcode 20, but the user manual says opcodes are coded into the 4 msb. How can 20 octal (16 decimal) fit into 4 bits? Or sad which is 54 octal?

First of all what you're doing is od on system (the directory) and on
cat, so what you're seeing is a directory, not a binary.
To look at cat, do `ln system cat cat` `od cat` `rm cat`

As for opcodes, the numbers given have the lower two bits set to zero
because they aren't actually part of the opcode field. i.e. 54 means 1011xx


aap


More information about the pdp7-unix mailing list