- 8051

8051 ALP to generate look up table for first 10 odd numbers

Have a look at my older program on how to find an odd number…

ORG 000h
MOV R0,#0Ah              ; you can change this value to N numbers
MOV R1,#00h               ;operand
MOV DPTR,#0Ah         ;memory adress

loop: INC R1
         MOV A,R1
         RRC A
         JC odd
         DJNZ R0,loop
         SJMP end

odd:  MOVX R1,@DPTR      ;saving the number to the memory address
          INC DPTR                   ; incrementing the pointer
          DJNZ R0,loop

end: NOP

END

 

Leave a Reply