summaryrefslogtreecommitdiff
path: root/src/ubox/ubox_wait.z80
blob: 49fd0be3b088c63f0aca552d8fa2dc7e871b7bb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.globl _ubox_wait
.globl ubox_isr_wait_ticks
.globl ubox_isr_wait_tick

_ubox_wait::
	ld hl, #ubox_isr_wait_tick
	ld a, (ubox_isr_wait_ticks)
	ld c, a

wait_loop:
	ld a, (hl)
	cp c
	jr nc, wait_done
	halt
	jr wait_loop

wait_done:
	xor a
	di
	ld (hl), a
	ei
	ret