IADD (0x60)


The IADD instruction pops the top two elements from the stack, adds them, and pushes the sum back onto the stack.

Interpreter Microcode

The microinstructions are listed in the order in which they are executed; not the order in which they are stored in the control store.

0x060  SP=MAR=SP-1; rd; goto 0x3
...
0x003  H=TOS; goto 0x4
0x004  TOS=MDR=H+MDR; wr; goto 0x2

Example Program

//---------------------------------------------
// Demonstrate the IADD instruction.
//
// 1. Clear Memory
// 2. Assemble this program.
// 3. Reset the computer.
// 4. Click the "Display Words" radio button
//    below the memory display.
// 5. Click the "Run" button.
//
// After running this program
//     10 is stored at address 4097
// and the top of the stack is at 4097.
//---------------------------------------------
.main
    bipush 4  // Push 4 onto the stack
    bipush 6  // Push 6 onto the stack
    iadd      // Replace top two values with their sum
    halt
.end-main