Question

Write out the result of separately performing each of the two assembly commands: complement and negate...

Write out the result of separately performing each of the two assembly commands: complement and negate on the following register values.

a.0x2a

b.0x7d

Homework Answers

Answer #1

Ans) complement instruction per forms one's complement and negate instruction performs 2's complement i.e one's complement+1

========

a) 0x2a =0x0010 1010

result after complement instruction is(complement each bit )i.e 0x 1101 0101=0xd5

result is 0xd5

====

result after negate instruction is (2's complement i.e 1's complement+1)

i.e 0x 1101 0101(calculated above ) +1=0x1101 0110=0xd6

result is 0xd6

===============

b)

a) 0x7d =0x0111 1101

result after complement instruction is(complement each bit )i.e 0x 1000 0010=0x82

result is 0x82

====

result after negate instruction is (2's complement i.e 1's complement+1)

i.e 0x 1000 0010(calculated above ) +1=0x1000 0011=0x83

result is 0x83

==============

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
Write a program that finds the largest number among two numbers and store the result in...
Write a program that finds the largest number among two numbers and store the result in any register. Value1: 0x18345678 (hexidecimal) Value2: 0x15678245 (hexidecimal) (Code in ARM assembly language, Using Keil software)
Please write out the appropriate PowerShell commands for each step 1.Run a cmdlet to display the...
Please write out the appropriate PowerShell commands for each step 1.Run a cmdlet to display the PowerShell version. 2. Run the cmdlet to display the words “Hello World!” on the screen on the same line. (*Hint: think about how you could have done this in Command Prompt, it is similar for PowerShell. If you need more help, think about Aliases). 3. Update the Help System
A and B are two 8-bit 2’s complement numbers. The result of A & B is...
A and B are two 8-bit 2’s complement numbers. The result of A & B is 10011000 and the result of A ^ B is 00100110. (a) What is the sum A + B expressed in 8-bit two’s complement notation (use 1s and 0s, e.g. 10100101)? Will the carry flag be set? Will the overflow flag be set?
Write the C55x assembly code for each of the following C snippet code shown below. Assume...
Write the C55x assembly code for each of the following C snippet code shown below. Assume the 8-bit values a, b, c, and d are stored in locations 0x600, 0x601, 0x602, and 0x603 respectively in the memory. Store the result x in location 0x604 and y in location 0x60C. Do not use software to generate the assembly code and comment your code. x = (a - b)3 - (c*d); for (j=0;j<=200;j++)   y = y + (a * b);
Write a program in ARM assembly language that copies each element of array A to consecutive...
Write a program in ARM assembly language that copies each element of array A to consecutive fourth elements of array B, i.e., A[0] to B[0], A[1] to B[3], A[2] to B[7], etc. The array A is 12 elements long, and each element is a number that is 32 bits (1 word) wide. Assume the base address of array A is in register R2, and the base address of array B is in R3.
EMBEDDED: Write a program in ARM assembly language that copies each element of array A to...
EMBEDDED: Write a program in ARM assembly language that copies each element of array A to consecutive fourth elements of array B, i.e., A[0] to B[0], A[1] to B[3], A[2] to B[7], etc. The array A is 12 elements long, and each element is a number that is 32 bits (1 word) wide. Assume the base address of array A is in register R2, and the base address of array B is in R3.
Write a possible assembly language instruction or set of instructions to accomplish the following: Compare the...
Write a possible assembly language instruction or set of instructions to accomplish the following: Compare the byte stored at the memory location pointed to by register R4 to the upper (higher) byte stored in register R5 b) Branch to instruction at label ‘ZERO’ if the lower byte of register R6 is zero c) Jump to the instruction at label ‘EVEN’ if the value in register R7 is an even number
Write a program that does the following and prints out the result          Use a do-while...
Write a program that does the following and prints out the result          Use a do-while loop and switch statement          Enter value x and a case number n          for n = 0 exit else continue          n=100 result = x * 9          n=102 result = x + 10 and continue          n=103 result = (x + 10) * x          n=104 and 106 result = x / x default    result = 99; test with x =...
A personal computer manufacturer is interested in comparing assembly times for two keyboard assembly processes. Assembly...
A personal computer manufacturer is interested in comparing assembly times for two keyboard assembly processes. Assembly times can vary considerably from worker to worker, and the company decides to eliminate this effect by selecting a random sample of 10 workers and timing each worker on each assembly process. Half of the workers are chosen at random to use Process 1 first, and the rest use Process 2 first. For each worker and each process, the assembly time (in minutes) is...
In Assembly x86 please Write an assembly program(call it lab6_file1.asm)that contains 10 double words in memory...
In Assembly x86 please Write an assembly program(call it lab6_file1.asm)that contains 10 double words in memory in the .data section where the first five initialized to 0 and the last five are initialized to 1. In addition, reserve ten uninitialized double words in .bss section. Using a loop, write an assembly program that copies the ten initialized values into the ten reserved double words, starting at the last position, moving to the first(reverse order the data in your uninitialized array)....