Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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 Rclatively 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 chant below shows a sectioe of memoy wid its binary coesers,nepresenting a machise language peogram for the Relatively Simple CPU Address Contents 00000001 0000 1010 0000 0111 0000 1111 . This program begins executioe oe line 1. This program centains a loop How many times does the loop body execute? Emer an integer, or the word "infinne 6. If you wcre told that a machine language instruction bepias w address 3 how many byses would that insoruction occupy in memony 7.If you were told bat a machine language instructioe begias uddress write the assembly language for he inseruction which begies at at addess 8 Assuming again that the progam begins esecution on line 1.what value will be sored in the AC regisser when program Emer your answer in binary, using 8bits 9. If the dat at address O wem changnd to 1110 1000 and the program begins esecution on line 1 how many times would he loop body execute them? Ermer an intrger, or the word "infinine Table 3-1.gif Instruction set for a Relatively Simple CPU 2 bito 0000 0000No operation NOP LDAC * 10000 0001)| AC-Miri STAC | 0000 0010 r | MIT] = AC MVAC 0000 0011 R AC MOVR | 00000100 | AC=R JUMP 1 0000 01 01 | GOTO MPZ0000 0110rIF (Z-1) THEN GOTO r JPNZ e | 0000 01 1 1 r | IF (Z 0) THEN GOTO AIX) * |0000 1000 |AC-AC + R. If (AC + R-O) Then Z. Else Z = 0 SUB * | 0000 1001 | AC= AC-R, If (AC-R-0) Then Z = 1 Else Z-0 INAC | 00001010 | AC-AC+1.lf(AC + 1 0) Then Z. 1 Else Z-0 CLAC 00001011 AC- 0, Z 1 AND 0000 1100 AC- ACA R, IF (ACAR-0) Then Z- 1 Else Z- OR 00001101 AC-ACv R, If (ACvR 0) Then Z- 1 Else Z-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 Rclatively 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 chant below shows a sectioe of memoy wid its binary coesers,nepresenting a machise language peogram for the Relatively Simple CPU Address Contents 00000001 0000 1010 0000 0111 0000 1111 . This program begins executioe oe line 1. This program centains a loop How many times does the loop body execute? Emer an integer, or the word "infinne 6. If you wcre told that a machine language instruction bepias w address 3 how many byses would that insoruction occupy in memony 7.If you were told bat a machine language instructioe begias uddress write the assembly language for he inseruction which begies at at addess 8 Assuming again that the progam begins esecution on line 1.what value will be sored in the AC regisser when program Emer your answer in binary, using 8bits 9. If the dat at address O wem changnd to 1110 1000 and the program begins esecution on line 1 how many times would he loop body execute them? Ermer an intrger, or the word "infinine Table 3-1.gif Instruction set for a Relatively Simple CPU 2 bito 0000 0000No operation NOP LDAC * 10000 0001)| AC-Miri STAC | 0000 0010 r | MIT] = AC MVAC 0000 0011 R AC MOVR | 00000100 | AC=R JUMP 1 0000 01 01 | GOTO MPZ0000 0110rIF (Z-1) THEN GOTO r JPNZ e | 0000 01 1 1 r | IF (Z 0) THEN GOTO AIX) * |0000 1000 |AC-AC + R. If (AC + R-O) Then Z. Else Z = 0 SUB * | 0000 1001 | AC= AC-R, If (AC-R-0) Then Z = 1 Else Z-0 INAC | 00001010 | AC-AC+1.lf(AC + 1 0) Then Z. 1 Else Z-0 CLAC 00001011 AC- 0, Z 1 AND 0000 1100 AC- ACA R, IF (ACAR-0) Then Z- 1 Else Z- OR 00001101 AC-ACv R, If (ACvR 0) Then Z- 1 Else Z-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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions