-
Notifications
You must be signed in to change notification settings - Fork 0
/
mat and copy.asm
executable file
·104 lines (86 loc) · 1.22 KB
/
mat and copy.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
org 100h
jmp main
w db 10
h db 10
x dw ?
y dw ?
mat db 100 dup(15)
main:
mov ah, 0
mov al, 13h
int 10h ;set de la pantalla
call clear
call draw
jmp fin
clear: proc
sum_x:
xor ax, ax
mov al, w
;sub ax, 1
cmp ax, x
je fin ;chquea x
a_sum_x:
mov cx, x
mov dx, y
jmp pixel_w
b_sum_x:
xor bx, bx
mov bl, h
sub bx, 1
cmp bx, y
jne sum_y ;chequea y
mov y, 00h
inc x
jmp sum_x
sum_y:
inc y
jmp a_sum_x
pixel_w:
mov al, 15
mov ah, 0Ch
int 10h
jmp b_sum_x
back:
endp
ret
draw proc
lea si, mat
add_x:
xor bx, bx
mov bx, x
cmp bx, w.w
je f_draw ; si llego al maximo de x
dibujo:
mov cx, x
mov dx, y
mov ax, w.h
mul cx
add ax, dx
inc ax
mov di, ax
cmp di, 100 ; w*h
jg f_draw
add di, si
;(h*x)+y+1
mov al, b.[di]
call paint
xor cx, cx
mov cx, y
cmp cx, w.h
jne add_y
mov y, 0
inc x
jmp add_x
add_y:
inc y
jmp dibujo
f_draw:
endp
ret
paint proc
mov ah, 0Ch
int 10h
endp
ret
fin:
ret