1. Consider the following NASM code fragment; mov al, 0 cmp al, al je next Write...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Consider the following NASM code fragment; mov al, 0 cmp al, al je next Write an equivalent program consisting of a single instruction. 2. Consider the following C program: /* a simple C program to average 3 integers */ Main () { int avg: (10 marks) 2. Consider the following C program: /* a simple C program to average 3 integers */ Main () L1: { int avg; L2: L3: int i1 =20; } Write an NASM version of this program (10 marks) 3. In the following program, assume that a, b, x, y are symbols for the main memory locations. What does the following program do? (10 marks) mov eax, a mov ebx, b xor xor int i2 = 13; int i3 = 82; avg = (11 + 12 +13)/3; or jnz eax, x ebx, y eax, ebx L2 Jmp L3 ; sequence of instructions....... ; another sequence of instructions ..... L1: L2: L3: Jmp L3 ; sequence of instructions ........ ; another sequence of instructions..... 4. Give five reasons why it is worthwhile to study assembly language programming. (5 marks) 5. Give some disadvantages of assembly language compared to high level languages. (5 marks) "END" 1. Consider the following NASM code fragment; mov al, 0 cmp al, al je next Write an equivalent program consisting of a single instruction. 2. Consider the following C program: /* a simple C program to average 3 integers */ Main () { int avg: (10 marks) 2. Consider the following C program: /* a simple C program to average 3 integers */ Main () L1: { int avg; L2: L3: int i1 =20; } Write an NASM version of this program (10 marks) 3. In the following program, assume that a, b, x, y are symbols for the main memory locations. What does the following program do? (10 marks) mov eax, a mov ebx, b xor xor int i2 = 13; int i3 = 82; avg = (11 + 12 +13)/3; or jnz eax, x ebx, y eax, ebx L2 Jmp L3 ; sequence of instructions....... ; another sequence of instructions ..... L1: L2: L3: Jmp L3 ; sequence of instructions ........ ; another sequence of instructions..... 4. Give five reasons why it is worthwhile to study assembly language programming. (5 marks) 5. Give some disadvantages of assembly language compared to high level languages. (5 marks) "END"
Expert Answer:
Answer rating: 100% (QA)
1 An equivalent program consisting of a single instruction would be CMP al 0 Compare al with 0 2 The NASM version of this program is as follows mov ax... View the full answer
Related Book For
Excellence in Business Communication
ISBN: 978-0136103769
9th edition
Authors: John V. Thill, Courtland L. Bovee
Posted Date:
Students also viewed these programming questions
-
you will write a simply assembly level language program that performs few arithmetic programme
-
A $1,000 corporate bond has an asked price of 97,82 and a bid price of 97.81. What price will you receive if you sell this bond now? O a. $978.15 O b. $1000 OC. $978.20 O d. $978.10
-
Write an assembly language program that displays the dollar sign ($) 10 times on the first line and 5 times on the second line. SAMPLE: section .text global_start ;must be declared for linker (gcc)...
-
Explain how an antibody is able to recognize a specific antigen. (Include an explanation of an epitope in your answer.)
-
U.S. manufacturers want to bring a suit against Japanese manufacturers, alleging a conspiracy to take over the U.S. automobile industry by exporting low-priced products to the United States while...
-
Someday you probably will face a choice among job offers. Aside from the nature of the job itself, two attributes that are important for many people are salary and location. Some people prefer large...
-
The following information is from the June 30, 20x7, post-closing trial balance of Kissell Hardware Corporation. Required 1. From the information provided, prepare a classified balance sheet for...
-
Fieval Leasing Company signs an agreement on January 1, 2010, to lease equipment to Reid Company. The following information relates to this agreement. 1. The term of the non-cancelable lease is 6...
-
What is the significance of investment analysis in the capital budgeting process?
-
This project will test your understanding of the Sage 50 Accounting application and your ability to apply the features of this application. You will be using many of the skills that you have acquired...
-
Lululemon is considering a new project that improves inventory management for the next 5 years. The project has similar risks as the overall firm. The new technology will require an investment in...
-
Miss Fortune is expecting to receive a bonus in 5 months time and has decided to use her money to buy Aztec shares. At present the shares are worth R57.50 but Miss Fortune is worried that the share...
-
The Personnel Department at Hernandez Bros. is centralized and provides services to the two operating units: Miami and New York. The Miami unit is the original unit of the company and is well...
-
136 students at a college were asked whether they had completed their required English 101 course, and 82 students said "yes". Construct the 99% confidence interval for the proportion of students at...
-
Write an algorithm and a C++ program that asks the user to enter a store's sales for each day of the week. The amounts should be stored in an array. Use a loop to calculate the total sales for the...
-
Theoretical Probabilities . What is the theoretical probability of an unfavorable outcome? P(x 1) % (Round to the nearest percent.) (fraction) =
-
Which graph is sketched to the right A g x x 1 x 2 x 3 B g x x 1 x 2 x 3 C g x x 1 x 2 x 3 6 4 2 6 1 4 2 0 2
-
Assessing simultaneous changes in CVP relationships Braun Corporation sells hammocks; variable costs are $75 each, and the hammocks are sold for $125 each. Braun incurs $240,000 of fixed operating...
-
Why do the AIDA model and similar approaches need to be modified when writing persuasive messages in social media?
-
Rewrite each sentence so that the verbs are no longer camouflaged: a. Adaptation to the new rules was performed easily by the employees. b. The assessor will make a determination of the tax due. c....
-
Marketing specialists usually celebrate when target audiences forward their messages to friends and family-essentially acting as unpaid advertising and sales representatives. In fact, the practice of...
-
The present amount that is equivalent to an amount at a future time. True/false
-
Mendoza Corporation secured authorization from the state for 100,000 shares of $10 par value common stock. It has 80,000 shares issued and 70,000 shares outstanding. On June 5, the board of directors...
-
Rath School Supply Corporation was organized in 20xx. It was authorized to issue 200,000 shares of no-par common stock with a stated value of $5 per share, and 40,000 shares of $100 par value, 6...
Nature As Teacher New Principles In The Working Of Nature 1st Edition - ISBN: 1858600561 - Free Book
Study smarter with the SolutionInn App