-
Notifications
You must be signed in to change notification settings - Fork 2
/
3BC6.c
39 lines (32 loc) · 1.07 KB
/
3BC6.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* File - sub_3BC6.c Created 09.03.2019 Last Modified 29.05.2020
*/
#include "stdio.h"
#include "cgen.h"
/*********************************************************
* sub_3BC6 v1 OK+ Used in: sub_3EAA
*
* Compiler generates identical code from restored source
* program in C, however, location of branches associated
* with case constants is different from original.
* This does not affect the function.
*********************************************************/
void sub_3BC6(register long * ptr, long p2, int operator) {
#ifdef DEBUG
printf("\tsub_3BC6(%x, %lx, %d)\n", ptr, p2, operator);
#endif
switch(operator) {
case MOD: *ptr %= p2; break;
case BAND: *ptr &= p2; break;
case MUL: *ptr *= p2; break;
case ADD: *ptr += p2; break;
case SUB: *ptr -= p2; break;
case DIV: *ptr /= p2; break;
case LSHIFT: *ptr <<= p2; break;
case RSHIFT: *ptr >>= p2; break;
case BXOR: *ptr ^= p2; break;
case BOR: *ptr |= p2; break;
}
return;
}
/* End of file sub_3BC6.c */