; MULTIPLY BY TEN ROUTINE. ; IN THE ORIGINAL PROGRAM, DATA IS OVERWRITTEN WITH THE VALUES TIMES 10. ; I HAVE CHANGED THE PROGRAM SO THAT THE MULTIPLIED VALUES ARE STORED IN MULT10 INSTEAD. ; YOU WILL SEE A FEW NEW LINES OF CODE ADDED THAT ARE COMMENTED WITH "ADDED FOR TESTING PURPOSES". ; .ORG 0000h LD HL, DATA ; TABLE OF DATA. LD IX, MULT10 ; ADDED FOR TESTING PURPOSES. LD B, 5 ; FOR 5 VALUES. LOOP: LD A, (HL) ; GET VALUE. SLA A ; VALUE X 2. LD C, A ; SAVE VALUE X 2. SLA A ; VALUE X 4. SLA A ; VALUE X 8. ADD A, C ; VALUE X 10. LD (IX +0), A ; ADDED FOR TESTING PURPOSES. INC IX ; ADDED FOR TESTING PURPOSES. INC HL ; POINT TO NEXT VALUE. DJNZ LOOP ; CONTINUE. ;LOOP1: JP LOOP1 ; LOOP HERE IF DONE. HALT DATA: DEFB 1 ; 01h. DEFB 3 ; 03h. DEFB 10 ; 0Ah. DEFB 15 ; 0Fh. DEFB 20 ; 1Eh. MULT10: DEFB 0 ; BECOMES 0Ah. DEFB 0 ; BECOMES 1Eh. DEFB 0 ; BECOMES 64h. DEFB 0 ; BECOMES 96h. DEFB 0 ; BECOMES C8h. .END