I want to know if there a routine or an instruction to generate a random number using assembly on 8086. any help will be appreciated.
You might be interested in Agner Fog's pseudo random number generators (some of which are written in assembly) here.