I'm trying to understand PDP-11 assembly. For that I'm going through this document.
The PDP-11 has several sets of instruction-types. One being single operand instructions, an other is double operand instructions. A double operand instructions would be for example:
MOV @(R0)+,R1
...which (if I understood it correctly) picks the data from the memory pointed to by R0, then increments R0 and then stores the data it got from memory into R1.
But what about single operand instructions? E.g.:
INC @(R0)+
What will happen? Will it:
or is 2 skipped or is 5 skipped?
This manual contains an example of INC -(R0)
in §3.3.3 that clarifies that the increment/decrement happens once before/after the main operation of the instruction:
3.3.3 Autodecrement Mode
...
Autodecrement Mode Examples
Symbolic:
INC -(R0)
, Octal code:005240
, Instruction Name: IncrementOperation: The contents of
R0
are decremented by two and used as the address of the operand. The operand is increased by one.Symbolic:
INCB -(R0)
, Octal code:105240
, Instruction Name: IncrementOperation: The contents of
R0
are decremented by one and used as the address of the operand. The operand is increased by one.