Question: 1. Write the needed assembly instructions to reverse the bytes of a 4-byte integer value that is stored at $1000. For example, reversing $20CAFF31 should

 1. Write the needed assembly instructions to reverse the bytes of

1. Write the needed assembly instructions to reverse the bytes of a 4-byte integer value that is stored at $1000. For example, reversing $20CAFF31 should be $31FFCA20. 2. Write the needed assembly code which defines a 32-bit signed integer variable and set its initial value to -3. The TFR transfer instruction copies the contents of one register to another register. The CPU12 has A, B, and CCR as 8-bit registers. X, Y, SP, and D (which is A:B) are 16-bit registers. If the two registers used in TFR instruction have same size, then the copy would work as expected. For example: TFR A, B Initial $CA Result $CA SF1 SCA TFR X, Y Initial Result SF003 $78CD $F003 But if we transfer 8-bit register into 16-bit register, then the 8-bit value is sign extended during the transfer. For example, TFR A, Y SF8CD $007F $85 $85 $0167 $FF85 $7F Initial Result $7F Based on this information, answer the following 2 questions 3. A signed byte variable is stored at memory location COUNT. Write the needed instructions to copy its value into the signed 32-bit variable which is stored at memory location TOTAL. 4. Repeat (3) if both COUNT and TOTAL are unsigned integer variables. 1. Write the needed assembly instructions to reverse the bytes of a 4-byte integer value that is stored at $1000. For example, reversing $20CAFF31 should be $31FFCA20. 2. Write the needed assembly code which defines a 32-bit signed integer variable and set its initial value to -3. The TFR transfer instruction copies the contents of one register to another register. The CPU12 has A, B, and CCR as 8-bit registers. X, Y, SP, and D (which is A:B) are 16-bit registers. If the two registers used in TFR instruction have same size, then the copy would work as expected. For example: TFR A, B Initial $CA Result $CA SF1 SCA TFR X, Y Initial Result SF003 $78CD $F003 But if we transfer 8-bit register into 16-bit register, then the 8-bit value is sign extended during the transfer. For example, TFR A, Y SF8CD $007F $85 $85 $0167 $FF85 $7F Initial Result $7F Based on this information, answer the following 2 questions 3. A signed byte variable is stored at memory location COUNT. Write the needed instructions to copy its value into the signed 32-bit variable which is stored at memory location TOTAL. 4. Repeat (3) if both COUNT and TOTAL are unsigned integer variables

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!