Remove gated clock and hence remove S.
[fpgaboy.git] / rom.asm
1         SECTION "a",HOME
2
3 main:
4         ld a, $FF       ; Note that we are alive.
5         ld [$FF51],a
6         
7         ld sp, $DFF0
8         
9         ld hl, $DF81
10         ld a, $80
11         ld [hl], a
12
13         ld c, $07
14         ld a, $04       ;start timer, 4.096KHz
15         ld [c], a
16 ;diqs:  ei
17 ;       ld a, $80
18 ;       ld c, $51
19 ;       ld [c], a
20 ;       jr diqs
21         call irqhand
22         ei
23 coqs: jr coqs
24
25         section "Diq", HOME[$38]
26 fuqed:
27         di
28         jr fuqed
29
30         section "fuq",HOME[$100]
31 irqhand:
32         PUSH AF
33         PUSH BC
34         PUSH DE
35         PUSH HL
36         
37         xor a
38         ld c, $0F       ; ack the irq
39         ld [c], a
40         
41         ld a, $41       ; print A
42         call putc
43         
44         ld hl, $DF81
45         inc [hl]
46         ld a, [hl]
47         ld c, $51
48         ld [c], a
49
50
51         POP HL
52         POP DE
53         POP BC
54         POP AF
55         RETI
56         db $18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE
57         db $18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE
58         db $18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE
59
60 putc:
61         ld b, 0
62         ld c, $50
63         push af
64 .waitport:
65         ld a,[c]
66         cp b
67         jr nz,.waitport
68         pop af
69         ld [c],a
70         ret
This page took 0.020392 seconds and 4 git commands to generate.