pdp10-its-disassembler icon indicating copy to clipboard operation
pdp10-its-disassembler copied to clipboard

Minor disassembler extension: execute instructions

Open larsbrinkhoff opened this issue 7 years ago • 4 comments

When decoding instruction and syscalls, might as well add the option to execute them as well.

larsbrinkhoff avatar Apr 11 '18 18:04 larsbrinkhoff

Idea.

Decode instructions to three function pointers:

  1. Fetch operands. Cases:
    • None, e.g. JRST.
    • Just memory, e.g. SKIP.
    • Both AC and memory, e.g. ADDI.
    • Just AC, e.g. ...?
  2. Do operation.
  3. Write back results. Again, a few different cases.

Store these in an array shadowing main memory. Initialize all pointers to decode_instruction. Also reset to this whenever a memory location is written.

Main instruction loop:

  1. Fetch instruction word.
  2. EA calculation.
  3. Call the three pointers.
  4. Repeat.

larsbrinkhoff avatar Aug 03 '18 16:08 larsbrinkhoff

Pure pages can be filled with decode_page. The first intrstruction to be executed triggers translation of the whole page.

larsbrinkhoff avatar Aug 04 '18 03:08 larsbrinkhoff

EA calculation also has some subcases:

  • Just Y.
  • Just X.
  • Y + (X).
  • Indirection: full calculation.

larsbrinkhoff avatar Aug 05 '18 04:08 larsbrinkhoff

Possibly generate machine code:

  • Call EA Calculation routine.
  • Call Read Operands routine.
  • Call Operation routine.
  • Call Write Back routine.

Machine state registers:

  • PC - program counter
  • MA - EA
  • MB - Memory buffer
  • AR - AC
  • MQ

larsbrinkhoff avatar Aug 05 '18 04:08 larsbrinkhoff