views:

95

answers:

2

I have small question about pdp-11(simulator), I have this command (it begins from the address 1000) add 2500, #2500

and this initial list:

register/address - initial value
pc                 1000
sp                 600
2500               3000

and I want to know how this small snippet exactly runs, in my booklet I found that: firstly it reads inforamtion from the address 1000, inside this address we have value 066727, after we read number from the address 1002, AND VALUE MUST BE 2500(because of add 2500, #2500), but in my booklet I have 1474 without any explanations why, I know that I have here relative addressing mode, but why 1474 inside the address 1002 and not 2500, thanks in advance for any help

A: 

I don't recall all the addressing modes, but look at address 1474 and see if it contains 2500.

John Saunders
A: 
ADD 2500,#2500

compiles as

    0:      066727 ; ADD
    2:      002474 ; 2500 - 6 (next instruction offset)
    4:      002500 ; #2500 (literal value)
    6:      ...    ; next instruction
  ...
 2500:      003000
Stephane