sms library
This is the basic header file when working with syslib. It contains some
general definitions and constants. Also some routines are contained here
because we could not find a better place to put them.
This library contains a simple random number generator. Because of the use
of DLL's, the randomness of the random number generator is improved, as the
calls of other programs to the random number generator will also influence each
other.
some generally useful constants
- NULL
- (void *)0 of course.
- NUL
- Just 0.
- TRUE
- A value for TRUE, any non zero value is good. We use -1.
- FALSE
- A value for FALSE, 0.
- INFINIT
- (Size)0x7fffffff, for arbitrary large objects.
- MYSELF
- (Job)-1, job identifier for myself.
- SYSTEM
- (Job)0, job identifier for system.
- RANDOM_MAX
- Max result for SMSRandom.
- RANDOM_INIT
- Suggstion for seed for SMSRandomSeed
some generally useful macros
- max
- Get the largest of two values.
The chosen argument may be evaluated twice !
- min
- Get the smallest of two values.
The chosen argument may be evaluated twice !
- newmax
- Used when calculating a maximum. Calling
newmax(old,check); is faster than
old=max(old,check);
The chosen argument may be evaluated twice !
- newmin
- Used when calculating a minimum. Calling
newmin(old,check); is faster than
old=min(old,check);
The chosen argument may be evaluated twice !
- abs
- Get the absolute value of something.
- even
- Get the smallest even number larger or equal to
the argument
- offsetof
- Get the offset of a field in a structure of given type.
some general routines
- SMSVersion
- Get the version of the operating system.
- SMSBaud
- Set baud rate for the serial ports.
- SMSBeep
- Simple sound generation, only duration and pitch.
- SMSRandom
- Random number generator.
- SMSRandomSeed
- Set new seed for the random number generator.
- SMSBreakSoft
- Create a soft breakpoint. A soft breakpoint is trapped
by qmon and jmon, but does not affect the program when
qmon or jmon is not active. This is implemented using
trap #15, so you need to set tl 15 to
make sure that qmon/jmon actually stops when the soft
breakpoint is encountered. You can pass some some
parameters so you can check their value by looking at
the stack.
- SMSBreakHard
- Create a hard breakpoint. This will stop the program,
and you can trace what happens next using qmon or
jmon. You can pass some some parameters so you can
check their value by looking at the stack.
PROGS, Professional & Graphical Software
last edited December 1, 1996