Added variable and constant to common.retro module
[retro.git] / toka / conditionals.c
blobd4e3396d1f8de7bf74667f9c46593921cb348078
1 /******************************************************
2 * Toka
4 *|F|
5 *|F| FILE: conditionals.c
6 *|F|
8 * Copyright (c) 2006, 2007 Charles R. Childers
10 * Permission to use, copy, modify, and distribute this
11 * software for any purpose with or without fee is hereby
12 * granted, provided that the above copyright notice and
13 * this permission notice appear in all copies.
15 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR
16 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
19 * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
20 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
21 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
22 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
23 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24 * OF THIS SOFTWARE.
25 ******************************************************/
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
31 #include "toka.h"
32 extern VM_STACK data, address, alternate;
36 /******************************************************
37 *|G| < ( ab-f ) Compare 'a' and 'b', return
38 *|G| a flag
40 *|F| less_than()
41 *|F| Compare TOS and NOS, return a flag.
42 *|F|
43 ******************************************************/
44 void less_than()
46 NOS = (TOS <= NOS) ? FALSE : TRUE; DROP;
50 /******************************************************
51 *|G| > ( ab-f ) Compare 'a' and 'b', return
52 *|G| a flag
54 *|F| greater_than()
55 *|F| Compare TOS and NOS, return a flag.
56 *|F|
57 ******************************************************/
58 void greater_than()
60 NOS = (TOS >= NOS) ? FALSE : TRUE; DROP;
64 /******************************************************
65 *|G| = ( ab-f ) Compare 'a' and 'b', return
66 *|G| a flag
68 *|F| equals()
69 *|F| Compare TOS and NOS, return a flag.
70 *|F|
71 ******************************************************/
72 void equals()
74 NOS = (TOS != NOS) ? FALSE : TRUE; DROP;
78 /******************************************************
79 *|G| <> ( ab-f ) Compare 'a' and 'b', return
80 *|G| a flag
82 *|F| not_equals()
83 *|F| Compare TOS and NOS, return a flag.
84 *|F|
85 ******************************************************/
86 void not_equals()
88 NOS = (TOS == NOS) ? FALSE : TRUE; DROP;