
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

Transcribed Image Text:void baz(int a, int * p)
{
pushq %rbp
movq %rsp,%rbp
subq $16,%rsp
int c;
c = a-*p;
movl %ecx,16(%rbp)
movq %rdx, 24(%rbp)
movq 24(%rbp), %rax
movl (%rax),%eax
movl 16(%rbp),%edx
subl %eax,%edx
movl %edx,%eax
movl %eax,-4(%rbp)
cmpl $0, -4(%rbp)
je L2
if (c)
{
int d = c*2;
movl -4(%rbp),%eax
addl %eax,%eax
movl %eax,-8(%rbp)
*p -= d;
movl 24(%rbp),%rax
movl (%rax),%eax
subl -8(%rbp),%eax
movl %eax,%edx
movq 24(%rbp), %rax
movl %edx, (%rax)
jmp L4:
}
(continued on next page)

Transcribed Image Text:else
{
int e = "p/2;
L2:
movq 24(%rbp),%rax
movl (%rax),%eax
movl %eax, %edx
shrl $31, %edx
addl %edx, %eax
sarl
%eax
movl %eax,-12(%rbp)
*p += e-a;
movl 24(%rbp),%rax
movl (%rax), %edx
movl -12(%rbp), %eax
subl 16(%rbp),%eax
addl
%eax,%edx
movq 24(%rbp), %rax
movl %edx,(%rax)
L4:
addq $16, %rsp
popq %rbp
ret
}
3. Registers
Rewrite the preceding example using as many registers as is reasonable.
If you use any callee save registers, remember to add the save code.
Expert Solution

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

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Jupyter Notebook Fixed Income - Certicificate of Deposit (CD) - Compound Interest Schedule An interest-at-maturity CD earns interest at a compounding frequency, and pays principal plus all earned interest at maturity. Write a function, called CompoundInterestSchedule, that creates and returns a pandas DataFrame, where each row has: time (in years, an integer starting at 1), starting balance, interest earned, and ending balance, for an investment earning compoundedinterest. Use a for(or while) loop to create this table. The equation for theith year's ending balance is given by: Ei =Bi (1+r/f)f where: Ei is year i's ending balance Bi is year i's beginning balance (note: B1 is the amount of the initial investment (principal) r is the annual rate of interest (in decimal, e.g., 5% is .05) f is the number of times the interest rate compounds (times per year) The interest earned for a given year is Ei - Bi Note the term of the investment (in years) is not in the above equation; it is used…arrow_forwardC Programming What does the below code segment do? #define RECORD_LENGTH 60 /* PORTFOLIO.DAT looks like the below: ibm 108.77 27.98 att 111.43 50 acdc 100 30 */ void main(void) { FILE *fptr; char stock_price_shares[RECORD_LENGTH + 1]; int i=0, count=0; // attempt to open PORTFOLIO.DAT for reading if ((fptr = fopen("PORTFOLIO.DAT", "r")) == NULL) printf("\nCannot open the file: PORTFOLIO.DAT\n"); else { while ( fgets(stock_price_shares, RECORD_LENGTH + 1, fptr) != NULL ) printf("\n%s", stock_price_shares); fclose(fptr); //close the file } printf("\nHow many new records for PORTFOLIO.DAT?"); scanf("%d ", &count); fptr = fopen("PORTFOLIO. DAT", "w"); /* writing */ for (i = 0; i < count; ++i) { gets(stock_price_shares); fputs(stock_price_shares, fptr); fclose(fptr); } }arrow_forwardFASTarrow_forward
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