Describe a macro and how many bytes of object code are used

Assignment Help C/C++ Programming
Reference no: EM132577500 , Length: 3 pages

Question 1. Provide brief descriptions of the following directives.

(a) .586

(b) .MODEL FLAT

(c) .DATA

(d) .CODE

Question 2. Briefly describe a macro.

Question 3. For each of the four operands below, identify its mode as the correct choice of immediate, register, direct, or register indirect. Assume that the program contains the directive result DWORD ?

(a) mov DWORD Ptr [ebx], 100

(b) mov result, ebx

Question 4. Find the initial values that the assembler will generate for each directive below. Write your answers using two hex digits for each byte generated.

(a) byteA BYTE 0ah

(b) byteBBYTE "xyz", 0

(c) dwordC DWORD 101011h, 101011b

(d) dwordD DWORD3 DUP (101011)

(e) quadEQWORD -1

Question 5. Suppose that the EDX register contains FF FF F6 E5 and that the data segment of a windows32program contains

areaLbl BYTE "Area ="
area BYTE 11 DUP (?), 0dh, 0ah, 0

(a) Assuming that the statement dtoa area, edx is executed, show (in hex) what will be in the 20memory bytes starting at areaLbl.

(b) Assuming that the dtoa statement in part (a) is followed by the statement
output areaLbl
show what will be displayed. Show white space (spaces and newlines) clearly.

Question 6. Below is a listing file from which some items (marked a, b and c) have been edited out. Add the missing items, and answer the questions following the listing file.

; Program to add three numbers
.586
.MODEL FLAT
.STACK 4096 ; reserve 4096-byte stack

00000000 .DATA ; reserve storage for data
00000000 00000055 number1 DWORD 85
00000004 FFFFFFD1 number2 DWORD -47

00000008 ________ number3 DWORD 91

________ 00000000 sum DWORD ?

00000000 .CODE ; start of main pgm code
00000000 main PROC

00000000 A1 00000000 R mov eax, number1 ; first number to EAX

¬¬¬¬¬¬¬¬________ 03 05 00000004 R add eax, number2 ; add second number
0000000B 03 05 00000008 R add eax, number3 ; add third number
00000011 A3 0000000C R mov sum, eax ; sum to memory

00000016 B8 00000000 mov eax, 0 ; exit w/ return code 0
0000001B C3 ret
0000001C main ENDP

END ; end of source code

(d) What is the opcode for the instructionadd eax, number3?

(e) What is the object code for the instructionadd eax, number3?

(f) "R" in the listing file stands for "relocatable." Explain what this means.

(g) Identify three directives in the program.

(h) How many bytes of object code are used by the entire program? (answer in decimal)

Question 7. Starting with the window32 project, modify the example program given in section 3.5 of our text (Detmer) to prompt for 3 numbers, calculate the sum, and output the result. Include your entire source code. If possible show a screen shot of your output.

Attachment:- Problem Set.rar

Reference no: EM132577500

Questions Cloud

Did regulation help prevent the full extent of damage : Discuss an ethical failure in the financial services industry. Did regulation help prevent the full extent of damage? Did regulation result from the actions?
Essay Topic - Assess African Americans Gains and Losses : Essay Topic - Assess African Americans Gains and Losses. How would you assess African Americans' gains and losses during the Revolutionary era
What is meant by the term consumer attitudes : What is meant by the term "consumer attitudes"? Why do you think attitudes play such an important role in consumer behavior? Discuss with an example.
What would be learned from statistics derived from metric : What can each metric demonstrate? What is its importance to HRM and strategic decision-making? What would be learned from statistics derived from this metric?
Describe a macro and how many bytes of object code are used : Briefly describe a macro and How many bytes of object code are used by the entire program - What is the object code for the instructionadd eax
What are the operating cash flows in each year : Johnny's Lunches is considering purchasing a new, energy-efficient grill. The grill will cost $42,000 and will be depreciated straight-line
Information governance for mobile devices : We learn from our readings that the use of mobile devices in our society today has indeed become ubiquitous.
Describe the impact of gri standards on international trade : Compare the environmental and product safety protections taken by Etsy, Inc. in other companies. Describe impact of the GRI standards on international
Calculate the value of the merged entity : Firms A and B intend to merge and Firm A has calculated the NPV of the merger to be $2 million after paying $8 million for Firm B.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Different types of loans

Dwayne runs a money lending business in which he offers different types of loans, such as personal loan, car loan, and home loan, on high rate of interest to those individuals who cannot get a loan from the commercial banks. As part of his busines..

  By a minimal interpretation that makes a formula

By a minimal interpretation that makes a formula true, we mean that if one atom is removed from the interpretation then the resulting interpretation does no longer make the formula true.

  Write a program that will read in 12 integer values

Write a program that will read in 12 integer values into a 3 times 4 two-dimensional array (i.e., an array of 3 arrays of 4 integers).

  What are the basic modules of a c program called

What are the basic modules of a C program called? What is a syntax error? Give an example of one from English and one from C. What is a semantic error? Give an example of one from English and one from C.

  Describe the feature of object-oriented programming

Identify at least two (2) advantages to using OOP as compared to using only PP.Describe at least one (1) feature of object-oriented programming.

  Implement the bisection method for solving given equations

Implement the Bisection Method for solving equations. Use the following function: double root(double (*pf)(double x), double a, double b, int n).

  Design an employee class that has fields for name

Design an Employee class that has fields for the following pieces of information: Employee Name and Employee Number

  The two major modifications are the instruction of pointers

the two major modifications are the instruction of pointers and the calculation of mortgage interest rates.requirements

  Write a program to read in two arbitrary boolean expressions

Write a program in your favorite programming language to read in two arbitrary Boolean expressions and see if they represent the same function.

  Write a cpp program to declare two integer

Write a C++ program to declare two integer , one float variables and assign 10, 15, and 12.6 to them respectively. It then prints these values on the screen.

  Estimate the price adjusted for inflation

It is difficult to make a budget that spans several years, because prices are not stable. If your company needs 200 pencils per year.

  Write a header for the function named subtract

Write a header for the function named subtract. Subtract returns nothing and has one double parameter named num.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd