main: MOV R7,#0AH ; Move 10 (A in hex) into R7 MOV R6,#00H ; load register 6 with the value in the accumulator loop: MOV A,R7 ; Move R7 into the accumulator ADD A,R6 ; Add the value in the accumulator to R6 and store it in the accumulator MOV R6,A ; Move the value in the accumulator into R6 DJNZ R7,loop ; Decrement R7 AND go back to 'loop' if R7 is zero END ; This tells the assembler it is done