Question

//calling method int[] data = {7, 4, 3, 2}; int size = 2; method(data, size); public...

//calling method

int[] data = {7, 4, 3, 2};

int size = 2;

method(data, size);

public static int[] method(int[] array, int length)

{

            int[] result = new int[length];

            for (int index = 0; index < length && index < array.length; ++index)

                        result[index] = array[index];

            return result;

}

                                                                                                                        Heap

Identifier

Address

Contents

1000

1001

1002

1003

1004

1005

1006

1007

1008

1009

1010

1011

1012

Main Stack Frame        

Identifier

Address

Contents

101

102

103

Method Stack Frame

Identifier

Address

Contents

200

201

202

0 0
Add a comment Improve this question Transcribed image text
Answer #1
1000 MOV DI, 501 DI < – 2001
1003 MOV SI, 500 SI < – 2000
1006 MOV CL, [SI] CL < – [SI]
1008 XOR CH, CH CH < – CH ^(XOR) CH
100A INC SI SI < – SI+0001
100B DEC CX CX < – CX-0001
100C MOV BX, SI BX < – SI
100E MOV AH, CL AH < – CL
1010 INC AH AH < – AH+01
1012 MOV AL, [SI] AL < – [SI]
1014 INC SI SI < – SI+0001
1015 DEC AH AH < – AH-01
1017 CMP AL, [SI] AL-[SI]
1019 JC 41F If Carry Flag = 1, goto offset 101F
101B MOV AL, [SI] AL < – [SI]
101D MOV BX, SI BX < – SI
101F INC SI SI < – SI+0001
1020 DEC AH AH < – AH-01
1022 JNZ 417 If Zero Flag = 0, goto offset 1017
1024 MOV DL, [BX] DL < – [BX]
1026 XCHG DL, [DI] DL < – > [DI]
1028 XCHG DL, [BX] DL < – &gt [BX]
102A INC DI DI < – DI+0001
102B MOV SI, DI SI < – DI
102D LOOP 40C CX < – CX-0001; If Zero Flag = 0, goto offset 40C.
102F HLT End of program.
Add a comment
Know the answer?
Add Answer to:
//calling method int[] data = {7, 4, 3, 2}; int size = 2; method(data, size); public...
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
  • For each code fragment below, show a memory diagram that traces the execution of the calling...

    For each code fragment below, show a memory diagram that traces the execution of the calling method. d) //calling method intp data = {1, 3, 5); method(datal2 public static int methodliot size) nt source new intfsize: for (int i-0; issourclength:i) sourceli)-size; return source; Heap Identifier Address Contents Main Stack Frame 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 Identifier Address Contents 101 102 103 Method Stack Frame Identifier Address Contents 200 201 202

  • (30 points; 6 points each part) For each code fragment below, show a memory diagram that traces t...

    (30 points; 6 points each part) For each code fragment below, show a memory diagram that traces the execution of the calling method. 2. a) //main method nt data-14,7,3; method(data, 0); public static void method(int[l array, int value) for (int index array,length/2; index

  • Find the manufacturer(s) of the computer (PC or laptop) with the highest available speed. Write in...

    Find the manufacturer(s) of the computer (PC or laptop) with the highest available speed. Write in Relational Algebra. Pc 1002 pc pc Product model maker type 1001 pc 1003 pc 2004 laptop 2005 laptop 2006 laptop 1004 pc 1005 pc 1006 2007 laptop 1007 1008 pc 1009 pc 1010 pc 3004 printer 3005 printer 1011 pc 1012 1013 pc 2001 laptop 2002 laptop 2003 laptop 3001 printer 3002 printer 3003 printer 2008 laptop 2009 laptop 2010 laptop 3006 printer 3007...

  • ANSWER NUMBER 2 PLEASE 1. Briefly explain what the overall purpose of this program is and...

    ANSWER NUMBER 2 PLEASE 1. Briefly explain what the overall purpose of this program is and complete the memory table below which should show what is in memory after the program has been run. (e.g. Purpose: finds largest of five numbers) $1000 DC.B $18, $39, $E1, $8B, $15 ORG TABLE ORG $2000 LDX #TABLE LDAB #5 LDAA 0, X STAA 5, X LOOP INX DBNE B, LOOP BRA $1000 $1001 $1002 $1003 $1004 $1005 $1006 $1007 $1008 $1009 2. Assuming...

  • Binary Search C++ Coding

    User Text Fileuser_id fname  lname  gender age phone address1001 Ray    Dixon M 46 9364652 Lokia1002 Bryan Green M 18 9579302 Drekena1003 Justin Dixon M 33 9353533 Lokia1004 Lester Byrd M 45 9534695 Nasilai1005 Santos Larson M 53 9093177 Vunuku1006 Bryan Cobb M 42 9905139 Narocivo1007 Eddie Watson M 20 9610408 Nabua1008 Wesley Barton M 27 9801864 Nasigatoka1009 Victor Mason M 50 9855386 Nukutubu1010 Ellis Cobb M 24 9389406 Narocivo1011 Diana Ross F 27 9940148 Vunuku1012 Amanda Carter F 43...

  • Hi, can you help me with Part E? Please use Java language. So for this Part,...

    Hi, can you help me with Part E? Please use Java language. So for this Part, you will be given 3 files of starter code that is already done for you. All you have to do is to add on to it in order to produce the exact output shown in the pictures below. Please only add on to the code, but not change any of them. Out of the 3 given files, 1 of them is already completed. The...

  • The Excel file Payroll Data provides hourly salaries for a group of employees. Create an Excel...

    The Excel file Payroll Data provides hourly salaries for a group of employees. Create an Excel template that allows the user to select an employee by employee ID, enter the number of regular hours and overtime hours worked, and display a payroll summary with the employee name, gross pay, federal tax, state tax, Social Security, Medicare withholding deductions, and net pay. Assume that the federal tax rate is 11%, the state tax rate is 2.385%, Social Security withholding is 6.2%,...

  • 0 X 1.TX T 1 .III .2. 3 .III.4. III .5. III .6. II . ,...

    0 X 1.TX T 1 .III .2. 3 .III.4. III .5. III .6. II . , 7 . i. Resistors for electronic circuits are manufactured on a high-speed automated machine. The machine is set up to produce a large run of resistors of 1,000 ohms each. Use Exhibit 10.13 To set up the machine and to create a control chart to be used throughout the run, 15 samples were taken with four resistors in each sample. The complete list of...

  • On October 1, 2019, Helen Kennedy opened an advertising agency. DATE TRANSACTIONS Oct. 1 Helen Kennedy...

    On October 1, 2019, Helen Kennedy opened an advertising agency. DATE TRANSACTIONS Oct. 1 Helen Kennedy invested $55,000 cash in the business. 2 Paid October office rent of $2,750; issued Check 1001. 5 Purchased desks and other office furniture for $14,500 from Office Furniture Mart, Inc.; received Invoice 6704 payable in 60 days. 6 Issued Check 1002 for $2,950 to purchase art equipment. 7 Purchased supplies for $1,300; paid with Check 1003. 10 Issued Check 1004 for $550 for office...

  • the language i wan used in C# is visual basic.Create a console program that contains the...

    the language i wan used in C# is visual basic.Create a console program that contains the following ·         A Class named Account with the following properties: o   public int Id { get; set; } o   public string Firstname { get; set; } o   public string Lastname { get; set; } o   public double Balance { get; set; } o   public DateTime CreationDate { get; set; } o   Create a constructor that initializes all of the properties. o   Create a ToString...

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
ADVERTISEMENT