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. 15. Write an assembly language program which will compute the sum of memory locations 0001H through 0004H The final answer should be stored into memory location A000H You may assume that your program will begin execution at line 0000H You must enter a NOP command at the end of your program to make the program stop. Enter one command per line. 16. Write an assembly language program which will multiply 3 by 12. The tinal answer should be stored into memory location A000H. You may assume that memory location B000H is holding the number 3, and memory location B0O1H is holding the number 12. Your program design must include a loop. You may assume that your program will begin execution at line 0000H You must enter a NOP command at the end of your program to make the program stop Enter one command per line. Table 3-1.gif Instruction set for a Relatively Simple CPU Instruction Code NOP 0000 0000 No operation LDAC 10000 0001 DIAC-MIri MVAC 0000 0011RAC MOVRe | 00000100 | AC=R JUMP | 000001 01 | GOTO 0000 0010 -AC 0000 0111 IF (2-0) THEN GOTO ADD SUB INAC CLAC 0000 1000 * | 0000 1001 AC- AC+R, IF (AC+R-0) Then Z- 1Else Z-0 | AC = AC-R, if (AC-R-0) Then Z-1 Else Z-0 | AC-AC + 1 . If (AC + 1 0) Then Z-1 Else Z-0 | 0000 101 0 0000 1011 AC- 0, Z- NOT0000 1111 AC- AC, I (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. 15. Write an assembly language program which will compute the sum of memory locations 0001H through 0004H The final answer should be stored into memory location A000H You may assume that your program will begin execution at line 0000H You must enter a NOP command at the end of your program to make the program stop. Enter one command per line. 16. Write an assembly language program which will multiply 3 by 12. The tinal answer should be stored into memory location A000H. You may assume that memory location B000H is holding the number 3, and memory location B0O1H is holding the number 12. Your program design must include a loop. You may assume that your program will begin execution at line 0000H You must enter a NOP command at the end of your program to make the program stop Enter one command per line. Table 3-1.gif Instruction set for a Relatively Simple CPU Instruction Code NOP 0000 0000 No operation LDAC 10000 0001 DIAC-MIri MVAC 0000 0011RAC MOVRe | 00000100 | AC=R JUMP | 000001 01 | GOTO 0000 0010 -AC 0000 0111 IF (2-0) THEN GOTO ADD SUB INAC CLAC 0000 1000 * | 0000 1001 AC- AC+R, IF (AC+R-0) Then Z- 1Else Z-0 | AC = AC-R, if (AC-R-0) Then Z-1 Else Z-0 | AC-AC + 1 . If (AC + 1 0) Then Z-1 Else Z-0 | 0000 101 0 0000 1011 AC- 0, Z- NOT0000 1111 AC- AC, I (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
