/* Write a program to find the sum of 8 bit variables A and B. * For this programming problem the sum may be greater than 255 if A and B * are unsigned or less than -128 and greater than 127 if signed. * Store the sum into 16 bit variable C using little endian byte ordering. * C = A + B */ .INCLUDE .DSEG A: .BYTE 1 B: .BYTE 1 C: .BYTE 2 .CSEG Adder816: ; load clr r1 ; r1:r0 = 0:A lds r0,A clr r3 ; r3:r2 = 0:B lds r2,B ; add add r0,r2 ; add least significant bytes adc r1,r3 ; add with carry most significant bytes ; store sts C,r0 ; store least significant byte first sts C+1,r1 rjmp Adder816