-
Notifications
You must be signed in to change notification settings - Fork 0
/
z80.c
43 lines (36 loc) · 620 Bytes
/
z80.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
void interrupt_mode1_init() {
di();
ei();
}
void pause24(bc) { // uses bc, a
do {
bc--; // 6 tacts
} while (flag_nz (a = c) |= b); // 4 + 4 + 12 = 18 tacts
}
void rra(a) {
asm(" rra");
}
void rla(a) {
asm(" rla");
}
void rrca(a) {
asm(" rrca");
}
void rlca(a) {
asm(" rlca");
}
void memset(hl, bc, a) {
// hl - start address
// bc - length in bytes MINUS ONE (!)
// a - fill value
de = hl;
de++;
*hl = a;
ldir();
}
void memcpy(hl, de, bc) {
// hl - from address
// de - to address
// bc - lenght in bytes
ldir();
}