Memory Fetch Macro

All fetches from simulated PDP-8 memory go through an instance of this macro. (See STORE.)
 
 FETCH    MACRO  MA,MB       FETCH FROM MEMORY 
          MX6    -10 
          BX1    X6*MA 
          AX1    6 
          SB6    X1  
          BX1    -X6*MA  
          SA1    X1+MEMORY 
          A&MB   X1,B6 
          B&MB   X0*MB 
          ENDM
 

Four PDP-8 words are blocked into one CDC word. The macro first separates the PDP-8 address (MA) into two parts, a 10-bit block number (in X1) and a 2-bit word within block (in B6) scaled to be a multiple of 16.

 

The proper block is fetched from MEMORY. Then the desired word is extracted and returned in the desired X register (MB)..

 

Memory Fetch Routine

FORTRAN code gains access to the fetch logic through this one adaptor routine.
 
 FETCH    PS 
          RJ     RESREG  
          FETCH  X3,X4 
          RJ     SAVREG  
          EQ     FETCH
 
 

PDP-8 Simulator
© 1975, 1998, Ward Cunningham
all rights reserved