RANDOM - 2


*

*.Params int bound -

* .

**/

void rnd_set(int bound)

{

// 3

outp(0x43, 0xb6);

// -

// ,

outp(0x42, bound & 0x00ff);

outp(0x42, (bound &0xff00) >> 8);

//

outp(0x61, inp(0x61) | 1);

}

/**

*.Name rnd_get

*.Title

*

*.Descr

* ,

* rnd_set

*

*.Proto int rnd_get(void)

*

*.Params .

*

*.Return 0,

* 1 ,

* rnd_set().

**/

int rnd_get(void)

{

int i;

// CLC

// 2

outp(0x43, 0x86);

//

i = inp(0x42);

i = (inp(0x42) << 8) + i;

return(i);

}