🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: mod.computers.apollo
1 messages
1 total messages Started by apollo Thu, 21 Nov 1985 14:00
Re: Assembler/Random Number Generator
#3
Author: apollo
Date: Thu, 21 Nov 1985 14:00
24 lines
1836 bytes
    When calling the BSD4.2 RAND() in CLIB from Pascal, I seem to get the
    System V version of RAND(), despite the SYSTYPE="BSD4.2".  Yes, writing
    a C language cover function with #systype "bsd4.2" works, but isn't
    there a way to call RAND() directly?

In general, you can't call clib routines from a program that has no C code
in it.  If you bind in even the tiniest bit of C code, the compiler will
put the clib stamp of approval on your program, and the loader will make
sure the right thing happens when the program runs.

Setting the SYSTYPE environment variable has no effect on which set of
system calls the program sees when it runs.  That is determined by the
stamp the binder places on the object module.  You can get your modules
stamped "bsd4.2" by putting "#systype" in the source, or giving the
-Tbsd4.2 flag to either /bin/cc or /bin/ld (or -systype to /com/cc or
/com/bind).

    Any other random number generators out there to feed my Apollo?

You might try the bsd4.2 random() function.  Some people claim it is
better then rand(), and since there is no sys5 version of random(),
you don't have to worry about which universe your program is running in.
-------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads