Instruction LOADM STORE SHL SHR. ADD SUB NC AND OR XOR NOT 10 BEQ 11 BNE 12 JMP
ID: 3577924 • Letter: I
Question
Instruction LOADM STORE SHL SHR. ADD SUB NC AND OR XOR NOT 10 BEQ 11 BNE 12 JMP 13 ADDC 14 CMP 15 BITM 16 Command Example Code Load Memory Address LOAD 8 into Accumulator Stores Accumulator to STORE 8 Memory Address Shifts Accumulator Left SHLO Shifts Accumulator Right SHRO Adds Accumulator w/ ADD 12 memory Subtracts Accumulator SUB 14 by Memory Increments Accumulator INCO AND Acc w/ Memory AND 8 OR Acc w/ Memory OR 9 XOR 10 XORAcc w/ Memory COMPLEMENT Acc NOT 8 Jumps to label IF BEQ test1 branch is equa Jumps to label IF BNE test2 branch NOT equal JMP test3 Jumps to label Add Acc w/ Memory w/ ADDC 12 CARRY BIT from CCR. compares accumulator 30 and memory contents CMP loads memory location directly. MUST USE ORG ORG 80 BEFORE TO SPCIFIY BITM 30 WHERE STORING Example Result ACC MI81 MI81 ACC ACC ACC 2 ACC ACC2 ACC ACC M[12] ACC ACC -M[14] ACC ACC 1 ACC ACCA MI81 ACC ACC v M[9] ACC ACC XOR M[10] ACC ACC PC test if z 1 PC test2 if z 0 PC test3 loads ACC (bit 3) into Z: (bit is 3? z 1) n: (bit is 3? z 0) is ACC- M130l? y: z 1 n: ME80] '0000 0000 0001 1110 Instruction Code: 00000 00001 00010 00011 00100 00101 00110 00111 01000 01001 01010 01011 01100 01101 01110Explanation / Answer
Step 1: Start
Step2:. First,Load the memory address M[8] into the Accumulator(Acc) and Stores accumulator to the Memory address.
Step3: Shifts the accumulator left and right.
Step4: Add the accumulator with M[12] and store the result in accumulator.
Step5: Subtract the accumulator with M[14] and store the result in accumulator.
Step6: Increment the accumulator .
Step7: Perform AND operation to accumulator and M[8] and store the result in accumulator.
Step8: Perform OR operation to accumulator and M[9] and store the result in accumulator.
Step9: Perform XOR operation to accumulator and M[10] and store the result in accumulator.
Step10: Complement the accumulator and perform BEQ and BNE test.
step11: Jump to the label test3 and ADD accumulator write Memory write CARRY BIT from CCR.
Step12: Compares the accumulator and contents of the memory.
Step13: Loads the memory location directly and must use the ORG before to specify where storing.
Step14: Stop.
///** Thank You **///