Can someone please explain why on the left the sum is 152, and on the right the
ID: 3843932 • Letter: C
Question
Can someone please explain why on the left the sum is 152, and on the right the sum is 98. I Know forsure it has something to do with the Carry, Overflow, Negative, and Zero registers not being addressed on the left but im having trouble proving it.
ldaa 4925 Load $25 to reg A add a 4634 Add $34 to A adda #$11 Add $11 to A add a +18 Add $12 to A adda 4300011100 Add $1C to A Store total in 'sum' ME 10001 Staa Sun. here jmp here tay here forever to end program End Program Lab 1------------- Data main. dbg 152 unsigned char 3un. 0 unsigned char temp 0 unsigned char pming 0 unsigned char templ bas array [2] of unsigned char array [4] of unsigned char dnum E buff array[12] of unsigned char e Termina Auto 2000 LDS 48192 2003 LDAA #37 2005 ADDA +52 2007 ADDA 417 2009 ADDA +18 2008 ADDA +28 200D STAA. 0x1000 2010 JMP 0x2010 Register HC12 CPU Cycles: 10 D 98CB A 98 B IX Y CBCB Le X IP 2010 PC 2010 PPAGE SP 2000 CCR SXHIN VC Symb Global Procedure here 0000 Memory Auto 000FE8 uu uu uu uu uu uu uu uu uuuuuuuu. 000 FF uu uu uu uu uu uu uu uu uuuuuuuu. 000FF uu uu uu uu uu uu uu uu uuuuuuuu. 001000 98 uu uu uu uu uu uu uu .uuuuuuu. 001008 uu uu uu uu uu uu uu uu AuExplanation / Answer
Answer for Question:
As i observed that Right hand sum is 152 and Left hand side sum is 98
But in question it was telling that Right Side 98 and Left side is 152
As my first line assumption Right hand side is 152 is correct and 98 is left side is also correct.
See the below explanation for Left hand side:
Step 1 :
Loads the 25 to Reg A
Step 2:
Adds 34 to 25 in Reg A sum is 59
Step 3:
Adds 11 to 59 in Reg A sum is 70
Step 4:
Sum value 70 will store in Address location 18 Here Reg A will not add the 18 to Reg A
So Still Sum is 98
Step 5:
Add Binary form of 28 to Reg A 70 and Sum is 98
Finally Sum is stored in location 1000