]> git.defcon.no Git - z80cpm/blob - soundtest1.asm
An experiment in reading files on CP/M
[z80cpm] / soundtest1.asm
1 ; soundtest1.asm
2 ; Requires an AY-3-891x or YM2149, with address decoding making
3 ; a write/read to $50 a data write/read, a write to $51 an address write,
4 ; and any other combination being an AY Idle condition.
5 ; Supernaive bruteforce approach, with random delay values.
6 ; Produces a frequency sweep by counting down 0..255
7
8 CPU Z80
9 OUTPUT HEX
10
11 * = $100
12 START LD A, 7
13 OUT ($51), A
14 LD A, $FF
15 OUT ($50), A
16
17 LD A, 8
18 OUT ($51), A
19 LD A, 9
20 OUT ($50), A
21
22 LD A, 9
23 OUT ($51), A
24 LD A, 0
25 OUT ($50), A
26
27 LD A, $A
28 OUT ($51), A
29 LD A, 0
30 OUT ($50), A
31
32 LD A, 7
33 OUT ($51), A
34 LD A, $FE
35 OUT ($50), A
36
37 LD A, 1
38 OUT ($51), A
39 LD A, 1
40 OUT ($50), A
41
42 LD A, 0
43 OUT ($51), A
44
45 LD A, $FF
46 LOOP1 OUT ($50), A
47 PUSH AF
48 LD A, 8
49 CALL DELAY
50 POP AF
51 DEC A
52 JR NZ, LOOP1
53
54 LD A, 7
55 OUT ($51), A
56 LD A, $FF
57 OUT ($50), A
58
59 RET
60
61 ; End of main code.
62
63 ;Start of delay routine..
64 DELAY PUSH BC
65 DLY_START LD C, 10
66 DLY_LOOPO LD B, 0
67 DLY_LOOPI DJNZ DLY_LOOPI
68 DEC C
69 JR NZ, DLY_LOOPO
70 DEC A
71 JR NZ, DLY_START
72 POP BC
73 RET