Category : Assembly Language Source Code
Archive   : ASM-SUBR.ZIP
Filename : RANDOM

 
Output of file : RANDOM contained in archive : ASM-SUBR.ZIP
;-------------------------random routine begins--------------------------+
; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
; page : 175
;
; NAME RANDOM
; ROUTINE FOR PSEUDO-RANDOM NUMBER GENERATOR
;
; FUNCTION: This routine generates pseudo-random numbers bewteen0 and 1.
; The numbers are stored in 16-bit binary fixed-point notation with the
; binary point on the extreme left.
; INPUT: Upon entry the variabl,e SEED contains a seed value.
; OUTPUT: Upon exit the seed is updated and the CX register contains a
; pseudo-random number.
; REGISTERS USED: Only CX is modified.
; SEGMENTS REFERENCED: pon entry the data segment contains the variable
; SEED.
; ROUTINES CALLED: None
; SPECIAL NOTES: None
;
random proc far
;
mov cx,seed ;get the seed
add cx,9248h ; add random pattern
ror cx,1 ; rotate
ror cx,1 ; three
ror cx,1 ; times.
mov seed,cx ; put it back
ret ; return
;
random endp
;-------------------------random routine ends---------------------------+


  3 Responses to “Category : Assembly Language Source Code
Archive   : ASM-SUBR.ZIP
Filename : RANDOM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/