-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfoxglove.asm
51 lines (48 loc) · 1.06 KB
/
foxglove.asm
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
org 32768
start:
ld b, 30
osloop:
ld d, b
push bc
ld b, 12
sloop:
ld a, 22 ; start with 30
sub d ; subtract outer loop value
add a, b ; add inner loop value
push af ; print value - ish
call draw ; rst works too?
rr a
add a, 30
call 16
pop af ; end print
ld h, a ; load pitch into (top byte) of hl
rl h
push bc
push de
ld de, 3 ; set length
call 949 ; make beep
pop de
pop bc
djnz sloop ; do loops
pop bc
djnz osloop
ret
draw:
push bc
ld hl, 5800h ; 5800
ld a, b
add a, 190
ld b, a
dloop:
inc hl
ld (hl), b
inc hl
ld (hl), b
inc hl
ld (hl), b
inc hl
ld (hl), b
djnz dloop
pop bc
ret
dend: