Question

Use 25 to 50 words to discuss one of the Shift, Rotate, Multiplication, Division Instructions and...

Use 25 to 50 words to discuss one of the Shift, Rotate, Multiplication, Division Instructions and give a simple example of the .asm complete program code that you have compiled. Just keep the code simple with not much program description. Put your code in a program and make sure it compiles then copy it.  Do some research, using articles other than your textbook would be great also.

Homework Answers

Answer #1

Shift Instructions:

In Assembly Language there are 5 shift instructions, these instructions are used to move the bits in a register left or right by a specified number of bits, called shift length.

Register shift can be performed:

Directly by the instructions ASR, LSR, LSL, ROR, and RRX, and the result is written to a destination register.

During the calculation of Operand2 by the instructions that specify the second operand as a register with shift. The result is used by the instruction.

Arithmetic shift right (ASR)

Arithmetic shift right by m bits moves the left-hand 32-m bits of a register to the right by n places, into the right-hand 32-m bits of the result.

Logical shift right (LSR)

Logical shift right by m bits moves the left-hand 32-m bits of a register to the right by m places, into the right-hand 32-m bits of the result. It sets the left-hand n bits of the result to 0.

Logical shift left (LSL)

Logical shift left by m bits moves the right-hand 32-m bits of a register to the left by m places, into the left-hand 32-m bits of the result. It sets the right-hand m bits of the result to 0.

Rotate right (ROR)

Rotate right by m bits moves the left-hand 32-m bits of a register to the right by m places, into the right-hand 32-m bits of the result. It also moves the right-hand m bits of the register into the left-hand m bits of the result.

Rotate right with extend (RRX)

Rotate right with extend moves the bits of a register to the right by one bit. It copies the carry flag into bit[31] of the result.

MULTIPLICATION INSTRUCTION:

In Assembly Language MUL(Unsigned multiplication) & IMUL(Signed multiplication) instructions are used to multiply two 8-,16-,32-bit registers.

Eg:

.DATA

A DW 0FF87H

B DW 0FF84H

C DW ?

.CODE

START:

MOV AX,@DATA

MOV DS,AX

MOV SI,0000H

MOV AX,A

MOV CX,B

MUL CX ; IMUL for signed multiplication

INT 03H

END START

DIVISION INSTRUCTION:

In Assembly Language DIV(Unsigned division) & IDIV(Signed division) instructions are used to divide two 8-,16-,32-bit registers.

Eg:

.DATA

A DW 0FF87H

B DW 0FF84H

C DW ?

.CODE

START:

MOV AX,@DATA

MOV DS,AX

MOV SI,0000H

MOV AX,A

MOV CX,B

DIV CX ;IDIV for signed division

INT 03H

END START

Know the answer?
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
Similar Questions
1. Read the following instructions on 'How to Repair an Electric Fan' which are written in...
1. Read the following instructions on 'How to Repair an Electric Fan' which are written in three different parts before answering the question given. The instructions below are considered ineffective as they are not following the effective instructions strategy. 1 Turn your fan on to make sure that the motor works. Plug your fan in and turn it on to the highest power setting. If the fan blades move a little or it starts to turn, the motor is probably...
As you saw from the lab PowerPoint slides last week, you will be doing a research...
As you saw from the lab PowerPoint slides last week, you will be doing a research study looking at ‘Aggression Priming” for your first paper. For this week’s discussion, I want you to discuss with your group what you think this study is about. What is the hypothesis? What theory does it come from? What do you predict will happen (do you expect something different than the hypothesis in the researcher instructions? If so, what and why?)? Do you think...
In 100 words state if you agree or disagree with the summary given for the Scenario....
In 100 words state if you agree or disagree with the summary given for the Scenario. PLEASE reframe from using Overuse of ambiguous terms such as it, this, and they should not be used. Scenario Part 1: Workplace unrest Environment: You are the Director of a team of employees that do various PA duties. The team consists of 15 employees that are assigned duties in different building locations and collocated with other PA personnel from other directorates in a matrix...
You will write a program that loops until the user selects 0 to exit. In the...
You will write a program that loops until the user selects 0 to exit. In the loop the user interactively selects a menu choice to compress or decompress a file. There are three menu options: Option 0: allows the user to exit the program. Option 1: allows the user to compress the specified input file and store the result in an output file. Option 2: allows the user to decompress the specified input file and store the result in an...
Case 13 ✍ It Was Really So Simple Background Information Brenda Galway leaned back in her...
Case 13 ✍ It Was Really So Simple Background Information Brenda Galway leaned back in her chair, sighed heavily, and slowly rubbed her eyes in big circular motions. “I don’t need all this aggravation,” she thought to herself. She had just finished reviewing the report she had requested from her new employee, Bill Stanley. The entire report was incorrect and would have to be redone. Brenda supervised Unit B of the Audit Department. The Unit B team had earned the...
Team 5 answer the questions What are 4 key things you learned about the topic from...
Team 5 answer the questions What are 4 key things you learned about the topic from reading their paper? How does the topic relate to you and your current or past job? Critique the paper in terms of the organization and quality. Incentive Systems             In this paper, we will focus primarily on financial rewards that companies use to attract, retain and motivate the brightest and most talented candidates in the labor market. By providing a reward system that...
Discuss ethical issues that can be identified in this case and the mode of managing ethics...
Discuss ethical issues that can be identified in this case and the mode of managing ethics Enron finds itself in this case. How would you describe the ethical culture and levels of trust at Enron? Provide reasons for your assessment. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among...
Discuss how the respective organizations’ relations with stakeholders could have potentially been affected by the events...
Discuss how the respective organizations’ relations with stakeholders could have potentially been affected by the events that took place at Enron and how the situation could have been dealt with differently to prevent further damage? THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among the top Fortune 500 companies,...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From the April 2004 Issue Save Share 8.95 In 1991, Progressive Insurance, an automobile insurer based in Mayfield Village, Ohio, had approximately $1.3 billion in sales. By 2002, that figure had grown to $9.5 billion. What fashionable strategies did Progressive employ to achieve sevenfold growth in just over a decade? Was it positioned in a high-growth industry? Hardly. Auto insurance is a mature, 100-year-old industry...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...