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)
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?
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
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
2.     Explain each line of the following MIPS assembly language code segment. Write the corresponding C...
2.     Explain each line of the following MIPS assembly language code segment. Write the corresponding C language code and indicate the content of each register with the corresponding variable in C-code. muli $t2, $s1, 4    add $t2, $t4, $t2    lw $t15, 0($t2)    lw $t16, 4($t2)    sw $t16, 0($t2)    sw $t15, 4($t2)
High-level computer languages are created to be understood by humans. As a result, the keywords and...
High-level computer languages are created to be understood by humans. As a result, the keywords and the commands of these languages are easy to understand. Machine languages are harder to understand and operate. For this assignment, you should assume that the memory cells at addresses F0 to F9 are in the machine described here: Op-Code Operand Description 1 RXY LOAD the register R with the bit pattern found in the memory cell whose address is XY 2 RXY LOAD the...
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 =...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT