title: How to seed to generate random numbers?
body: <p>It does not generate the intended randomness.</p>
  
  <p>I thought starting with a seed like $66 and xoring the two last lower bit and ror would give me the next random number and so on but it only shows $B3 and does not change at all.</p>
  
  <p>How am I meant to feed? The line above random displays the number on portc as I want two numbers displayed after each other.</p>
  
  <p>I am only using avr studio 4 for atmega 8535 at 1Mhz.</p>
  
  <pre><code>&gt; ;Program to random numbers  on port C
  &gt; 
  &gt; ;Stack and Stack Pointer Addresses  .equ     SPH    =$3E             
  &gt; ;High Byte Stack Pointer Address   .equ     SPL    =$3D             
  &gt; ;Low Byte Stack Pointer Address 
  &gt; 
  &gt; .equ     RAMEND =$25F             ;Stack Address 
  &gt; 
  &gt; ;Port Addresses 
  &gt; 
  &gt; .equ     PORTC  =$15              ;Port C Output Address 
  &gt; 
  &gt; .equ     DDRC   =$14              ;Port C Data Direction Register
  &gt; Address 
  &gt; 
  &gt; .equ     numberoneddr=DDRC
  &gt; 
  &gt; .equ     numberoneport=portc
  &gt; 
  &gt; .equ     numbertwoddr=DDRC
  &gt; 
  &gt; .equ     numbertwoport=portc
  &gt; 
  &gt; .equ     delayCount=21
  &gt; 
  &gt; .equ    random1 =$66
  &gt; 
  &gt; ;Register Definitions 
  &gt; 
  &gt; .def    numberone   =r1               ;Register to store data pointed
  &gt; to by Z 
  &gt; 
  &gt; .def    numbertwo   =r2
  &gt; 
  &gt; .def     temp   =r16              ;Temporary storage register 
  &gt; 
  &gt; 
  &gt; 
  &gt; reset:
  &gt; 
  &gt; ; initialize stack pointer. Done automatically at reset on many AVRs
  &gt; 
  &gt;   ldi temp, low  (RAMEND)
  &gt; 
  &gt;   out spl, temp
  &gt; 
  &gt;   ldi temp, high (RAMEND)
  &gt; 
  &gt;   out sph, temp
  &gt; 
  &gt; 
  &gt; 
  &gt; 
  &gt; ;port initialisation
  &gt; 
  &gt; ldi temp,$FF
  &gt; 
  &gt; out numberoneddr,temp
  &gt; 
  &gt; out numberoneport,temp
  &gt; 
  &gt; out numbertwoddr,temp
  &gt; 
  &gt; out numbertwoport,temp
  &gt; 
  &gt; 
  &gt; 
  &gt; ;Program Initialisation 
  &gt; 
  &gt; ldi temp,$66
  &gt; 
  &gt; rcall random
  &gt; 
  &gt; mov   numberone, temp
  &gt; 
  &gt; out numberoneport,numberone
  &gt; 
  &gt; rcall random
  &gt; 
  &gt; mov   numbertwo, temp
  &gt; 
  &gt; out numberoneport,numbertwo
  &gt; 
  &gt; 
  &gt; 
  &gt; 
  &gt; random: mov r19,temp
  &gt; 
  &gt; ldi r17, 0x01
  &gt; 
  &gt; eor r19,r17
  &gt; 
  &gt; ror r19
  &gt; 
  &gt; mov temp,r19
  &gt; 
  &gt; ret
  &gt; 
  &gt; 
  &gt; 
  &gt; delay:
  &gt;         clr r20
  &gt; 
  &gt;       clr r21
  &gt; 
  &gt;       ldi r22, delayCount
  &gt; 
  &gt; loopDelay:
  &gt; 
  &gt;       dec r20
  &gt; 
  &gt;       brne loopDelay
  &gt; 
  &gt;       dec r21
  &gt; 
  &gt;       brne loopDelay
  &gt; 
  &gt;       dec r22
  &gt; 
  &gt;       brne loopDelay
  &gt; 
  &gt;         ret
  </code></pre>