; CS2011, A Term 1999
; Prof. Sergio A. Alvarez
;
; Note: this file contains an outline for use in Lab/HW 5, 
; not a complete program module
; various directives and instructions are missing

title Pseudorandom numbers via linear congruence method

.model small
.stack

.data
   multiplier = 40
   increment = 3641
   modulus = 729

.code
.586

rando proc
; input:  16-bit seed passed by value on stack
; output: pseudorandom number in register DX

   mov bx, multiplier
   mul bx
   add ax, increment
   adc dx,0
   mov bx, modulus
   div bx

rando endp

end

