Determine if a string contains all lowercase letters

Assignment Help C/C++ Programming
Reference no: EM132604403

Problem Set

Question 1. Each of these problems gives "before" conditions and an instruction. Give the indicated "after" state.

 

Before

Instruction executed

After

(a)

EBX:  FF008E BA

notebx

EBX

 

 

 

 

 

 

 

 

 

 

 

 

(b)

AX:  8E BA

or   ax, 0EDF2h

AX

 

 

 

 

 

 

 

 

SF __

ZF__

 

 

 

 

 

 

 

 

 

 

(c)

AX:  8E BA

xor   ax, 0EDF2h

AX

 

 

 

 

 

 

 

 

SF __

ZF__

 

 

 

 

 

 

 

 

 

 

(d)

AX:  8E BA

and  ax, 0EDF2h

AX

 

 

 

 

 

 

 

 

SF __

ZF__

 

 

(d)

AX:  8E BA

testax, 80h

AX

 

 

 

 

 

 

 

 

SF __

ZF__

 

 

(e)

AX:  8E BA

shl   ax, 4

AX

 

 

 

 

 

 

 

 

CF__

 

 

 

 

 

 

 

 

 

 

 

(f)

AX:  8E BA

sar   ax, 4

AX

 

 

 

 

 

 

 

 

CF__

 

 

 

Question 2. Suppose that value is an unsigned integer in the EAX register. Give instructions to compute(value mod 64), putting the result in the EBX register and leaving EAX unchanged.

Question 3. Starting with the PROC directive and ending with the ENP directive, write an 80x86 procedure that implements the function described by the following C++ function header:
voidarrMix(int arr1[], int arr2[], int arr3[], int count);
// for i=0, 1,...,count-1bits 0-7 and 16-23 of arr3[i] come
// from arr1[i] and bits 8-15 and 24-31 come from arr2[i]
Follow 32-bit cdeclprotocol.

Question 4. Each of these problems gives "before" conditions and one or more instructions. Give the indicated "after" state.

 

Before

Instruction(s) executed

          After

(a)

string1 BYTE "ABCD"

string2 BYTE "GHIJ"

cld

lea  esi, string1

lea  edi, string2

mov  ecx, 3

rep  movsb

 

ESI

 

 

 

 

 

 

 

 

 

 

 

(string1 is at address 00406030 and string2 is
at address 00406034)

EDI

 

 

 

 

 

 

 

 

 

 

 

string1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

string2

 

 

 

 

 

 

 

 

 

 

 

 

(b)

string1 BYTE "BLUE"

string2 BYTE "BEAN"

cld

lea  esi, string1

lea  edi, string2

mov  ecx, 4

repecmpsb

 

ECX

 

 

 

 

 

 

 

 

 

 

 

(string1 is at address 00406030 and string2 is
at address 00406034)

ESI

 

 

 

 

 

 

 

 

 

 

 

EDI

 

 

 

 

 

 

  ZF ___

 

 

 

 

 

 

 

 

 

 

(c)

string BYTE "CSCI"

(string is at address 00406030)

cld

lea   edi, string

mov   al, 'S'

mov   ecx, 4

repnescasb

 

ECX

 

 

 

 

 

 

 

 

 

 

 

EDI

 

 

 

 

 

 

 

 

 

 

 

 

 

  ZF ___

 

 

 

 

 

 

 

 

 

 

 

(d)

source: string at address 004BD000: green

dest: string at address 004BD005: crown

 

lea esi,source

lea edi,dest

cld

movsb

ESI

 

 

 

 

 

 

 

 

 

 

 

EDI

 

 

 

 

 

 

string at dest: _____________

Question 6. Suppose you want to determine if a string contains all lowercase letters. For this purpose you are going to write a procedure allLower. A C++ header for this procedure might look like

int allLower(char str[]);
// precondition: str is a null terminated string
// postcondition:
// returns true (-1) if str contains only lowercase letters
// returns false (0) if str contains any other character

Using32-bit cdeclprotocol, write assembly language code to implement hasLower.

Reference no: EM132604403

Questions Cloud

Test the hypothesis that eating roasted beets : How would you set up a controlled experiment to test the hypothesis that eating roasted beets before an exercise session results
What is the risk class of the customer : The bank offers an annual rate of 15.07% to a customer. What is the risk class of the customer? The bank's pure rate of interest is 2% and the inflation premium
Determine what is the company cost of equity capital : The company's tax rate is 25%. Ortiz's CFO has calculated the company's WACC as 13.2%. What is the company's cost of equity capital?
What price did scotiabank pay on the issue date : What price did Scotiabank pay on the issue date? A 25-year, $10,000 face value strip bond was purchased by Scotiabank on its issue date to yield
Determine if a string contains all lowercase letters : Suppose you want to determine if a string contains all lowercase letters. For this purpose you are going to write a procedure allLower.
Calculate the amount of the asset and liability of sax : The computers have an estimated life of 5 years, a fair value of $300,000, Calculate the amount of the asset and liability of Sax at the inception of the lease
Cornerstone of human resources management : Job analysis has long been considered the cornerstone of human resources management. How do you believe that it supports managers in making pay decisions?
Determine the appropriate time to harvest the entire crop : Grow and become more valuable as their weight increases. Describe how you would determine the appropriate time to harvest the entire crop of shrimp
How should the company treat the cost of the old production : High-End Fashions, Inc. bought a production line,How should the company treat the cost of $500,000 of the old production line in evaluating the rebuilding plan?

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