MARIE: Instructions

Most of the instructions are explained pretty well, but we need to talk a bit more about SKIPCOND, which we use to create 3 types of if conditions: check if a number is zero, positive, or negative. SKIPCOND will look at the last 2 bits of the Instruction Register (IR), which we denote as IR[11-10], and will behave according to the following pseudo-code:

if (IR[11-10] == 00) // If the bits are 0 and 0,
    if (AC < 0) // Check if AC is negative.
        PC = PC + 1;
else if (IR[11-10] == 10) // If the bits are 0 and 1,
    if (AC == 0) // Check if AC is zero.
        PC = PC + 1;
else if (IR[11-10] == 01) // // If the bits are 1 and 0,
    if (AC > 0) // Check if AC is positive.
        PC = PC + 1;