Question: Write the codes as describe in the question in assembly language all: 1 . Define a variable named a 1 and initialize with the value

Write the codes as describe in the question in assembly language all:
1. Define a variable named a1 and initialize with the value 5.
2. Define a variable named wen2 and initialize with the value 5.
3. Multiply these variables using general purpose registers.
4. Store the multiplied value in a new variable named res3.
5. Use immediate instruction to load 5(hex) and 10(hex) in r0 and r1, two of the
general-purpose registers. Do exclusive OR between these two registers and store
the value in a variable named xor_ans.
6. Create an array named arr1 containing the numbers 1,2,3,4,5. Read the numbers
using an unconditional branch and also using r8 and r9 register.
7. Create three branches named, bran1,bran2 & bran3 serially in the code
segment. Then, in the first branch you need to move 1(Decimal) to r3. In the second
branch, write down the code to move 2(Decimal) to r4. Again, In the third branch,
write down the code to move 3(Decimal) to r5. Use branch less than condition to
bran2 with r0 and r1 and explain what happens.
8. Suppose, an array named nmbr declared which contains
2,3,5,4 and 8. Find the maximum number stored in this
array and multiplied value of all numbers. Store them to a
variable named max_array and mul_array.
9. Write down a program to find out if a number stored in r6
register is positive or negative using branch if minus
instruction. For the output prompt, the r1 register must be
used. When r1 is 0 it indicates positive and when r1 is 1 it
indicates negative.
10. Can you design the table to print Hexa Decimal Digits in a Seven-segment
display? You can design the table using a table in a Word file.
11. Now, use that table and make switch cases to print hex digits in a seven-
segment display. Take two inputs using the switch in the ALTERA DE1
board and print the sum of two numbers using seven-segment display.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!