Question: For any question which requires you to write assembly language code, you must adhere to the following a. The command name should be given in

For any question which requires you to write assembly language code, you must adhere to the following a. The command name should be given in all capital lesters b. There should be cxactly onc space between the command and an operand c. There should be no additional spaces anywhere in your command d. Memory addresses should be given in hexadecimal and should end with a capital H to indicate they are in hexadecimal e. Memory addresses should consist of exactly 4 hexadecimal digits (because 4 hex digits represents 16 binary bits and the memory addresses in our computer are expressed using 16 bits) f. Hex digits A-F should be expressed using capital letvers All of the questions in this assignment are in reference to the Relatively Simple CPU, which was discussed in class, and is outlined in chapter 3 of your book.The instruction set for this computer can be found on page 123 The chart below shows a section of memory with its binary contents, representing a machine language program for the Relatively Simple CPU Address Contents 0000 0001 00000100 0000 1010 1111 0010 1. If the program starts execution at address 0, what value will be stored in tht AC register when this program finishes exccuting the instruction at line 3? Enter your answer in binary, using 8 bits. 2. If you were told that a machine language instruction begins at address 3.bow many bytes would that instruction occupy in memory? 3. Write the assembly language for the instruction which begins at line 0: 4. Write the assembly language for the instruction which begins at line 3 Table 3-1.gif Instruction set for a Relatively Simple CPU 21 bi 0000 0000No operation LDAC * 0000 0001 r) | AC-Miri STAC | 0000 0010 r | MIT] = AC MVAC 0000 0011RAC MOVR | 00000100 | AC=R JUMP 1 0000 01 01 GOTO JMPZ | 0000 01 10 r | lFOZ-1) THEN GOTO r JPNZ e | 0000 01 1 1 r | IF (Z=0) THEN GOTO AIX) * |00001000 | AC-AC + R. If (AC + R-O) Then Z-1 Else Z = 0 SUB * | 0000 1001 | AC = AC-R, If (AC-R-0) Then Z = 1 Else Z-0 INAC0000 1010 AC- AC1, I (AC-0)Then Z-1 Else Z-0 CLAC 0000 10 AC 0, Z 1 AND 0000 1100 AC- ACA R, IF (ACAR-0) Then Z- 1 Else Z- OR 00001101 XOR | 0000 1 1 10 | AC-ACR, If (AC R-O) Then Z-1 Else 2-0 NOT 0000 1111 AC-AC, If (AC 0) Then Z-1 Else Z-0 For any question which requires you to write assembly language code, you must adhere to the following a. The command name should be given in all capital lesters b. There should be cxactly onc space between the command and an operand c. There should be no additional spaces anywhere in your command d. Memory addresses should be given in hexadecimal and should end with a capital H to indicate they are in hexadecimal e. Memory addresses should consist of exactly 4 hexadecimal digits (because 4 hex digits represents 16 binary bits and the memory addresses in our computer are expressed using 16 bits) f. Hex digits A-F should be expressed using capital letvers All of the questions in this assignment are in reference to the Relatively Simple CPU, which was discussed in class, and is outlined in chapter 3 of your book.The instruction set for this computer can be found on page 123 The chart below shows a section of memory with its binary contents, representing a machine language program for the Relatively Simple CPU Address Contents 0000 0001 00000100 0000 1010 1111 0010 1. If the program starts execution at address 0, what value will be stored in tht AC register when this program finishes exccuting the instruction at line 3? Enter your answer in binary, using 8 bits. 2. If you were told that a machine language instruction begins at address 3.bow many bytes would that instruction occupy in memory? 3. Write the assembly language for the instruction which begins at line 0: 4. Write the assembly language for the instruction which begins at line 3 Table 3-1.gif Instruction set for a Relatively Simple CPU 21 bi 0000 0000No operation LDAC * 0000 0001 r) | AC-Miri STAC | 0000 0010 r | MIT] = AC MVAC 0000 0011RAC MOVR | 00000100 | AC=R JUMP 1 0000 01 01 GOTO JMPZ | 0000 01 10 r | lFOZ-1) THEN GOTO r JPNZ e | 0000 01 1 1 r | IF (Z=0) THEN GOTO AIX) * |00001000 | AC-AC + R. If (AC + R-O) Then Z-1 Else Z = 0 SUB * | 0000 1001 | AC = AC-R, If (AC-R-0) Then Z = 1 Else Z-0 INAC0000 1010 AC- AC1, I (AC-0)Then Z-1 Else Z-0 CLAC 0000 10 AC 0, Z 1 AND 0000 1100 AC- ACA R, IF (ACAR-0) Then Z- 1 Else Z- OR 00001101 XOR | 0000 1 1 10 | AC-ACR, If (AC R-O) Then Z-1 Else 2-0 NOT 0000 1111 AC-AC, If (AC 0) Then Z-1 Else Z-0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
