Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

9. Accumulator Bcontains a value in the range 10 through 150. Accumulator A cont

ID: 2249051 • Letter: 9

Question

9. Accumulator Bcontains a value in the range 10 through 150. Accumulator A contains the value 0. If the value in accumulator D is considered to be signed, does the value in accumulator D equal the value in accumulator B? 10. A byte value in the range -10 to-1 is added to a byte value in the range 50 to 128. Can the sum be considered to be signed? Can it be considered to be unsigned? through $1023. The value is stored in big-endian order. locations $1000 through S1002 into the three byte unsigned integer value at locations 11. Write a code sequence which will increment the four byte value at location $1020 12. Write a code sequence which will add the three byte unsigned integer value stored in SI100 through SI 102. The values are stored in big-endian order.

Explanation / Answer

Microcontroller is not mentioned in the question, hence its assumed as MC68HC12.

9. D represents concatenated A & B accumulator registers where A is upper significance. Hence 8 bit registers A & B forms 16 bit contents of D register without any consideration to sign.

10. Yes the sum is signed and it is positive number. Yes it can be considered signed. Lets take an example : Any 8 bit number can represent 0 to 255 unsigned number but the same 8 bit number can represent -128 to +127 signed number. Condition Code register and conditional branching instruction helps to deal with signed numbers.

11. LDAA $1023 ; Load least significant byte from address

INCA ; increment by 1

STAA $1023 ; store it to same address

LDAA $1022 ; read next byte

ADCA #0 ; dummy addition to take care of previous carry if generated

STAA $1022

LDAA $1021

ADCA #0

STAA $1021

LDAA $1020

ADCA #0

STAA $1020