Commit 239edc80f637348a4e9c84166efea1af5b1abe0f
1 parent
d47c1384
Déplacement des fichiers tests et ajout des non-suivis
Showing
15 changed files
with
340 additions
and
17 deletions
Show diff stats
Makefile
adc.txt renamed to tests/adc.txt
allumertous.txt renamed to tests/allumertous.txt
bouton.txt renamed to tests/bouton.txt
... | ... | @@ -0,0 +1,78 @@ |
1 | +.equ PINA = 0x00 ; définition des adresses des ports | |
2 | +.equ DDRA = 0x01 | |
3 | +.equ PORTA = 0x02 | |
4 | +.equ PINC = 0x06 | |
5 | +.equ DDRC = 0x07 | |
6 | +.equ PORTC = 0x08 | |
7 | + | |
8 | +.equ SREG = 0x3F | |
9 | + | |
10 | +.equ EIMSK = 0x3D | |
11 | +.equ EICRA = 0x69 | |
12 | +.equ EICRB = 0x6A | |
13 | + | |
14 | +.equ RAMEND = 0x21FF | |
15 | +.equ SPH = 0x3E ; initialisation de la pile | |
16 | +.equ SPL = 0x3D | |
17 | + | |
18 | +.org 0x000 | |
19 | + ; Vecteur RESET | |
20 | + jmp debut | |
21 | + | |
22 | +.org 0x0002 ; INT0 | |
23 | + jmp valider | |
24 | + | |
25 | +.org 0x0004 ; INT1 | |
26 | + jmp retour | |
27 | + | |
28 | +.org 0x0006 ; INT2 | |
29 | + jmp incrementer | |
30 | + | |
31 | +.org 0x0008 ; INT3 | |
32 | + jmp decrementer | |
33 | + | |
34 | +.org 0x0080 | |
35 | + | |
36 | +debut: | |
37 | + DDRA@IO <- 0xFF | |
38 | + DDRC@IO <- 0xFF | |
39 | + PORTA@IO <- 0xFF | |
40 | + PORTC@IO <- 0xFF | |
41 | + EIMSK <- 0b00001111 | |
42 | + EICRA <- 0b11111111 ; TODO Oscillations annulables ? | |
43 | + EICRB <- 0b00000000 | |
44 | + SEI | |
45 | + | |
46 | +boucle: | |
47 | + sleep | |
48 | + saut boucle | |
49 | + | |
50 | +valider: | |
51 | + PORTC@IO <- 0x00 | |
52 | + reti | |
53 | + | |
54 | +retour: | |
55 | + PORTC@IO <- 0xFF | |
56 | + reti | |
57 | + | |
58 | +incrementer: | |
59 | + r20 <- PINC@IO | |
60 | + inc r20 | |
61 | + PORTC@IO <- r20 | |
62 | + reti | |
63 | + | |
64 | +decrementer: | |
65 | + r20 <- PINC@IO | |
66 | + dec r20 | |
67 | + PORTC@IO <- r20 | |
68 | + reti | |
69 | + | |
70 | +tempo: | |
71 | + ldi r24,8 | |
72 | +tempoA: | |
73 | + subi r22,1 | |
74 | + sbci r23,0 | |
75 | + sbci r24,0 | |
76 | + brcc tempoA | |
77 | + ret | |
78 | + | ... | ... |
test.asm renamed to tests/chaudiere.txt
1 | 1 | .equ PINA = 0x00 ; définition des adresses des ports |
2 | 2 | .equ DDRA = 0x01 |
3 | 3 | .equ PORTA = 0x02 |
4 | -.equ PINB = 0x03 | |
5 | -.equ DDRB = 0x04 | |
6 | -.equ PORTB = 0x05 | |
7 | 4 | .equ PINC = 0x06 |
8 | 5 | .equ DDRC = 0x07 |
9 | 6 | .equ PORTC = 0x08 |
7 | +.equ PING = 0x12 | |
8 | +.equ DDRG = 0x13 | |
9 | +.equ PORTG = 0x14 | |
10 | 10 | |
11 | 11 | .equ RAMEND = 0x21FF |
12 | 12 | .equ SPH = 0x3E ; initialisation de la pile |
13 | 13 | .equ SPL = 0x3D |
14 | 14 | |
15 | -.org 0x000 | |
15 | +.org 0x000 | |
16 | 16 | ; Vecteur RESET |
17 | 17 | jmp debut |
18 | 18 | |
19 | + | |
19 | 20 | .org 0x0080 |
20 | 21 | |
22 | + | |
21 | 23 | debut: |
22 | - ldi r16,0x01 ; Configuration de la direction des ports | |
23 | - out DDRC,r16 | |
24 | + DDRA@IO <- 0xFF | |
25 | + DDRC@IO <- 0xFF | |
26 | + DDRG@IO <- 0xFF | |
27 | + PORTC@IO <- 0x00 | |
28 | + SEI | |
24 | 29 | |
25 | 30 | boucle: |
26 | - ldi r16,0x00 | |
27 | - in r16,PINC ; Lecture du port C | |
28 | - lsr r16 ; Décalage vers la droite : le bit associé au bouton va sur celui associé à la LED | |
29 | - ; ldi r16,0x01 | |
30 | - ; out PORTC,r16 ; Écriture du port C | |
31 | - ; call tempo | |
32 | - out PORTC,r16 ; Écriture du port C | |
33 | - ; call tempo | |
34 | - jmp boucle ; On recommence | |
31 | + ;PORTA@IO <- PINC@IO | |
32 | + ; PORTA@IO <- 0xAA | |
33 | + PORTG@IO <- 0x01 | |
34 | + saut boucle | |
35 | 35 | |
36 | 36 | tempo: |
37 | - ; On fait une pause | |
38 | 37 | ldi r24,8 |
39 | 38 | tempoA: |
40 | 39 | subi r22,1 | ... | ... |
chen.txt renamed to tests/chen.txt
code.txt renamed to tests/code.txt
compteur.txt renamed to tests/compteur.txt
compteurLettre.txt renamed to tests/compteurLettre.txt
... | ... | @@ -0,0 +1,67 @@ |
1 | +; Équivalences | |
2 | + | |
3 | +.equ PINA = 0x00 | |
4 | +.equ DDRA = 0x01 | |
5 | +.equ PORTA = 0x02 | |
6 | +.equ PINC = 0x06 | |
7 | +.equ DDRC = 0x07 | |
8 | +.equ PORTC = 0x08 | |
9 | + | |
10 | +.equ WDTCSR = 0x60 | |
11 | + | |
12 | +.equ TTCR0A = 0x24 | |
13 | +.equ TTCR0B = 0x25 | |
14 | +.equ TMSK0 = 0x6e | |
15 | + | |
16 | +.equ EIMSK = 0x3D | |
17 | +.equ EICRA = 0x69 | |
18 | +.equ EICRB = 0x6A | |
19 | + | |
20 | +.equ ADMUX = 0x7C | |
21 | +.equ ADCSRB = 0x7B | |
22 | +.equ ADCSRA = 0x7A | |
23 | +.equ ADCH = 0x79 | |
24 | + | |
25 | +.equ SPH = 0x3E | |
26 | +.equ SPL = 0x3D | |
27 | + | |
28 | +; Nommage des registres utilisés | |
29 | + | |
30 | +.def etat = r12 | |
31 | +.def reference = r13 ; Température de référence actuelle | |
32 | +.def d3 = r2 ; Digit 3 (tout à gauche) | |
33 | +.def d2 = r3 ; Digit 2 | |
34 | +.def d1 = r4 ; Digit 1 | |
35 | +.def d0 = r5 ; Digit 0 (tout à droite) | |
36 | +.def compteur = r6 ; Utilisé pour modifier des valeurs dans le menu | |
37 | +.def temp = r7 ; Utilisé pour différentes choses mais très brièvement | |
38 | +.def t2 = r8 ; Jour (3 premiers bits) et Heure (5 derniers bits) | |
39 | +.def t1 = r9 ; Minutes | |
40 | +.def t0 = r10 ; Secondes / 2 | |
41 | +.def selaff = r11 ; Digit en cours d'affichage | |
42 | + | |
43 | +.def jours = 0x0200 | |
44 | +.def tempJour = 0x02a8 | |
45 | +.def tempNuit = 0x02a9 | |
46 | + | |
47 | +; Vecteurs d'interruptions | |
48 | + | |
49 | +.org 0x000 ; Vecteur RESET | |
50 | + jmp debut | |
51 | + | |
52 | +.org 0x0080 | |
53 | + | |
54 | +; Tableaux de la mémoire du programme | |
55 | + | |
56 | +afficheur: | |
57 | + .DB 0x3F, 0x30, 0x6D, 0x79, 0x72, 0x5B, 0x5F, 0x31, 0x7F, 0x7B | |
58 | + ; 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 | |
59 | + | |
60 | +; Programme | |
61 | + | |
62 | +debut: | |
63 | + DDRA@IO <- 0xFF | |
64 | + DDRC@IO <- 0xFF | |
65 | + PORTA@IO <- 0xFF | |
66 | + PORTC@IO <- 0x00 | |
67 | + jmp debut | ... | ... |
... | ... | @@ -0,0 +1,52 @@ |
1 | +.equ PINA = 0x00 ; définition des adresses des ports | |
2 | +.equ DDRA = 0x01 | |
3 | +.equ PORTA = 0x02 | |
4 | +.equ PINC = 0x06 | |
5 | +.equ DDRC = 0x07 | |
6 | +.equ PORTC = 0x08 | |
7 | + | |
8 | +.equ RAMEND = 0x21FF | |
9 | +.equ SPH = 0x3E ; initialisation de la pile | |
10 | +.equ SPL = 0x3D | |
11 | + | |
12 | +.def compteur = r20 | |
13 | +.def seg = r21 | |
14 | + | |
15 | +.org 0x000 | |
16 | + ; Vecteur RESET | |
17 | + jmp debut | |
18 | + | |
19 | +.org 0x0080 | |
20 | + | |
21 | +afficheur: | |
22 | + .DB 0x3F, 0x30, 0x6D, 0x79, 0x72, 0x5B, 0x5F, 0x31, 0x7F, 0x7B | |
23 | + ; 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 | |
24 | + | |
25 | + | |
26 | +debut: | |
27 | + DDRA@IO <- 0xFF | |
28 | + DDRC@IO <- 0xFF | |
29 | + | |
30 | + r2 <- 13 | |
31 | + r3 <- 10 | |
32 | +eti0: | |
33 | + SUB r2,r3 | |
34 | + BRCC eti0 | |
35 | + ADD r2,r3 | |
36 | + | |
37 | + PORTA@IO <- r2 ; Gives | |
38 | + ;PORTA@IO <- 256 - 3 ; Essai | |
39 | + ;PORTA@IO <- 3 ; Should be | |
40 | + | |
41 | +boucle: | |
42 | + sleep | |
43 | + saut boucle | |
44 | + | |
45 | +tempo: | |
46 | + ldi r24,8 | |
47 | +tempoA: | |
48 | + subi r22,1 | |
49 | + sbci r23,0 | |
50 | + sbci r24,0 | |
51 | + brcc tempoA | |
52 | + ret | ... | ... |
... | ... | @@ -0,0 +1,107 @@ |
1 | +.equ PINA = 0x00 ; définition des adresses des ports | |
2 | +.equ DDRA = 0x01 | |
3 | +.equ PORTA = 0x02 | |
4 | +.equ PINC = 0x06 | |
5 | +.equ DDRC = 0x07 | |
6 | +.equ PORTC = 0x08 | |
7 | +.equ PIND = 0x09 | |
8 | +.equ DDRD = 0x0A | |
9 | +.equ PORTD = 0x0B | |
10 | + | |
11 | +.equ SREG = 0x3F | |
12 | + | |
13 | +.equ EIMSK = 0x3D | |
14 | +.equ EICRA = 0x69 | |
15 | +.equ EICRB = 0x6A | |
16 | + | |
17 | +.equ TCNT0 = 0x46 | |
18 | +.equ OCR0A = 0x47 | |
19 | +.equ OCR0B = 0x48 | |
20 | +.equ TTCR0A = 0x24 | |
21 | +.equ TTCR0B = 0x25 | |
22 | +.equ TMSK0 = 0x6e | |
23 | + | |
24 | +.equ RAMEND = 0x21FF | |
25 | +.equ SPH = 0x3E ; initialisation de la pile | |
26 | +.equ SPL = 0x3D | |
27 | + | |
28 | +.org 0x000 | |
29 | + ; Vecteur RESET | |
30 | + jmp debut | |
31 | + | |
32 | +.org 0x0002 ; INT0 | |
33 | + jmp bouton | |
34 | + | |
35 | +.org 0x0004 ; INT1 | |
36 | + jmp bouton | |
37 | + | |
38 | +.org 0x0006 ; INT2 | |
39 | + jmp bouton | |
40 | + | |
41 | +.org 0x0008 ; INT3 | |
42 | + jmp bouton | |
43 | + | |
44 | +.org 0x002E ; Timer Overflow | |
45 | + jmp timer | |
46 | + | |
47 | +.org 0x0080 | |
48 | + | |
49 | +afficheur: | |
50 | + .DB 0x3F, 0x30, 0x6D, 0x79, 0x72, 0x5B, 0x5F, 0x31, 0x7F, 0x7B | |
51 | + ; 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 | |
52 | + | |
53 | +debut: | |
54 | + DDRA@IO <- 0xFF | |
55 | + DDRC@IO <- 0xFF | |
56 | + ;DDRD@IO <- 0x00 | |
57 | + EIMSK <- 0b00001111 | |
58 | + EICRA <- 0b10101010 ; TODO Oscillations annulables ? | |
59 | + EICRB <- 0b00000000 | |
60 | + ; Timer | |
61 | + ;TTCR0A@IO <- 0b00000001 | |
62 | + ;TTCR0B@IO <- 0b00000011 | |
63 | + ;TMSK0 <- 0b00000011 | |
64 | + ;OCR0A <- 100 | |
65 | + SEI | |
66 | + | |
67 | + PORTC@IO <- 0x00 | |
68 | + PORTA@IO <- 0x3F | |
69 | + r20 <- 0 | |
70 | + | |
71 | +boucle: | |
72 | + sleep | |
73 | + saut boucle | |
74 | + | |
75 | +valider: | |
76 | + inc r20 | |
77 | + si r20 > 9 alors r20 <- 0 | |
78 | + PORTA@IO <- afficheur@ROM[r20] | |
79 | + reti | |
80 | + | |
81 | +bouton: | |
82 | + ;TCNT0 <- 0 | |
83 | + jmp valider | |
84 | + | |
85 | +reti: | |
86 | + reti | |
87 | + | |
88 | + | |
89 | +timer: | |
90 | + ;si (PORTD@IO & 0x01) = 0 saut valider | |
91 | + ;r20 <- PORTC@IO | |
92 | + ;inc r20 | |
93 | + ;PORTC@IO <- r20 | |
94 | + ;PORTA@IO <- PIND@IO | |
95 | + reti | |
96 | + | |
97 | +tca: | |
98 | + reti | |
99 | + | |
100 | +tempo: | |
101 | + ldi r24,8 | |
102 | +tempoA: | |
103 | + subi r22,1 | |
104 | + sbci r23,0 | |
105 | + sbci r24,0 | |
106 | + brcc tempoA | |
107 | + ret | ... | ... |
ram.txt renamed to tests/ram.txt