Question

c = a + b d = a * b – c e = d/c *...

c = a + b

d = a * b – c

e = d/c * (a/c + b)

Write out the assembly code to do the high level operations. You do not need to use addressing modes, you can use letters in the statements

  1. stack
  2. accumulator
  3. (0,2) GPR
  4. (0,3) GPR
  5. (3,3) GPR
0 0
Add a comment Improve this question Transcribed image text
Answer #1

mov ax, a

mov bx,b

add ax,bx

mov c, ax

mov ax,a

mov bx,b

mul ax,bx

mov bx,c

sub ax,bx

mov ax, a

mov bx,c

div ax,bx

mov bx,b

add ax,bx

mov p,ax

mov ax,d

mov bx,c

div ax,bx

mov bx,p

mul ax,bx

Add a comment
Know the answer?
Add Answer to:
c = a + b d = a * b – c e = d/c *...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • This question is from Computer architecture. Please show steps and add comments so its easy to...

    This question is from Computer architecture. Please show steps and add comments so its easy to understand. Translate the high-level language code below into assembly instructions. The variables A, B, C, D, E and F are located in the memory and can be accessed by their label (e.g., LOAD R1, A will load A from the memory into R1). Minimize the number of instructions in the assembly code that you write. F = (A-B)*(C+D)/(E-D) a) Write the code for an...

  • 1. Consider the code sequence: C= A + B D= A-E F= C+ D Assume the...

    1. Consider the code sequence: C= A + B D= A-E F= C+ D Assume the values A, B, C, D, E, and F reside in memory. For each Architecture I. Accumulator Architecture II. Memory- Register Architecture III. Register-Register Architecture write the code assuming the instruction codes (opcode) are 8 bits, memory addresses are 32 bits, and register addresses are 6 bits and CPU has 64 Registers; and create a table which specifies: – The execution sequence – The variables...

  • In the following code I give, everytime it will output ")". Input : ((A+B)*((C-D)/(E^F))) Expected output...

    In the following code I give, everytime it will output ")". Input : ((A+B)*((C-D)/(E^F))) Expected output : ((A+B)*((C-D)/(E^F))) A+B*C-D/E^F my output : ) My code : class Et: def __init__(self , value): self.value = value self.left = None self.right = None def isOperator(c): if (c == '+' or c == '-' or c == '*' or c == '/' or c == '^' ): return True else: return False def inorder(t): if t is not None: inorder(t.left) print (t.value) inorder(t.right)...

  • (c.) What is an assembler language and what are the advantages of using one in comparison...

    (c.) What is an assembler language and what are the advantages of using one in comparison to machine code? (6 marks) (d.)The Little Man model of a computer system uses a single-digit op-code and 2-digit memory addressing and has the following instructions defined where the address portion is shown as Op. Code Description 1xx 2xx Add value in memory to accumulator Subtract value in memo Store accumulator value to memo Load value in memory to accumulator Branch to memory location...

  • For (a, b), (c, d) E R2, define if b d This defines a metric on R2. (You need not check this now....

    For (a, b), (c, d) E R2, define if b d This defines a metric on R2. (You need not check this now.) (a) Plot a few points in the plane, and find the distances between them, as mea- sured by de. Choose cases that you think will be illuminating b) Explain why this metric could be called the "lift" metric. (Think about trav- elling between floors in a hotel.) (c) i. Draw the open ball, centre (3, 0), radius...

  • Name B. (7 pts) MIPS short answer 1. (3pt) For the following MIPS assembly language program:...

    Name B. (7 pts) MIPS short answer 1. (3pt) For the following MIPS assembly language program: loop: addi Sto, $to,-1 bne $to, $zero, loop Translate the second instruction into MIPS machine language and write it in hex. 2. (2 pt) Which best describes the reason that we maintain the stack pointer in a register? (circle one) i. The hardware forces use of a stack pointer. ii. We need a local pointer because we are often limited to relative addressing. ili....

  • 2. You randomly choose a letter from (A, B, C, D, E and a friend randomly...

    2. You randomly choose a letter from (A, B, C, D, E and a friend randomly chooses a letter from fa, b, c, d, e to create a pair of 2 letters with 1 upper case letter followed by 1 lower case letter. (Note: in the English alphabet, the vowels are A, E, I, O, U.) a) Write out the sample space for this experiment. (For example one outcome in the sample space is: Ac; another is Bb.) For parts...

  • The functional decomposition flowchart shows a. how variables are used from procedures b. how procedures are...

    The functional decomposition flowchart shows a. how variables are used from procedures b. how procedures are called c. the addressing modes used in the code d. all the above 2. The pipeline a. transfers the data from the memory to the CPU b. offers processor-level parallelism C. transfers the data for memory to 1/0 d. offers instruction-level parallelism 2 The three last steps in the instruction execution cycle are a. IF, EX, WB b. EX, OF, WB C. OF, EX,...

  • (f) and (g) please f and g please letters Question 2 Indirect addressing mode in assembly language is sanilar to pointers in C. Answer the following questions: (1 point) a) How many 8-bit reg...

    (f) and (g) please f and g please letters Question 2 Indirect addressing mode in assembly language is sanilar to pointers in C. Answer the following questions: (1 point) a) How many 8-bit registers can a FSR access in the PICI8F452 MCU? b) Write the assembly language command to load the address of the variable with name: PVal into one of the FSR? (2 points) (2 points) (2 points) c) What is the meaning of: movf PREINC2, F? d) What...

  • I need PARTS (e), (f), and (g) please NOT (a), (b), (c), and (d) again, PARTS...

    I need PARTS (e), (f), and (g) please NOT (a), (b), (c), and (d) again, PARTS (e), (f), and (g) please The intensity of the sun on earth is 1300 W/m2. If this intensity falls on a black surface the size of a football field (what is it's size) (a) what is the radiation pressure on it? (b) what is the force on the football field? (c) Is this force sufficient to levitate a tennis ball (50g) against the earth's...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT