repo.or.cz
/
urasm.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
dsforth: added `[CHAR]`
[urasm.git]
/
samples
/
misc
/
main.zas
blob
7444aea937f4b13d2a0c024a039ceedcf53edf0e
1
org #8000
2
3
;include <open-main-screen.zas>
4
;
5
ld h,87 ; y
6
ld l,127 ; x
7
ld d,50 ; radius
8
call circle
9
;
10
call int_align
11
jr .l00
12
.l00:
13
call int_align
14
jp .l01
15
.l01:
16
call int_align
17
jr .l01
18
19
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20
;; align to fixed t-state after interrupt
21
int_align:
22
ld bc,#6FF
23
di
24
ld hl,.imer
25
ld (#BEFF),hl
26
ld a,#BE
27
ld i,a
28
im 2
29
.back:
30
xor a
31
ld hl,.loop
32
ei
33
.loop:
34
dec a
35
jp (hl)
36
.imer:
37
pop hl
38
ld e,(hl)
39
rl e
40
rla
41
ld e,d
42
ld d,a
43
sub e
44
sub c
45
sbc a,a
46
or 4
47
dec b
48
and b
49
jr nz,.back
50
ret
51
52
53
circle:
54
ld c,0
55
ld b,d
56
.loop:
57
; sector 1
58
call .dot
59
; ector 4
60
ld a,b
61
neg
62
ld b,a
63
call .dot
64
; sector 5
65
ld a,c
66
neg
67
ld c,a
68
call .dot
69
; sector 8
70
ld a,b
71
neg
72
ld b,a
73
call .dot
74
; sector 3
75
ld a,c
76
ld c,b
77
ld b,a
78
call .dot
79
; sector 6
80
ld a,c
81
neg
82
ld c,a
83
call .dot
84
; sector 7
85
ld a,b
86
neg
87
ld b,a
88
call .dot
89
; sector 8
90
ld a,c
91
neg
92
ld c,a
93
call .dot
94
;
95
ld a,c
96
ld c,b
97
ld b,a
98
inc c
99
ld a,d
100
sub c
101
ld d,a
102
jr nc,.loop
103
dec b
104
ld a,d
105
add a,b
106
ld d,a
107
ld a,b
108
cp c
109
jr nc,.loop
110
ret
111
.dot:
112
push hl,de,bc
113
ld a,h
114
add a,b
115
ld b,a
116
ld a,l
117
add a,c
118
ld c,a
119
call #22E5
120
pop bc,de,hl
121
ret