Module 3_DMIPS ECEN 5803 Project 1 Submitted by 1. Rahul Yamasani 2. Srivishnuj Alvakonda
Fork of Dhrystone by
dhry.cpp@0:f96b0b385ec4, 2014-06-13 (annotated)
- Committer:
- jmehring
- Date:
- Fri Jun 13 18:30:37 2014 +0000
- Revision:
- 0:f96b0b385ec4
Dhrystone Benchmark Program C/1 12/01/84
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jmehring | 0:f96b0b385ec4 | 1 | |
jmehring | 0:f96b0b385ec4 | 2 | #include <stdio.h> |
jmehring | 0:f96b0b385ec4 | 3 | #include <stdlib.h> |
jmehring | 0:f96b0b385ec4 | 4 | #include <stdbool.h> |
jmehring | 0:f96b0b385ec4 | 5 | #include <string.h> |
jmehring | 0:f96b0b385ec4 | 6 | |
jmehring | 0:f96b0b385ec4 | 7 | #include "dhry.h" |
jmehring | 0:f96b0b385ec4 | 8 | |
jmehring | 0:f96b0b385ec4 | 9 | |
jmehring | 0:f96b0b385ec4 | 10 | #ifdef NOSTRUCTASSIGN |
jmehring | 0:f96b0b385ec4 | 11 | # define structassign(d, s) memcpy(&(d), &(s), sizeof(d)) |
jmehring | 0:f96b0b385ec4 | 12 | #else |
jmehring | 0:f96b0b385ec4 | 13 | # define structassign(d, s) d = s |
jmehring | 0:f96b0b385ec4 | 14 | #endif |
jmehring | 0:f96b0b385ec4 | 15 | |
jmehring | 0:f96b0b385ec4 | 16 | typedef enum { |
jmehring | 0:f96b0b385ec4 | 17 | Ident1, Ident2, Ident3, Ident4, Ident5 |
jmehring | 0:f96b0b385ec4 | 18 | } Enumeration; |
jmehring | 0:f96b0b385ec4 | 19 | |
jmehring | 0:f96b0b385ec4 | 20 | typedef int OneToThirty; |
jmehring | 0:f96b0b385ec4 | 21 | typedef int OneToFifty; |
jmehring | 0:f96b0b385ec4 | 22 | typedef char CapitalLetter; |
jmehring | 0:f96b0b385ec4 | 23 | typedef char String30[31]; |
jmehring | 0:f96b0b385ec4 | 24 | typedef int Array1Dim[51]; |
jmehring | 0:f96b0b385ec4 | 25 | typedef int Array2Dim[51][51]; |
jmehring | 0:f96b0b385ec4 | 26 | |
jmehring | 0:f96b0b385ec4 | 27 | struct Record { |
jmehring | 0:f96b0b385ec4 | 28 | struct Record *PtrComp; |
jmehring | 0:f96b0b385ec4 | 29 | Enumeration Discr; |
jmehring | 0:f96b0b385ec4 | 30 | Enumeration EnumComp; |
jmehring | 0:f96b0b385ec4 | 31 | OneToFifty IntComp; |
jmehring | 0:f96b0b385ec4 | 32 | String30 StringComp; |
jmehring | 0:f96b0b385ec4 | 33 | }; |
jmehring | 0:f96b0b385ec4 | 34 | |
jmehring | 0:f96b0b385ec4 | 35 | typedef struct Record RecordType; |
jmehring | 0:f96b0b385ec4 | 36 | typedef RecordType *RecordPtr; |
jmehring | 0:f96b0b385ec4 | 37 | |
jmehring | 0:f96b0b385ec4 | 38 | #ifndef NULL |
jmehring | 0:f96b0b385ec4 | 39 | # define NULL (void *)0 |
jmehring | 0:f96b0b385ec4 | 40 | #endif |
jmehring | 0:f96b0b385ec4 | 41 | |
jmehring | 0:f96b0b385ec4 | 42 | #ifndef FALSE |
jmehring | 0:f96b0b385ec4 | 43 | # define FALSE 0 |
jmehring | 0:f96b0b385ec4 | 44 | # define TRUE (!FALSE) |
jmehring | 0:f96b0b385ec4 | 45 | #endif |
jmehring | 0:f96b0b385ec4 | 46 | |
jmehring | 0:f96b0b385ec4 | 47 | #ifndef REG |
jmehring | 0:f96b0b385ec4 | 48 | # define REG |
jmehring | 0:f96b0b385ec4 | 49 | #endif |
jmehring | 0:f96b0b385ec4 | 50 | |
jmehring | 0:f96b0b385ec4 | 51 | |
jmehring | 0:f96b0b385ec4 | 52 | void Proc0( void ); |
jmehring | 0:f96b0b385ec4 | 53 | void Proc1( RecordPtr PtrParIn ); |
jmehring | 0:f96b0b385ec4 | 54 | void Proc2( OneToFifty *IntParIO ); |
jmehring | 0:f96b0b385ec4 | 55 | void Proc3( RecordPtr *PtrParOut ); |
jmehring | 0:f96b0b385ec4 | 56 | void Proc4( void ); |
jmehring | 0:f96b0b385ec4 | 57 | void Proc5( void ); |
jmehring | 0:f96b0b385ec4 | 58 | void Proc6( Enumeration EnumParIn, |
jmehring | 0:f96b0b385ec4 | 59 | Enumeration *EnumParOut ); |
jmehring | 0:f96b0b385ec4 | 60 | void Proc7( OneToFifty IntParI1, |
jmehring | 0:f96b0b385ec4 | 61 | OneToFifty IntParI2, |
jmehring | 0:f96b0b385ec4 | 62 | OneToFifty *IntParOut ); |
jmehring | 0:f96b0b385ec4 | 63 | void Proc8( Array1Dim Array1Par, |
jmehring | 0:f96b0b385ec4 | 64 | Array2Dim Array2Par, |
jmehring | 0:f96b0b385ec4 | 65 | OneToFifty IntParI1, |
jmehring | 0:f96b0b385ec4 | 66 | OneToFifty IntParI2 ); |
jmehring | 0:f96b0b385ec4 | 67 | Enumeration Func1( CapitalLetter CharPar1, |
jmehring | 0:f96b0b385ec4 | 68 | CapitalLetter CharPar2 ); |
jmehring | 0:f96b0b385ec4 | 69 | bool Func2( String30 StrParI1, |
jmehring | 0:f96b0b385ec4 | 70 | String30 StrParI2 ); |
jmehring | 0:f96b0b385ec4 | 71 | bool Func3( Enumeration EnumParIn ); |
jmehring | 0:f96b0b385ec4 | 72 | |
jmehring | 0:f96b0b385ec4 | 73 | |
jmehring | 0:f96b0b385ec4 | 74 | int IntGlob; |
jmehring | 0:f96b0b385ec4 | 75 | int cnt, sum_flag; |
jmehring | 0:f96b0b385ec4 | 76 | bool BoolGlob; |
jmehring | 0:f96b0b385ec4 | 77 | char Char1Glob; |
jmehring | 0:f96b0b385ec4 | 78 | char Char2Glob; |
jmehring | 0:f96b0b385ec4 | 79 | Array1Dim Array1Glob; |
jmehring | 0:f96b0b385ec4 | 80 | Array2Dim Array2Glob; |
jmehring | 0:f96b0b385ec4 | 81 | RecordPtr PtrGlb; |
jmehring | 0:f96b0b385ec4 | 82 | RecordPtr PtrGlbNext; |
jmehring | 0:f96b0b385ec4 | 83 | |
jmehring | 0:f96b0b385ec4 | 84 | /****************************************************************************/ |
jmehring | 0:f96b0b385ec4 | 85 | |
jmehring | 0:f96b0b385ec4 | 86 | void Proc0 (void) |
jmehring | 0:f96b0b385ec4 | 87 | { |
jmehring | 0:f96b0b385ec4 | 88 | OneToFifty IntLoc1; |
jmehring | 0:f96b0b385ec4 | 89 | OneToFifty IntLoc2; |
jmehring | 0:f96b0b385ec4 | 90 | OneToFifty IntLoc3; |
jmehring | 0:f96b0b385ec4 | 91 | char CharIndex; |
jmehring | 0:f96b0b385ec4 | 92 | Enumeration EnumLoc; |
jmehring | 0:f96b0b385ec4 | 93 | String30 String1Loc, String2Loc; |
jmehring | 0:f96b0b385ec4 | 94 | unsigned long idx; |
jmehring | 0:f96b0b385ec4 | 95 | |
jmehring | 0:f96b0b385ec4 | 96 | PtrGlbNext = (RecordPtr) malloc(sizeof(RecordType)); |
jmehring | 0:f96b0b385ec4 | 97 | PtrGlb = (RecordPtr) malloc(sizeof(RecordType)); |
jmehring | 0:f96b0b385ec4 | 98 | PtrGlb->PtrComp = PtrGlbNext; |
jmehring | 0:f96b0b385ec4 | 99 | PtrGlb->Discr = Ident1; |
jmehring | 0:f96b0b385ec4 | 100 | PtrGlb->EnumComp = Ident3; |
jmehring | 0:f96b0b385ec4 | 101 | PtrGlb->IntComp = 40; |
jmehring | 0:f96b0b385ec4 | 102 | strcpy(PtrGlb->StringComp, "DHRYSTONE PROGRAM, SOME STRING"); |
jmehring | 0:f96b0b385ec4 | 103 | |
jmehring | 0:f96b0b385ec4 | 104 | for (idx = 0; idx < LOOPS; idx++) { |
jmehring | 0:f96b0b385ec4 | 105 | Proc5(); |
jmehring | 0:f96b0b385ec4 | 106 | Proc4(); |
jmehring | 0:f96b0b385ec4 | 107 | |
jmehring | 0:f96b0b385ec4 | 108 | IntLoc1 = 2; |
jmehring | 0:f96b0b385ec4 | 109 | IntLoc2 = 3; |
jmehring | 0:f96b0b385ec4 | 110 | IntLoc3 = 0; |
jmehring | 0:f96b0b385ec4 | 111 | |
jmehring | 0:f96b0b385ec4 | 112 | strcpy(String2Loc, "DHRYSTONE PROGRAM, 2'ND STRING"); |
jmehring | 0:f96b0b385ec4 | 113 | |
jmehring | 0:f96b0b385ec4 | 114 | EnumLoc = Ident2; |
jmehring | 0:f96b0b385ec4 | 115 | BoolGlob = ! Func2(String1Loc, String2Loc); |
jmehring | 0:f96b0b385ec4 | 116 | |
jmehring | 0:f96b0b385ec4 | 117 | while (IntLoc1 < IntLoc2) { |
jmehring | 0:f96b0b385ec4 | 118 | IntLoc3 = 5 * IntLoc1 - IntLoc2; |
jmehring | 0:f96b0b385ec4 | 119 | Proc7(IntLoc1, IntLoc2, &IntLoc3); |
jmehring | 0:f96b0b385ec4 | 120 | ++IntLoc1; |
jmehring | 0:f96b0b385ec4 | 121 | } |
jmehring | 0:f96b0b385ec4 | 122 | |
jmehring | 0:f96b0b385ec4 | 123 | Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3); |
jmehring | 0:f96b0b385ec4 | 124 | Proc1(PtrGlb); |
jmehring | 0:f96b0b385ec4 | 125 | |
jmehring | 0:f96b0b385ec4 | 126 | for (CharIndex = 'A'; CharIndex <= Char2Glob; ++CharIndex) |
jmehring | 0:f96b0b385ec4 | 127 | if (EnumLoc == Func1(CharIndex, 'C')) |
jmehring | 0:f96b0b385ec4 | 128 | Proc6(Ident1, &EnumLoc); |
jmehring | 0:f96b0b385ec4 | 129 | |
jmehring | 0:f96b0b385ec4 | 130 | IntLoc3 = IntLoc2 * IntLoc1; |
jmehring | 0:f96b0b385ec4 | 131 | IntLoc2 = IntLoc3 / IntLoc1; |
jmehring | 0:f96b0b385ec4 | 132 | IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1; |
jmehring | 0:f96b0b385ec4 | 133 | Proc2(&IntLoc1); |
jmehring | 0:f96b0b385ec4 | 134 | } |
jmehring | 0:f96b0b385ec4 | 135 | |
jmehring | 0:f96b0b385ec4 | 136 | free(PtrGlbNext); |
jmehring | 0:f96b0b385ec4 | 137 | free(PtrGlb); |
jmehring | 0:f96b0b385ec4 | 138 | } |
jmehring | 0:f96b0b385ec4 | 139 | |
jmehring | 0:f96b0b385ec4 | 140 | |
jmehring | 0:f96b0b385ec4 | 141 | void Proc1( RecordPtr PtrParIn ) |
jmehring | 0:f96b0b385ec4 | 142 | { |
jmehring | 0:f96b0b385ec4 | 143 | structassign(*(PtrParIn->PtrComp), *PtrGlb); |
jmehring | 0:f96b0b385ec4 | 144 | PtrParIn->IntComp = 5; |
jmehring | 0:f96b0b385ec4 | 145 | PtrParIn->PtrComp->IntComp = PtrParIn->IntComp; |
jmehring | 0:f96b0b385ec4 | 146 | PtrParIn->PtrComp->PtrComp = PtrParIn->PtrComp; |
jmehring | 0:f96b0b385ec4 | 147 | Proc3((RecordPtr *)(PtrParIn->PtrComp->PtrComp)); |
jmehring | 0:f96b0b385ec4 | 148 | if ((PtrParIn->PtrComp)->Discr == Ident1) { |
jmehring | 0:f96b0b385ec4 | 149 | PtrParIn->PtrComp->IntComp = 6; |
jmehring | 0:f96b0b385ec4 | 150 | Proc6(PtrParIn->EnumComp, &(PtrParIn->PtrComp->EnumComp)); |
jmehring | 0:f96b0b385ec4 | 151 | PtrParIn->PtrComp->PtrComp = PtrGlb->PtrComp; |
jmehring | 0:f96b0b385ec4 | 152 | Proc7(PtrParIn->PtrComp->IntComp, 10, |
jmehring | 0:f96b0b385ec4 | 153 | &(PtrParIn->PtrComp->IntComp)); |
jmehring | 0:f96b0b385ec4 | 154 | } else |
jmehring | 0:f96b0b385ec4 | 155 | structassign(*PtrParIn, *(PtrParIn->PtrComp)); |
jmehring | 0:f96b0b385ec4 | 156 | } |
jmehring | 0:f96b0b385ec4 | 157 | |
jmehring | 0:f96b0b385ec4 | 158 | |
jmehring | 0:f96b0b385ec4 | 159 | void Proc2( OneToFifty *IntParIO ) |
jmehring | 0:f96b0b385ec4 | 160 | { |
jmehring | 0:f96b0b385ec4 | 161 | OneToFifty IntLoc; |
jmehring | 0:f96b0b385ec4 | 162 | Enumeration EnumLoc; |
jmehring | 0:f96b0b385ec4 | 163 | |
jmehring | 0:f96b0b385ec4 | 164 | IntLoc = *IntParIO + 10; |
jmehring | 0:f96b0b385ec4 | 165 | |
jmehring | 0:f96b0b385ec4 | 166 | for(;;) { |
jmehring | 0:f96b0b385ec4 | 167 | if (Char1Glob == 'A') { |
jmehring | 0:f96b0b385ec4 | 168 | IntLoc -= 1; |
jmehring | 0:f96b0b385ec4 | 169 | *IntParIO = IntLoc - IntGlob; |
jmehring | 0:f96b0b385ec4 | 170 | EnumLoc = Ident1; |
jmehring | 0:f96b0b385ec4 | 171 | } |
jmehring | 0:f96b0b385ec4 | 172 | |
jmehring | 0:f96b0b385ec4 | 173 | if (EnumLoc == Ident1) |
jmehring | 0:f96b0b385ec4 | 174 | break; |
jmehring | 0:f96b0b385ec4 | 175 | } |
jmehring | 0:f96b0b385ec4 | 176 | } |
jmehring | 0:f96b0b385ec4 | 177 | |
jmehring | 0:f96b0b385ec4 | 178 | |
jmehring | 0:f96b0b385ec4 | 179 | void Proc3( RecordPtr *PtrParOut ) |
jmehring | 0:f96b0b385ec4 | 180 | { |
jmehring | 0:f96b0b385ec4 | 181 | if (PtrGlb != NULL) |
jmehring | 0:f96b0b385ec4 | 182 | *PtrParOut = PtrGlb->PtrComp; |
jmehring | 0:f96b0b385ec4 | 183 | else |
jmehring | 0:f96b0b385ec4 | 184 | IntGlob = 100; |
jmehring | 0:f96b0b385ec4 | 185 | |
jmehring | 0:f96b0b385ec4 | 186 | Proc7(10, IntGlob, &PtrGlb->IntComp); |
jmehring | 0:f96b0b385ec4 | 187 | } |
jmehring | 0:f96b0b385ec4 | 188 | |
jmehring | 0:f96b0b385ec4 | 189 | |
jmehring | 0:f96b0b385ec4 | 190 | void Proc4( void ) |
jmehring | 0:f96b0b385ec4 | 191 | { |
jmehring | 0:f96b0b385ec4 | 192 | bool BoolLoc; |
jmehring | 0:f96b0b385ec4 | 193 | |
jmehring | 0:f96b0b385ec4 | 194 | BoolLoc = Char1Glob == 'A'; |
jmehring | 0:f96b0b385ec4 | 195 | BoolLoc |= BoolGlob; |
jmehring | 0:f96b0b385ec4 | 196 | Char2Glob = 'B'; |
jmehring | 0:f96b0b385ec4 | 197 | } |
jmehring | 0:f96b0b385ec4 | 198 | |
jmehring | 0:f96b0b385ec4 | 199 | |
jmehring | 0:f96b0b385ec4 | 200 | void Proc5( void ) |
jmehring | 0:f96b0b385ec4 | 201 | { |
jmehring | 0:f96b0b385ec4 | 202 | Char1Glob = 'A'; |
jmehring | 0:f96b0b385ec4 | 203 | BoolGlob = FALSE; |
jmehring | 0:f96b0b385ec4 | 204 | } |
jmehring | 0:f96b0b385ec4 | 205 | |
jmehring | 0:f96b0b385ec4 | 206 | |
jmehring | 0:f96b0b385ec4 | 207 | void Proc6( Enumeration EnumParIn, Enumeration *EnumParOut ) |
jmehring | 0:f96b0b385ec4 | 208 | { |
jmehring | 0:f96b0b385ec4 | 209 | *EnumParOut = EnumParIn; |
jmehring | 0:f96b0b385ec4 | 210 | |
jmehring | 0:f96b0b385ec4 | 211 | if (! Func3(EnumParIn)) |
jmehring | 0:f96b0b385ec4 | 212 | *EnumParOut = Ident4; |
jmehring | 0:f96b0b385ec4 | 213 | |
jmehring | 0:f96b0b385ec4 | 214 | switch (EnumParIn) { |
jmehring | 0:f96b0b385ec4 | 215 | case Ident1: |
jmehring | 0:f96b0b385ec4 | 216 | *EnumParOut = Ident1; |
jmehring | 0:f96b0b385ec4 | 217 | break; |
jmehring | 0:f96b0b385ec4 | 218 | case Ident2: |
jmehring | 0:f96b0b385ec4 | 219 | *EnumParOut = (IntGlob > 100)? Ident1 : Ident4; |
jmehring | 0:f96b0b385ec4 | 220 | break; |
jmehring | 0:f96b0b385ec4 | 221 | case Ident3: |
jmehring | 0:f96b0b385ec4 | 222 | *EnumParOut = Ident2; |
jmehring | 0:f96b0b385ec4 | 223 | break; |
jmehring | 0:f96b0b385ec4 | 224 | case Ident4: |
jmehring | 0:f96b0b385ec4 | 225 | break; |
jmehring | 0:f96b0b385ec4 | 226 | case Ident5: |
jmehring | 0:f96b0b385ec4 | 227 | *EnumParOut = Ident3; |
jmehring | 0:f96b0b385ec4 | 228 | break; |
jmehring | 0:f96b0b385ec4 | 229 | } |
jmehring | 0:f96b0b385ec4 | 230 | } |
jmehring | 0:f96b0b385ec4 | 231 | |
jmehring | 0:f96b0b385ec4 | 232 | |
jmehring | 0:f96b0b385ec4 | 233 | void Proc7( OneToFifty IntParI1, |
jmehring | 0:f96b0b385ec4 | 234 | OneToFifty IntParI2, |
jmehring | 0:f96b0b385ec4 | 235 | OneToFifty *IntParOut ) |
jmehring | 0:f96b0b385ec4 | 236 | { |
jmehring | 0:f96b0b385ec4 | 237 | OneToFifty IntLoc; |
jmehring | 0:f96b0b385ec4 | 238 | |
jmehring | 0:f96b0b385ec4 | 239 | IntLoc = IntParI1 + 2; |
jmehring | 0:f96b0b385ec4 | 240 | *IntParOut = IntParI2 + IntLoc; |
jmehring | 0:f96b0b385ec4 | 241 | } |
jmehring | 0:f96b0b385ec4 | 242 | |
jmehring | 0:f96b0b385ec4 | 243 | |
jmehring | 0:f96b0b385ec4 | 244 | void Proc8( Array1Dim Array1Par, |
jmehring | 0:f96b0b385ec4 | 245 | Array2Dim Array2Par, |
jmehring | 0:f96b0b385ec4 | 246 | OneToFifty IntParI1, |
jmehring | 0:f96b0b385ec4 | 247 | OneToFifty IntParI2 ) |
jmehring | 0:f96b0b385ec4 | 248 | { |
jmehring | 0:f96b0b385ec4 | 249 | OneToFifty IntLoc; |
jmehring | 0:f96b0b385ec4 | 250 | OneToFifty IntIndex; |
jmehring | 0:f96b0b385ec4 | 251 | |
jmehring | 0:f96b0b385ec4 | 252 | IntLoc = IntParI1 + 5; |
jmehring | 0:f96b0b385ec4 | 253 | Array1Par[IntLoc] = IntParI2; |
jmehring | 0:f96b0b385ec4 | 254 | Array1Par[IntLoc+1] = Array1Par[IntLoc]; |
jmehring | 0:f96b0b385ec4 | 255 | Array1Par[IntLoc+30] = IntLoc; |
jmehring | 0:f96b0b385ec4 | 256 | |
jmehring | 0:f96b0b385ec4 | 257 | for (IntIndex = IntLoc; IntIndex <= (IntLoc+1); ++IntIndex) |
jmehring | 0:f96b0b385ec4 | 258 | Array2Par[IntLoc][IntIndex] = IntLoc; |
jmehring | 0:f96b0b385ec4 | 259 | |
jmehring | 0:f96b0b385ec4 | 260 | ++Array2Par[IntLoc][IntLoc-1]; |
jmehring | 0:f96b0b385ec4 | 261 | Array2Par[IntLoc+20][IntLoc] = Array1Par[IntLoc]; |
jmehring | 0:f96b0b385ec4 | 262 | IntGlob = 5; |
jmehring | 0:f96b0b385ec4 | 263 | } |
jmehring | 0:f96b0b385ec4 | 264 | |
jmehring | 0:f96b0b385ec4 | 265 | |
jmehring | 0:f96b0b385ec4 | 266 | Enumeration Func1( CapitalLetter CharPar1, |
jmehring | 0:f96b0b385ec4 | 267 | CapitalLetter CharPar2 ) |
jmehring | 0:f96b0b385ec4 | 268 | { |
jmehring | 0:f96b0b385ec4 | 269 | CapitalLetter CharLoc1; |
jmehring | 0:f96b0b385ec4 | 270 | CapitalLetter CharLoc2; |
jmehring | 0:f96b0b385ec4 | 271 | |
jmehring | 0:f96b0b385ec4 | 272 | CharLoc1 = CharPar1; |
jmehring | 0:f96b0b385ec4 | 273 | CharLoc2 = CharLoc1; |
jmehring | 0:f96b0b385ec4 | 274 | |
jmehring | 0:f96b0b385ec4 | 275 | return ((CharLoc2 != CharPar2) ? Ident1 : Ident2); |
jmehring | 0:f96b0b385ec4 | 276 | } |
jmehring | 0:f96b0b385ec4 | 277 | |
jmehring | 0:f96b0b385ec4 | 278 | |
jmehring | 0:f96b0b385ec4 | 279 | bool Func2( String30 StrParI1, |
jmehring | 0:f96b0b385ec4 | 280 | String30 StrParI2 ) |
jmehring | 0:f96b0b385ec4 | 281 | { |
jmehring | 0:f96b0b385ec4 | 282 | OneToThirty IntLoc; |
jmehring | 0:f96b0b385ec4 | 283 | CapitalLetter CharLoc; |
jmehring | 0:f96b0b385ec4 | 284 | |
jmehring | 0:f96b0b385ec4 | 285 | IntLoc = 1; |
jmehring | 0:f96b0b385ec4 | 286 | while (IntLoc <= 1) { |
jmehring | 0:f96b0b385ec4 | 287 | if (Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1) { |
jmehring | 0:f96b0b385ec4 | 288 | CharLoc = 'A'; |
jmehring | 0:f96b0b385ec4 | 289 | ++IntLoc; |
jmehring | 0:f96b0b385ec4 | 290 | } |
jmehring | 0:f96b0b385ec4 | 291 | } |
jmehring | 0:f96b0b385ec4 | 292 | |
jmehring | 0:f96b0b385ec4 | 293 | if (CharLoc >= 'W' && CharLoc <= 'Z') { |
jmehring | 0:f96b0b385ec4 | 294 | IntLoc = 7; |
jmehring | 0:f96b0b385ec4 | 295 | } |
jmehring | 0:f96b0b385ec4 | 296 | |
jmehring | 0:f96b0b385ec4 | 297 | if (CharLoc == 'X') { |
jmehring | 0:f96b0b385ec4 | 298 | return(TRUE); |
jmehring | 0:f96b0b385ec4 | 299 | } else { |
jmehring | 0:f96b0b385ec4 | 300 | if (strcmp(StrParI1, StrParI2) > 0) { |
jmehring | 0:f96b0b385ec4 | 301 | IntLoc += 7; |
jmehring | 0:f96b0b385ec4 | 302 | return (TRUE); |
jmehring | 0:f96b0b385ec4 | 303 | } else |
jmehring | 0:f96b0b385ec4 | 304 | return (FALSE); |
jmehring | 0:f96b0b385ec4 | 305 | } |
jmehring | 0:f96b0b385ec4 | 306 | } |
jmehring | 0:f96b0b385ec4 | 307 | |
jmehring | 0:f96b0b385ec4 | 308 | |
jmehring | 0:f96b0b385ec4 | 309 | bool Func3( Enumeration EnumParIn ) |
jmehring | 0:f96b0b385ec4 | 310 | { |
jmehring | 0:f96b0b385ec4 | 311 | Enumeration EnumLoc; |
jmehring | 0:f96b0b385ec4 | 312 | |
jmehring | 0:f96b0b385ec4 | 313 | EnumLoc = EnumParIn; |
jmehring | 0:f96b0b385ec4 | 314 | |
jmehring | 0:f96b0b385ec4 | 315 | return (EnumLoc == Ident3); |
jmehring | 0:f96b0b385ec4 | 316 | } |