/* Calculate A^2 where A is an 8-bit unsigned variable. * The result is placed into 16-bit variable C. * The 24-bit result is saved using little endian byte ordering. * C = A^2 */ .INCLUDE .DSEG A: .BYTE 1 C: .BYTE 2 .CSEG A_Squared: lds r26,A ; load mul r26,r26 sts C,r0 ; store least significant byte (little end) sts C+1,r1 ; store most significant byte (big end) rjmp A_Squared