uses crt; const RndConst:word=$8405; seed:longint=0; Procedure GetNextRnd; assembler; asm mov ax,word ptr [seed] mov bx, word ptr [seed+2] mov cx, ax mul RndConst shl cx, 3 add ch, cl add dx, cx add dx, bx shl bx, 2 add dx, bx add dh, bl mov cl, 5 shl bx, cl add dh, bl add ax, 1 adc dx, 0 mov word ptr [seed], ax mov word ptr [seed+2], dx retn end; function my_rnd(x:word):word; assembler; asm call GetNextRnd mov bx, sp mov cx, dx mul word [x] mov ax, cx mov cx, dx mul [x] add ax, cx adc dx, 0 mov ax, dx end; var i:integer; begin clrscr; for i:=1 to 20 do begin write (random (100):3); end; writeln; for i:=1 to 20 do begin write (my_rnd (100):3); end; end.