CS 342 Lecture -*- Outline -*- * Implementation of Pseudo-code interpreters. ** Data structures data memory, program memory, instruction pointer (IP) DRAW PICTURE ** Representation data and program memory are arrays of what? Will 10 digits fit in a 32 bit integer? ** Read execute cycle (hence an iterative interpreter) 1. Read instruction in memory[IP] 2. Advance IP 3. Decode instruction, 4. fetch operands (if necessary) and execute the operation 5. go to step 1 -Where can we detect errors? Decoding = field extraction Fetch handled by array subscripting Computation is done in host language (Pascal) Control flow done by changing IP ** Debugging tracing, enable - disable pretty printing trace output breakpoints and memory testing operations -what executes commands of the debugger? (an interpreter)