
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%

Transcribed Image Text:Using the Add Two program from Section 3.2 as a
reference, write a program that calculates the
following expression: using registers:
A = (A + B) - (C+D)
Assign integer values to the EAX, EBX, ECX, and
EDX registers.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
Similar questions
- Write a sequence of statements that display a subroutine’s return address. Hint: the esp register points to the return address stored on the call stack. You can call procedure WriteHex. This can be solved in 2 lines of code. The following exercise can be solved using either 32-bit or 64-bit code. Assembly languagearrow_forwardThe following instruction set is supported by a simple processor, which is similar to what we discussed in the class, with a few new instructions added. The format of most instructions is defined as follows. bits 15:14 13:10 9 8:6 5:3 2:0 field unused opcode w srcl src2 dst where the fields are defined as follows. opcode : operation to be performed by the processor write back ALU output to register file (1= yes, 0 = no) address of the first ALU operand in the register file address of the second ALU operand in the register file address in the register file where the output is written w: srcl: src2: dst: For opcodes BEQ, BLEZ and JUMP, the 6 least significant bits (5:0) give an address in the instruction memory, which is byte-addressed. The opcode HALT has all operand bits (9:0) being 0. When an instruction has only two operands, the field for the unused operand is filled with 0-bits. For example, bits (5:3) for SLL are all zero because src2 is not used. The opcode and meaning of these…arrow_forwardWrite an interactive program that inputs the coefficient of a quadratic equation, computes, and displays the roots of the quadratic equation. All input, computation, and output should be done using double-precision floating-point instructions and registers. The program should handle the case of complex roots and displays the results properly. note: the solution should be in MIPS assembly language.arrow_forward
- plz do it in very easy methid in assembly languagearrow_forward|long arith(long x,long y,long z) { long t1=x+y; long t2=z+t1; long t3=x+4; |long t4=y*48; long t5=t3+t4; long rval=t2*t5; return rval ; } In what registers are the arguments x, y, and z passed? In what register is variable rval returned? How many registers are involved in the execution of all the ALU operations? How many bytes are allocated to the stack frame of function arith? Justify your answer. Annotate each line of the assembly code obtained from the compiler and include the screenshot.arrow_forwardplease use python function should do the following: when the function input is ([[11, 11, 11, 11, 11], [1, 5, 5, 5, 7], [255, 255, 255, 0, 255]]) the output should be [['11x5'], ['1x1', '5x3', '7x1'], ['255x3', '0x1', 255x1']] functions/methods (please DO NOT use functions that are not specified here):sum() min() max() list append() list insert() list remove() list pop() list count() list index() list sort() str capitalize() str isupper() str strip() str split() str join() id() len() str lower() str upper() str replace() str count() str find()arrow_forward
- Write a code in sim8085 for the following problem: The pressure of two boilers is monitored and controlled by a microcomputer works based on microprocessor programming. A set of 6 readings of first boiler, recorded by six pressure sensors, which are stored in the memory location starting from 2050H. A corresponding set of 6 reading from the second boiler is stored at the memory location starting from 2060H. Each reading from the first set is expected to be higher than the corresponding position in the second set of readings. Write an 8085 sequence to check whether the first set of reading is higher than the second one or not. If all the readings of first set is higher than the second set, store 00 in the ‘D’ register. If any one of the readings is lower than the corresponding reading of second set, stop the process and store FF in the register ‘D’. Data (H): First set: 78, 89, 6A, 80, 90, 85 Second Set:71, 78, 65, 89, 56, 75arrow_forwardIN ASSEMBLY (not C++) (do not submit hand written notes) Write a program that calculates the following expression, using registers: EAX = (EAX + EBX) − (ECX + EDX). Assign integer values to the EAX,EBX, ECX, and EDX registers. Execute this expression in in a self-created procedure called addRegs.arrow_forwardlanguage: Python Problem: Write a function log2(x), which gives an integer approximation of the log base 2 of a positive number x, but it does so using recursion. Use a base case where you return 0 if x is 1 or less. In the general case, add 1 to the answer and divide x by 2. On top of writing the function, also write a test case for the function to prove the program works.arrow_forward
- translate the following MIPS code to C. Assume that the variables i, j, and k areassigned to the registers $s0, $s1, and $s2, respectively. Assume that the baseaddress of the array A is in registers $s6.Loop: blt $s0, $s1, Exitbge $s1, $s2, Exitaddi $s1, $s1, 5j LoopExit:addi $t0, $zero, 4ble $s0, $t0, Donesll $t1, $s0, 2add $t2, $s6, $t1sw $zero, 0($t2)Done:arrow_forwardThe following C code is a formula representing the Volume of a Sphere. Convert into MIPS code. (You don't need to convert to machine code.) Assume that the variables volume and radius are mapped into the floating point registers $f0 and $f1 respectively. Volume = (4.0/3.0) (3.14) * pow(radius, 3)arrow_forwardTake a look at the following assembly code. Which of the following describes what is going on in the code? MOVQ $0 , %raxmystery: INCQ %rax CMPQ $5 , %rax JL mystery Group of answer choices A. This is a function call to the function 'mystery' where we increment the value stored in rax. B. This is essentially a while loop decreasing a counter by 1. C. First 0 is stored in a register--rax. Then we increment rax by 1, and compare to see if the value is 5. If it is less than 5, then we jump back to the label mystery. This is essentially a while loop incrementing a counter by 1.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education