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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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