In this program we will see how to generate table of an integer.
Write 8085 Assembly language program to generate a table of input integer. The number is stored at F050, and the table will be stored at F051 onwards.
Table generation is basically the multiplication table creation. We are taking the number and storing it to B. And initialize the counter as 0A (10 in decimal). In each step we are adding B with A and store value of A into memory, and decrease the counter by 1. These steps will repeat until the counter become 0.
|F000||21, 50 F0|| ||LXI H,F050H||memory location where number is stored|
|F003||46|| ||MOV B,M||the number from memory pointed by HL pair|
|F004||0E, 0A|| ||MVI C,0AH||Initialize counter as 0AH|
|F006||AF|| ||XRA A||Clear Acc|
|F007||80||LOOP||ADD B||Acc = Acc + B|
|F008||23|| ||INX H||Point to next location|
|F009||77|| ||MOV M,A||Store A into memory|
|F00A||0D|| ||DCR C||Decrease C by 1|
|F00B||C2, 07, F0|| ||JNZ LOOP||If Z is not 1, jump to LOOP|
|F00E||76|| ||HLT||Terminate the program|