•  Back 
  •  XBIOS Function Reference 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-FileRandom()                                                              XBIOS

Syntax

LONG Random( VOID )

Function      Random() returns a 24 bit random number.

Opcode        17 (0x11)

Availability  All TOS versions.

Binding       move.w   #$11,-(sp)
              trap     #14
              addq.l   #2,sp

Return Value  Random() returns a 24-bit random value in the lower three
              bytes of the returned LONG.

Caveats       The algorithm used provides an exact 50% occurrence of
              bit 0.