Debian Codegraph @

texmf-dist/source/latex/avremu/test-suite/mul.c

raw
1 #include <avr/io.h>
2
3 volatile char foo[30];
4
5 int main() {
6 foo[0] = 23;
7 foo[1] = 42;
8 // Should produce a mul
9 foo[2] = foo[0] * foo[1];
10
11 // Contains a decrement (8 Bit Dividend)
12 foo[3] = (unsigned char)((unsigned char )foo[1] / (unsigned char)foo[0]);
13
14 foo[4] = foo[1] % foo[0];
15
16 volatile uint16_t x = 1000;
17 volatile uint16_t y = 55;
18
19 foo[5] = x * y;
20 foo[20] = 165;
21
22 itoa((unsigned char)foo[20], &foo[6], 10);
23 itoa((signed char)foo[20], &foo[9], 10);
24
25
26 asm volatile ("break");
27 }
28
29 /*
30 check-name: Complex Memory Operations
31 check-start:
32 \avr@instr@stepn{100000}
33
34 \avr@test@MEM{96}{00010111} % 23
35 \avr@test@MEM{97}{00101010} % 42
36 \avr@test@MEM{98}{11000110} % 198
37
38 \avr@test@MEM{99}{00000001} % 1
39 \avr@test@MEM{100}{00010011} % 19
40
41 \avr@test@MEM{101}{11011000} % 216
42
43 \avr@test@MEM{102}{00110001} % '1'
44 \avr@test@MEM{103}{00110110} % '6'
45 \avr@test@MEM{104}{00110101} % '5'
46
47 \avr@test@MEM{105}{00101101} % '-'
48 \avr@test@MEM{106}{00111001} % '9'
49 \avr@test@MEM{107}{00110001} % '1'
50
51 check-end:
52 */