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 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

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: 3

blur-text-image

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

Knowledge Discovery In Databases

Authors: Gregory Piatetsky-Shapiro, William Frawley

1st Edition

0262660709, 978-0262660709

More Books

Students also viewed these Databases questions