-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunc.asm
More file actions
41 lines (32 loc) · 900 Bytes
/
func.asm
File metadata and controls
41 lines (32 loc) · 900 Bytes
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
.eqv VGAADDRESSINI0 0xFF000000
.eqv VGAADDRESSFIM0 0xFF012C00
.eqv VGAADDRESSINI1 0xFF100000
.eqv VGAADDRESSFIM1 0xFF112C00
# 20 pixels por seção vertical
.eqv SECV 20
.eqv SECH 40
.eqv OUTER 6
.eqv INNER 0
.eqv SOILCOLOR 0xFF
.eqv WATERCOLOR 0x33
.data
.text
test.drawPixel: li a0, 160
li a1, 120
li a2, 0x0FF
call drawPixel
li a7, 10
ecall
# - Draw Pixel - Pinta um pixel na tela usando um par de coordenadas (x,y)
# Entradas.
# a0: Coordenada X ;; a1: Coordenada Y ;; a2: Cor do pixel (byte)
# Saidas.
#
drawPixel: li t0, VGAADDRESSINI0 # Endereço do display
li t1, 320 # Largura da tela
mul t1, t1, a1 # t1 = y * 320
add t1, t1, a0 # t1 += x
add t0, t0, t1 # Juntamos tudo para ter o endereço correto
sb a2, (t0) # Colocamos o valor da cor no endereço
ret
drawSection: