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

the flags C,Z. N, V? Liatus of 18. A byte of memory contains 33H. What does this

ID: 2266219 • Letter: T

Question

the flags C,Z. N, V? Liatus of 18. A byte of memory contains 33H. What does this represent does it represent in decimal if the data is an unsigned ASCII- if the data is ASCII? What number? unsigned number- Another byte of memory contains FOH. What does this represent in an unsigned number? What if it is a signed number? unsigned number- decimal if the data is signed number- 19. Find the contents of register A after the execution of each set of instr are independent of each other. (a) LDD #244 LDX #10 IDIV ORAA #40 A= (b) LDD #S84 EMUL 20. HCS12 has data bus and the register sizes are as follows: PC- 21. This is how the code looks in CodeWarrior. Look at the instruction at 4006. What is the opcode, and what is the operand (in hex)? 4000 CE4000 4003 8614 4005 C7 4006 CBO5 4008 43 4009 26FB LDS #0x4000 LDAA #0x14 CLRB ADDB #0x5 DECA BNE OxFEFEFEED STAB 0x1225 abs 0x4006 400B 7B1225 22. What is the target address of the conditional branch instruction above? (show work)

Explanation / Answer

Answer:-18) 33H means 0x33 i.e in hex. It's ASCII equivalent is number " 3 ", we can find it from ASCII table.

We can write 0x33 in binary as 0b0011_0011, hence in decimal it is 51 for unsigned number. Also in case of signed number it will be 51 only since MSB is 0.

F0H means 0xF0 = 0b1111_0000, so in unsigned number it is 27 + 26 + 25 + 24 = 240.

For signed number it is a negative number since MSB is 1 and its magnitude is  26 + 25 + 24 = 112, so -112 is the value for signed number.

Answer:-19) LDD #244 ; register D = 0xF4, so register A = 0x00, B = 0xF4

LDX #10 ; register X = 0x000A i.e decimal value of 10

IDIV ;divide D by X, result in X and remainder in D, so 244/10, X = 24 = 0x0018 and D = 4= 0x0004, A = 0x00, B = 0x04

ORAA #40 ; 40 = 0b0010_1000, bit wise OR this with A = 0x00 so A = 40 now or in hex, 0x28.

So A = 0x28 is the answer.

Answer:-20) HCS12 has 16-bit data bus and register sizes are-

A = 8-bit register

X = 16-bit register

SP = 16-bit register

PC = 16-bit register

Answer:-21) For HCS12 machine code CB05, the MSB 8-bit is opcode and rest is immediate data. So opcode is 0xCB and data is 0x05. 0xCB is the opcode for instruction ADDB with immediate value.