Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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 InitialSCA Result SCA SF1 SCA TFR X, Y Initial SF003 $78CD Result SF0o3 SFO03 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 Initial $7F Result S7Fs SF8CD S007F $85 $85 50167 SFF85 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 InitialSCA Result SCA SF1 SCA TFR X, Y Initial SF003 $78CD Result SF0o3 SFO03 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 Initial $7F Result S7Fs SF8CD S007F $85 $85 50167 SFF85 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions