-
Notifications
You must be signed in to change notification settings - Fork 0
/
Circulo.asm
executable file
·116 lines (96 loc) · 1.41 KB
/
Circulo.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
org 100h
jmp main
radio db ?
r2 dw ?
origen_x dw ?
origen_y dw ?
x db ?
y db ?
main:
mov ah, 0
mov al, 13h
int 10h
;set de la pantalla
mov radio, 20
mov origen_x, 32
mov origen_y, 32
call radiocuad
primer:
mov dx, origen_y
xor ax, ax
mov al, radio
sub dx, ax
mov cx, origen_x
call paint
lop:
mov dl, radio
cmp dl, x
jng fin
mov y, 0
mov al, x
add al, 1
mov x, al
call xcuad
pop cx
lup:
call ycuad
pop bx
add cx, bx
cmp cx, r2
jg dibu
jmp y_pp
y_pp:
mov al, y
add al, 1
mov y, al
jmp lup
dibu:
xor cx, cx
xor dx, dx
mov cl, x
add cx, origen_x
mov dx, origen_y
sub dl, y
call paint
inc dx
call paint
jmp lop
paint proc
mov al, 15
mov ah, 0Ch
int 10h
endp
ret
xcuad proc ;guarda en bx
xor ax, ax
mov al, x
xor bx, bx
mov bl, x
mul bl
pop bx
push ax
push bx
endp
ret
ycuad proc ;guarda en cx
xor ax, ax
mov al, y
xor bx, bx
mov bl, y
mul bl
pop bx
push ax
push bx
endp
ret
radiocuad proc
xor ax, ax
mov al, radio
xor bx, bx
mov bl, radio
mul bl
mov r2, ax
endp
ret
fin:
ret