-
Notifications
You must be signed in to change notification settings - Fork 0
/
loops.c
116 lines (97 loc) · 1.69 KB
/
loops.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// https://github.com/cc65/cc65/tree/master/libsrc/runtime
#include <system.h>
#include <psv.h>
void test_if(void);
void test_ifnot(void);
void test_ifnumber(void);
void test_do_while(void);
void test_for(void);
void test_while(void);
void test_array(void);
void test_pointer(void);
void test_pointer2(void);
void test_le(void);
void test_less(void);
void test_stack(void);
struct point {
unsigned char x, y,z;
};
unsigned char i, j;
struct point p[10];
struct point p2;
unsigned char myarray[10];
struct point *mypointer;
int main(void){
return 0;
}
void test_pointer() {
mypointer = p;
consoleLogDecimal(0x00);
consoleLogHex(mypointer->y);
consoleLogDecimal(sizeof(p2));
consoleLogDecimal(sizeof(p[0]));
}
void test_pointer2() {
consoleLogDecimal(sizeof(p[0]));
mypointer = p;
mypointer+=1;
}
void test_le() {
if(i<=j) {
consoleLogHex(i);
}
else {
consoleLogDecimal(i);
}
}
void test_less() {
if(i<j) {
consoleLogHex(i);
}
else {
consoleLogDecimal(i);
}
}
void test_array() {
i=0;
consoleLogHex(p[i].x);
}
void test_if(void) {
if(i==0) {
consoleLogHex(i);
}
else {
consoleLogDecimal(i);
}
}
void test_ifnot(void) {
if(i!=0) {
consoleLogHex(i);
}
}
void test_ifnumber(void) {
if(i==5) {
consoleLogHex(i);
}
}
void test_do_while() {
i=0;
do {
consoleLogHex(i);
i++;
}while(i!=10);
}
void test_for() {
for(i=0; i!=10; i++) {
consoleLogHex(i);
}
}
void test_while() {
while(i!=10) {
consoleLogHex(i);
}
}
void test_stack() {
char local_var;
local_var = 15;
}