repo_id stringlengths 5 115 | size int64 590 5.01M | file_path stringlengths 4 212 | content stringlengths 590 5.01M |
|---|---|---|---|
nqd1/FPGRARS | 2,009 | tests/riscv-tests/srai.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x00000000
srai x30, x1, 0
li x29, 0x00000000
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x80000000
srai x30, x1, 1
li x29, ... |
nqd1/FPGRARS | 2,322 | tests/riscv-tests/slt.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x00000000
li x2, 0x00000000
slt x30, x1, x2
li x29, 0
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x00000001
li x2, 0x000000... |
nqd1/FPGRARS | 1,055 | tests/riscv-tests/andi.s | .text
main:
#-------------------------------------------------------------
# Logical tests
#-------------------------------------------------------------
test_2:
li x1, 0xff00ff00
andi x30, x1, 0xffffff0f
li x29, 0xff00ff00
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x0ff00ff0
andi x30, x1, 0x0f0
li x2... |
nqd1/FPGRARS | 2,172 | tests/riscv-tests/mulhu.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x00000000
li x2, 0x00000000
mulhu x30, x1, x2
li x29, 0x00000000
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x00000001
li x... |
nqd1/FPGRARS | 1,927 | tests/riscv-tests/srli.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_3:
li x1, 0x80000000
srli x30, x1, 1
li x29, 0x40000000
li gp, 3
bne x30, x29, fail
test_4:
li x1, 0x80000000
srli x30, x1, 7
li x2... |
nqd1/FPGRARS | 2,187 | tests/riscv-tests/mulhsu.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x00000000
li x2, 0x00000000
mulhsu x30, x1, x2
li x29, 0x00000000
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x00000001
li ... |
nqd1/FPGRARS | 1,939 | tests/riscv-tests/slti.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x00000000
slti x30, x1, 0x000
li x29, 0
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x00000001
slti x30, x1, 0x001
li x29, 0... |
nqd1/FPGRARS | 1,115 | tests/riscv-tests/rem.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 20
li x2, 6
rem x30, x1, x2
li x29, 2
li gp, 2
bne x30, x29, fail
test_3:
li x1, -20
li x2, 6
rem x30, x1, x2
li x29, -2
... |
nqd1/FPGRARS | 1,138 | tests/riscv-tests/remu.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 20
li x2, 6
remu x30, x1, x2
li x29, 2
li gp, 2
bne x30, x29, fail
test_3:
li x1, -20
li x2, 6
remu x30, x1, x2
li x29, 2
... |
nqd1/FPGRARS | 1,172 | tests/riscv-tests/and.s | .text
main:
#-------------------------------------------------------------
# Logical tests
#-------------------------------------------------------------
test_2:
li x1, 0xff00ff00
li x2, 0x0f0f0f0f
and x30, x1, x2
li x29, 0x0f000f00
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x0ff00ff0
li x2, 0xf0f0f0f... |
nqd1/FPGRARS | 2,888 | tests/riscv-tests/sll.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x00000001
li x2, 0
sll x30, x1, x2
li x29, 0x00000001
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x00000001
li x2, 1
sll x... |
nqd1/FPGRARS | 2,138 | tests/riscv-tests/addi.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x00000000
addi x30, x1, 0x000
li x29, 0x00000000
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x00000001
addi x30, x1, 0x001
li x29, ... |
nqd1/FPGRARS | 2,340 | tests/riscv-tests/sltu.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x00000000
li x2, 0x00000000
sltu x30, x1, x2
li x29, 0
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x00000001
li x2, 0x00000... |
nqd1/FPGRARS | 1,956 | tests/riscv-tests/sltiu.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x00000000
sltiu x30, x1, 0x000
li x29, 0
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x00000001
sltiu x30, x1, 0x001
li x29,... |
nqd1/FPGRARS | 1,137 | tests/riscv-tests/divu.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 20
li x2, 6
divu x30, x1, x2
li x29, 3
li gp, 2
bne x30, x29, fail
test_3:
li x1, -20
li x2, 6
divu x30, x1, x2
li x29, 71... |
nqd1/FPGRARS | 2,401 | tests/riscv-tests/add.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x00000000
li x2, 0x00000000
add x30, x1, x2
li x29, 0x00000000
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x00000001
li x2, 0x0000... |
nqd1/FPGRARS | 1,210 | tests/riscv-tests/xor.s | .text
main:
#-------------------------------------------------------------
# Logical tests
#-------------------------------------------------------------
test_2:
li x1, 0xff00ff00
li x2, 0x0f0f0f0f
xor x30, x1, x2
li x29, 0xf00ff00f
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x0ff00ff0
li x2, 0x... |
nqd1/FPGRARS | 1,125 | tests/riscv-tests/div.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 20
li x2, 6
div x30, x1, x2
li x29, 3
li gp, 2
bne x30, x29, fail
test_3:
li x1, -20
li x2, 6
div x30, x1, x2
li x29, -3
l... |
nqd1/FPGRARS | 2,157 | tests/riscv-tests/mulh.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x00000000
li x2, 0x00000000
mulh x30, x1, x2
li x29, 0x00000000
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x00000001
li x2... |
nqd1/FPGRARS | 3,018 | tests/riscv-tests/srl.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x80000000
li x2, 0
srl x30, x1, x2
li x29, 0x80000000
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x80000000
li x2, 1
srl ... |
nqd1/FPGRARS | 2,338 | tests/riscv-tests/sub.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x00000000
li x2, 0x00000000
sub x30, x1, x2
li x29, 0x00000000
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x00000001
li x2,... |
nqd1/FPGRARS | 2,345 | tests/riscv-tests/mul.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_32:
li x1, 0x00007e00
li x2, 0xb6db6db7
mul x30, x1, x2
li x29, 0x00001200
li gp, 32
bne x30, x29, fail
test_33:
li x1, 0x00007fc0
li ... |
nqd1/FPGRARS | 1,953 | tests/riscv-tests/slli.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li x1, 0x00000001
slli x30, x1, 0
li x29, 0x00000001
li gp, 2
bne x30, x29, fail
test_3:
li x1, 0x00000001
slli x30, x1, 1
li x29, 0x00000... |
nqd1/FPGRARS | 5,980 | tests/riscv-tests/unimplemented/fcvt_wd.s |
.text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: li gp, 2
la a0, test_2_data
fld f0, 0(a0)
fld f1, 8(a0)
fld f2, 16(a0)
lw a3, 24(a0)
fcvt.w.d a0, f0, rtz
fsflags a1, x0
li a2, 0x01
bn... |
nqd1/FPGRARS | 3,328 | tests/riscv-tests/unimplemented/fadd.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: li gp, 2
la a0, test_2_data
flw f0, 0(a0)
flw f1, 4(a0)
flw f2, 8(a0)
lw a3, 12(a0)
fadd.s f3, f0, f1
fmv.x.s a0, f3
fsflags a1, x0
l... |
nqd1/FPGRARS | 2,305 | tests/riscv-tests/unimplemented/fdiv.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: li gp, 2
la a0, test_2_data
flw f0, 0(a0)
flw f1, 4(a0)
flw f2, 8(a0)
lw a3, 12(a0)
fdiv.s f3, f0, f1
fmv.x.s a0, f3
fsflags a1, x0
l... |
nqd1/FPGRARS | 3,895 | tests/riscv-tests/unimplemented/faddd.s |
.text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: li gp, 2
la a0, test_2_data
fld f0, 0(a0)
fld f1, 8(a0)
fld f2, 16(a0)
lw a3, 24(a0)
lw t1, 28(a0)
fadd.d f3, f0, f1
fsd f3, 0(a0)
lw t... |
nqd1/FPGRARS | 1,461 | tests/riscv-tests/unimplemented/ldstd.s | .text
main:
la s0, tdat
test_2: fld f2, 0(s0)
fsd f2, 16(s0)
lw a0, 16(s0)
lw a1, 20(s0)
la x15, test_2_data
lw x29, 0(x15)
lw x15, 4(x15)
li gp, 2
bne a0, x29, fail
bne a1, x15, fail
.data
.align 3
test_2_data: .word 0xbf800000, 0x40000000
.text
test_3: fld f2, 0(s0)
fsw f2, 16(s0)
lw a0, 16(s0)... |
nqd1/FPGRARS | 2,300 | tests/riscv-tests/unimplemented/fcvtd.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: li gp, 2
la a0, test_2_data
lw a3, 0(a0)
lw a4, 4(a0)
li a1, 2
fcvt.d.w f0, a1
fsd f0, 0(a0)
lw a1, 4(a0)
lw a0, 0(a0)
fsflags x0
bne a... |
nqd1/FPGRARS | 4,593 | tests/riscv-tests/unimplemented/fmaddd.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: li gp, 2
la a0, test_2_data
fld f0, 0(a0)
fld f1, 8(a0)
fld f2, 16(a0)
lw a3, 24(a0)
lw t1, 28(a0)
fmadd.d f3, f0, f1, f2
fsd f3, 0(a0)
... |
nqd1/FPGRARS | 3,580 | tests/riscv-tests/unimplemented/fmadd.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: li gp, 2
la a0, test_2_data
flw f0, 0(a0)
flw f1, 4(a0)
flw f2, 8(a0)
lw a3, 12(a0)
fmadd.s f3, f0, f1, f2
fmv.x.s a0, f3
fsflags a1, ... |
nqd1/FPGRARS | 3,193 | tests/riscv-tests/unimplemented/fdivd.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: li gp, 2
la a0, test_2_data
fld f0, 0(a0)
fld f1, 8(a0)
fld f2, 16(a0)
lw a3, 24(a0)
lw t1, 28(a0)
fdiv.d f3, f0, f1
fsd f3, 0(a0)
lw t2... |
nqd1/FPGRARS | 1,330 | tests/riscv-tests/unimplemented/fclass.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2:
li a0, 0xff800000
fmv.s.x fa0, a0
fclass.s a0, fa0
li x29, 1
li gp, 2
bne a0, x29, fail
test_3:
li a0, 0xbf800000
fmv.s.x fa0, a0
f... |
nqd1/FPGRARS | 1,398 | tests/riscv-tests/unimplemented/recodingd.s | .text
main:
# Make sure infinities with different mantissas compare as equal.
fld f0, minf, a0
fld f1, three, a0
fmul.d f1, f1, f0
test_2: feq.d a0, f0, f1
li x29, 1
li gp, 2
bne a0, x29, fail
test_3: fle.d a0, f0, f1
li x29, 1
li gp, 3
bne a0, x29, fail
test_4: flt.d a0, f0, f1
li x29, 0
li gp,... |
nqd1/FPGRARS | 5,602 | tests/riscv-tests/unimplemented/fcvt_w.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: li gp, 2
la a0, test_2_data
flw f0, 0(a0)
flw f1, 4(a0)
flw f2, 8(a0)
lw a3, 12(a0)
fcvt.w.s a0, f0, rtz
fsflags a1, x0
li a2, 0x01
... |
nqd1/FPGRARS | 2,547 | tests/riscv-tests/unimplemented/move.s | .text
main:
test_2:
csrwi fcsr, 1
li a0, 0x1234
fssr a1, a0
li x29, 1
li gp, 2
bne a1, x29, fail
test_3:
frsr a0
li x29, 0x34
li gp, 3
bne a0, x29, fail
test_4:
frflags a0
li x29, 0x14
li gp, 4
bne a0, x29, fail
test_5:
csrrwi a0, frm, 2
li x29, 0x01
li gp, 5
bne a0, x29, fail
test_6:... |
nqd1/FPGRARS | 4,447 | tests/riscv-tests/unimplemented/fcmp.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: li gp, 2
la a0, test_2_data
flw f0, 0(a0)
flw f1, 4(a0)
flw f2, 8(a0)
lw a3, 12(a0)
feq.s a0, f0, f1
fsflags a1, x0
li a2, 0x00
bne a... |
nqd1/FPGRARS | 5,962 | tests/riscv-tests/unimplemented/fmin.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: li gp, 2
la a0, test_2_data
flw f0, 0(a0)
flw f1, 4(a0)
flw f2, 8(a0)
lw a3, 12(a0)
fmin.s f3, f0, f1
fmv.x.s a0, f3
fsflags a1, x0
l... |
nqd1/FPGRARS | 5,193 | tests/riscv-tests/unimplemented/fcmpd.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: li gp, 2
la a0, test_2_data
fld f0, 0(a0)
fld f1, 8(a0)
fld f2, 16(a0)
lw a3, 24(a0)
lw t1, 28(a0)
feq.d a0, f0, f1
li t2, 0
fsflags ... |
nqd1/FPGRARS | 1,894 | tests/riscv-tests/unimplemented/fclassd.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: la a0, test_2_data
fld fa0, 0(a0)
fclass.d a0, fa0
li x29, 1
li gp, 2
bne a0, x29, fail
.data
.align 3
test_2_data: .word 0, 0xfff00000... |
nqd1/FPGRARS | 6,818 | tests/riscv-tests/unimplemented/fmind.s | .text
main:
#-------------------------------------------------------------
# Arithmetic tests
#-------------------------------------------------------------
test_2: li gp, 2
la a0, test_2_data
fld f0, 0(a0)
fld f1, 8(a0)
fld f2, 16(a0)
lw a3, 24(a0)
lw t1, 28(a0)
fmin.d f3, f0, f1
fsd f3, 0(a0)
lw t2... |
nqd1/FPGRARS | 1,466 | benches/samples/video.s | #######################################################
# #
# Colors the screen red/blue many times #
# #
#######################################################
.data
times: .word 30
color: .byte 0xf8... |
nqd1/FPGRARS | 2,358 | benches/samples/sort.s | #############################################################
## ##
## Fills an array with the worst case for insertion sort ##
## and prints it sorted ##
## ##
##########... |
nqd1/FPGRARS | 1,683 | samples/test/random_comparison.s | .global main
.eqv WRITE_INT 1
.eqv WRITE_CHAR 11
.eqv EXIT 10
.macro dump_registers()
addi sp sp -4
sw ra 0(sp)
jal ra, dump_registers.fn
lw ra 0(sp)
addi sp sp 4
.end_macro
.text
main:
.include "randomly_generated_instructions.s"
exit:
li a7 EXIT
li a0 0
ecall
dump_registers.fn... |
nqd1/FPGRARS | 5,123 | samples/test/celeste/MACROSv21.s | #########################################################################
# Definie e Macros v2.1 #
# Marcus Vinicius Lamar #
# 2020/1 #
#########################################################################
######### Verifica se eh a DE1-SoC ###############
.macro DE1(%reg,%salto)
li %reg, 0x100... |
nqd1/FPGRARS | 62,902 | samples/test/celeste/SYSTEMv21.s | #########################################################################
# Rotina de tratamento de excecao e interrupcao v2.1 #
# Lembre-se: Os ecalls originais do Rars possuem precedencia sobre #
# estes definidos aqui #
# Os ecalls 1XX usam o BitMap Display e Keyboard Display MMIO Tools #
# Usar o RARS14... |
nqd1/FPGRARS | 5,733 | samples/test/Engine3D/test/3d_model.s | .include "../src/consts.s"
.include "../src/macros.s"
.data
.include "../src/data.s"
#.include "../data/triangle.data"
#.include "../data/humanoid.data"
#.include "../data/triangle2.data"
#.include "../data/cube.data"
#.include "../data/cup.data"
.include "../data/tree.data"
.align 2
VECTOR3s:
.space VECTOR3s_BYTE_... |
nqd1/FPGRARS | 10,496 | samples/test/Engine3D/src/graphics.s | #########################################################
# a0 = Vector3_SRC
# a1 = Vector2_DEST
#########################################################
PROJECT_3D_2D:
flw ft0, VECTOR3_F_X(a0)
flw ft1, VECTOR3_F_Y(a0)
flw ft2, VECTOR3_F_Z(a0)
fabs.s ft2, ft2
li t0, EPSILON
fmv.s.x ft4, t0
fmax.s ft2, ... |
nqd1/FPGRARS | 1,924 | samples/test/Engine3D/src/math.s | ##########################################################
# Calculates cos x with a maximum error of about 0.00452.
# Always executes exactly 53 instructions.
##########################################################
# fa0 = x
##########################################################
COS:
li t0, HALF_PI_S
fmv.s.x ... |
nqd1/FPGRARS | 2,950 | samples/test/Engine3D/src/triangle.s | #########################################################
# a0 = frame
# a1 = &v1
# a2 = &v2
# a3 = &v3
#########################################################
FLAT_TOP_TRIANGLE:
# ft0 = m0 = (v3.x-v1.x) / (v3.y-v1.y)
flw ft0, VECTOR_S_X(a1)
flw ft1, VECTOR_S_X(a3)
fsub.s ft0, ft1, ft0
flw ft1, VECTOR_S_Y(a3)
f... |
nqd1/FPGRARS | 1,681 | samples/test/Engine3D/src/draw.s | DRAW_BACKGROUND:
GET_BUFFER_TO_DRAW(t0)
li t1, NUMBER_OF_SCREEN_PIXELS
add t1, t0, t1
loop_draw_back_ground:
bge t0, t1, end_draw_back_ground
sw a0, 0(t0)
addi t0, t0, 4
j loop_draw_back_ground
end_draw_back_ground:
ret
#########################################################
# a0 = color
# a1 = x
# a2 = y... |
nqd1/FPGRARS | 1,289 | samples/test/Engine3D/src/consts.s | # ZBUFFER
.eqv NEAR 0x3f000000 # 0.5
.eqv FAR 0x40a00000 # 5.0
.eqv ZBUFFER_SIZE 76800 # 4 * DISPLAY_WIDTH * DISPLAY_HEIGHT
#.eqv ZBUFFER_SIZE 19200 # 4 * DISPLAY_WIDTH * DISPLAY_HEIGHT
#Colors
.eqv RED_COLOR 0x007
.eqv GREEN_COLOR 0x038
.eqv BLUE_COLOR 0x0C0
.eqv TRANSP_COLOR 199
# Video
.eqv CURRENT_DISPLAY_FRAME_A... |
nqd1/FPGRARS | 1,710 | samples/test/Engine3D/src/macros.s | ### Color Macros #####
.macro RED(%dest, %src)
andi %dest, %src, 0x007
.end_macro
.macro GREEN(%dest, %src)
andi %dest, %src, 0x038
srli %dest, %dest, 3
.end_macro
.macro BLUE(%dest, %src)
andi %dest, %src, 0x0C0
srli %dest, %dest, 6
.end_macro
.macro RGB(%dest, %r, %g, %b)
andi %r, %r, 0x07
andi %g, ... |
nqd1/FPGRARS | 6,730 | samples/test/celeste/Exemplos/testeECALLv21.s | # Teste dos syscalls 1xx que usam o SYSTEMv21.s
# Conectar o BitMap Display e o KD MMIO para executar
# na DE1-SoC e no Rars deve ter o mesmo comportamento sem alterar nada
# Usar no minimo o RARSv14_Custom4 (misa)
# 2020/1
.include "../MACROSv21.s"
.data
msg1: .string "Organizacao Arquitetura de Computadores ... |
nqd1/FPGRARS | 5,451 | samples/test/celeste/Exemplos/sort_t.s | .eqv N 500
.data
#vetor: .word 100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,... |
nqd1/FPGRARS | 2,049 | samples/test/celeste/Exemplos/bitmap.s | ##################################################################
# Programa de exemplo de uso de frames no Bitmap Display Tool #
# OAC Mar 2020 #
# Marcus Vinicius Lamar #
##################################################################
#
# Use o programa paint.net (baixar da inte... |
nqd1/FPGRARS | 1,349 | samples/test/celeste/Exemplos/keypoll.s | #################################################
# Programa de exemplo para Polling do teclado #
# usando o Keyboard Display MMIO Tool #
# ISC Abr 2018 #
# Marcus Vinicius #
#################################################
# escolha e descomente um dos dois jals no programa
#
.text
# Pollin... |
nqd1/FPGRARS | 1,602 | samples/test/celeste/Exemplos/bitmap2.s | #########################################################
# Programa de exemplo de uso do Bitmap Display Tool #
# OAC Fevereiro 2019 #
# Marcus Vinicius Lamar #
#########################################################
#
# Cuidar que o arquivo display.bin deve estar no mesmo diretrio do Rars!
# Use o p... |
nqd1/FPGRARS | 6,731 | samples/test/celeste/Exemplos/testeECALLv21_fpgrars.s | # Teste dos syscalls 1xx que usam o SYSTEMv21.s
# Conectar o BitMap Display e o KD MMIO para executar
# na DE1-SoC e no Rars deve ter o mesmo comportamento sem alterar nada
# Usar no minimo o RARSv14_Custom4 (misa)
# 2020/1
.include "../MACROSv21.s"
.data
msg1: .string "Organizacao Arquitetura de Computadores ... |
nqd1/FPGRARS | 1,166 | samples/test/celeste/Exemplos/keyint.s | ####################################################
# Programa de exemplo de interrupao do teclado #
# usando o Keyboard Display MMIO Tool #
# ISC Set 2019 #
# Marcus Vinicius #
####################################################
.text
# programa do usurio
la tp,KDInterrupt # ... |
nqd1/FPGRARS | 4,179 | samples/test/celeste/Prototipos/momentum.s | .data
h_state: .word 0
v_state: .word 0
speed: .word 0, 0
position: .word 0, 100
old_position: .word 0, 100
old_background: .space 256
player: .space 256
frogger: .string "fase1.bin"
character: .string "player.bin"
.text
lt: #game loop
jal INPUT #get user input
la t2, h_state #get h_state (-1, 0, 1)
lw t0, 0(t2)... |
nqd1/FPGRARS | 5,123 | samples/test/celeste/Main/MACROSv21.s | #########################################################################
# Definie e Macros v2.1 #
# Marcus Vinicius Lamar #
# 2020/1 #
#########################################################################
######### Verifica se eh a DE1-SoC ###############
.macro DE1(%reg,%salto)
li %reg, 0x100... |
nqd1/FPGRARS | 62,902 | samples/test/celeste/Main/SYSTEMv21.s | #########################################################################
# Rotina de tratamento de excecao e interrupcao v2.1 #
# Lembre-se: Os ecalls originais do Rars possuem precedencia sobre #
# estes definidos aqui #
# Os ecalls 1XX usam o BitMap Display e Keyboard Display MMIO Tools #
# Usar o RARS14... |
nqd1/FPGRARS | 1,178 | samples/test/celeste/Main/input.s | #a0 = primeira flag
INPUT:
addi sp, sp, -4
sw ra, 0(sp)
li t1,0xFF200000 # carrega o endere�o de controle do KDMMIO
lw t0,0(t1) # Le bit de Controle Teclado
andi t0,t0,0x0001 # mascara o bit menos significativo
beq t0,zero,FIM_INPUT # Se n�o h� tecla pressionada ent�o vai para FIM
lw t2,4(t1) # ... |
nqd1/FPGRARS | 30,984 | samples/test/celeste/Main/Bad_Apple.s | .data
# Volume, Nota atual, número de notas, pausa, tempo, nota, tempo, nota, tempo...
# Demonstração:
# Track0: .word 127, 1, 2, 0, 0, 35, 2664
# Track1: .word 127, 1, 3, 0, 333, 36, 2664, 36, 2664
# Track2: .word 127, 1, 4, 0, 666, 37, 2664, 37, 2664, 37, 2664
# Track3: .word 127, 1, 5, 0, 999, 38, 2664, 38, 2664, ... |
nqd1/FPGRARS | 1,980 | samples/test/celeste/Main/musica.s | ## MIDI Multitracking
# Exemplo de como setar uma musica
.include "Bad_Apple.s" # Modelo: Volume, Nota atual, número de notas, pausa, tempo, nota, tempo, nota, tempo...
.data
Musica0: .word 8, 0, 0, 0, 0, 0, 0, 0, 0
.text
# Rotina
SET_MUSIC: la a0, Musica0
la a1, Track0
sw a1, 4(a0)
la a1, Track1
sw a1, 8(a0)... |
nqd1/FPGRARS | 4,102 | samples/test/celeste/Main/fisica.s | .data
.eqv gravity_acc 1
.eqv wall_slide_acc 1
.eqv dash_speed
.eqv h_resist 1
.eqv m_h_resist -1
.eqv v_resist 1
.eqv h_acc 5
.eqv m_h_acc -5
.eqv v_acc -8
.eqv h_max 10
.eqv m_h_max -10
.eqv v_max 10
.eqv m_v_max -10
.text
FISICA:
addi sp, sp, -4
sw ra, 0(sp)
lw t0, (a0) #h_state (-1,0,1)
... |
nqd1/FPGRARS | 7,321 | samples/test/celeste/Main/move.s | #h_state: 0
#v_state: 4
#grounded: 8
#dash_key: 12
#dash: 16
#wall: 20
#a0=position(address) a1=speed(address) a2=colider a3=flags
MOVE:
addi sp, sp, -24
sw ra, 0(sp)
sw s0, 4(sp)
sw s1, 8(sp)
sw s2, 12(sp)
sw s3, 16(sp)
sw s4, 20(sp)
mv s0, a0
mv s1, a1
mv s3, a2
mv s4, a3
lw s2, 0(s1) #s2 = x speed
... |
nqd1/FPGRARS | 2,371 | samples/test/celeste/Main/render.s | #
#a0 = old_background
#a1 = old_position
#a2 = position
#a3 = player
.data
morangos_text: .string "Pontos: "
.text
RENDER:
addi sp, sp, -20
sw ra, 0(sp)
sw s0, 4(sp)
sw s1, 8(sp)
sw s2, 12(sp)
sw s3, 16(sp)
mv s0, a0
mv s1, a1
mv s2, a2
mv s3 a3
call DRAW_PLAYER
la a0, morangos_text
li a1, 4
li a2, ... |
nqd1/FPGRARS | 6,604 | samples/test/celeste/Main/main.s |
.include "MACROSv21.s"
.data
h_state: .word 0
v_state: .word 0
grounded: .word 0
dash_key: .word 0
dash: .word 0
wall: .word 0
speed: .word 0, 4
position: .word 72, 120
old_position: .word 0, 100
old_background: .space 256
player: .space 256
player_low: .space 256
character: .string "playerlow.bin"
character_low: .st... |
nqd1/FPGRARS | 1,355 | samples/test/Mage-Embler/test/map_test.s | .include "../src/data.s"
.include "../src/consts.s"
.include "../src/macros.s"
.text
jal INIT_VIDEO
la a0, MAPS
la a1, CORRESPONDENCE_ARR_MAP0
la t0, PLAYERS
li t1, SCREEN_CENTER_X
sb t1, PLAYER_BPOS_X(t0)
li t1, 10
sb t1, PLAYER_BPOS_Y(t0)
li t1, 1
sb t1, PLAYER_BIS_ALLY(t0)
sb zero, PLAYER_BELEMENT(t0)
GAME:
la a0... |
nqd1/FPGRARS | 1,058 | samples/test/Mage-Embler/test/cursor_test.s | .include "../src/data.s"
.include "../src/consts.s"
.include "../src/macros.s"
.text
jal INIT_VIDEO
GAME:
li a0, 0x09090909
JAL DRAW_BACKGROUND
jal DRAW_CURSOR
jal INPUT
jal SWAP_FRAMES
j GAME
INPUT:
li t1, KBD_CONTROL # carrega o endere�o de controle do KDMMIO
lw t0, 0(t1) # Le bit de... |
nqd1/FPGRARS | 1,172 | samples/test/Mage-Embler/test/combat_test.s | .include "../src/data.s"
.include "../src/consts.s"
.include "../src/macros.s"
.data:
PLAYER_1: .string "Player1"
PLAYER_2: .string "Player2"
.align 2
PLAYER1: .word,0, 0
.byte 20, 20
.half 0, 0
.byte 0, 0
.word PLAYER_1
.byte AL_AZUL
.byte 5, 50, 1
PLAYER2: .word 0, 0
.byte 25, 15
.half 0, 0
.byte 0, 0
.word PLA... |
nqd1/FPGRARS | 1,550 | samples/test/Mage-Embler/test/menu_test.s | # Mova pelo menu e aperte enter para trocar de cor
.include "../src/data.s"
.include "../src/consts.s"
.include "../src/macros.s"
.data
opcao1: .string "vermelho"
opcao2: .string "amarelo"
opcao3: .string "azul"
opcoes: .word opcao1, opcao2, opcao3
selected_option: .byte 0
is_selected: .byte 0
tile_to_draw: .byte 0... |
nqd1/FPGRARS | 2,061 | samples/test/Mage-Embler/src/utils.s | ###########################################################
# Retorna o tamanho da string em a1, quebrando a convensao#
# retornando a posicao selecionada 0 index #
######################################################## #
# a0 = endereco da string #
###################... |
nqd1/FPGRARS | 35,002 | samples/test/Mage-Embler/src/combat.s |
#########################################################
# Desenha o modo de combate na master
#########################################################
# a0 = endereco para o objeto do player1 #
# a1 = endereco para o objeto do player2 #
# a2 = is_combat 0 - ninguem 1 player1 2 play... |
nqd1/FPGRARS | 62,961 | samples/test/Mage-Embler/src/SYSTEMv21.s | #########################################################################
# Rotina de tratamento de excecao e interrupcao v2.1 #
# Lembre-se: Os ecalls originais do Rars possuem precedencia sobre #
# estes definidos aqui #
# Os ecalls 1XX usam o BitMap Display e Keyboard Display MMIO Tools #
# Usar o RARS14... |
nqd1/FPGRARS | 1,575 | samples/test/Mage-Embler/src/input.s | #####################################################
# Retorna uma direçao nos registradores a0 e a1 a partir
# da tecla que foi pressionada, da seguinte forma:
# keyCode | a0 | a1
# 'w' | 0 | -1
# 'a' | -1 | 0
# 's' | 0 | 1
# 'd' | 1 | 0
# Caso keyCode nao seja uma das letras acima retorna
# a0 = ... |
nqd1/FPGRARS | 2,731 | samples/test/Mage-Embler/src/dialog.s | #########################################################
# Cria uma caixa de dialogo a com as informacoes #
# Desejadas #
#########################################################
# a0 = endereco da string #
# a1 = cor da string ... |
nqd1/FPGRARS | 23,980 | samples/test/Mage-Embler/src/video.s | #################################################
# Organiza os frames do buffer de video #
#################################################
INIT_VIDEO:
# Setting current view frame
li t0, CURRENT_DISPLAY_FRAME_ADRESS
# Force start on frame 0
sw zero,0(t0)
# Setting current draw frame
la t0, FRAME_TO_DR... |
nqd1/FPGRARS | 24,646 | samples/test/Mage-Embler/src/game_logic.s | ######################################################################
# Roda a lógica principal do jogo baseado no GAME_STATE.
# Retorna em a0 o estado para o RUN_GAME_RENDER.
######################################################################
RUN_GAME_LOGIC:
addi sp, sp, -4
sw ra, 0(sp)
la t0, GAME_STATE
lb t... |
nqd1/FPGRARS | 7,369 | samples/test/Mage-Embler/src/consts.s | # Video
.eqv CURRENT_DISPLAY_FRAME_ADRESS 0xFF200604
.eqv BUFFER_ADRESS 0xFF000000
.eqv NUMBER_OF_PIXELS 0x12C00
.eqv TILE_SIZE 16
.eqv NUMBER_OF_TILES_IN_IMAGE 89
.eqv SCREEN_SIZE 320
.eqv KBD_CONTROL 0xFF200000
.eqv CURSOR_IMG tiles
.eqv CURSOR_ANIM_DELAY 200 # time between each frame of cursor animation
.eqv SCREEN_... |
nqd1/FPGRARS | 3,361 | samples/test/Mage-Embler/src/audio.s | #################################################
# Toca um som sem interromper o jogo.
# É necessário passar como argumento uma lista de
# words com as seguintes informacoes:
# tamanho, i, MIN_WORD, notas/duracoes
##################################################
# a0 = endereco da lista com informacoes do audio
# no... |
nqd1/FPGRARS | 8,107 | samples/test/Mage-Embler/src/game_render.s | ######################################################################
# Roda a o render principal do jogo baseado no estado do jogo
# passado em a0.
######################################################################
# a0 = estado a executar
######################################################################
RUN... |
nqd1/FPGRARS | 26,127 | samples/test/Mage-Embler/src/player.s | ############################################################
# Player
# Alterar PLAYERS e PLAYER_BYTE_SIZE ao mudar o tamanho.
############################################################
# Classe representando os jogadores, tanto aliados
# quanto inimigos.
############################################################
... |
nqd1/FPGRARS | 21,392 | samples/test/Mage-Embler/src/data.s | .include "../src/consts.s"
.data
FRAME_TO_DRAW: .byte 0
# Estados
IN_COMBAT: .byte 0 # 0 - fora de comabate 1 - aliado ataca primeiro 2 - inimigo ataca primeiro
COMBAT_STEP: .byte 0 # idle - primeiro atack - tira vida - segundo atack - tira vida
COMBAT_LAST_TIME: .word 0
.align 2
PLAYERS_IN_COMBAT: .wo... |
nqd1/FPGRARS | 11,729 | samples/test/Mage-Embler/src/cursor.s | #########################################################
# Desenha o cursor em CURSOR_POS. a0 determina
# se a cor do cursor será vermelha ou não
#########################################################
# a0 = attackMode
#########################################################
DRAW_CURSOR:
addi sp, sp, -4
sw ra, 0... |
nqd1/FPGRARS | 7,458 | samples/test/Mage-Embler/src/map.s | ######################################################################
# Desenha o mapa no modo debug.
######################################################################
# a0 = endereco do mapa
######################################################################
DRAW_MAP_DEBUG:
addi sp, sp, -12
sw ra, 0(sp)
sw... |
nqd1/FPGRARS | 4,003 | samples/test/Mage-Embler/src/menu.s | #########################################################
# Cria um menu a partir de opcoes dadas por strings #
# retornando a posicao selecionada 0 index #
#########################################################
# a0 = quantidade de opcoes #
# a1 = endereco das strings... |
nqd1/FPGRARS | 1,348 | samples/test/Mage-Embler/src/macros.s | ########## Put the buffer to draw on register #########
.macro GET_BUFFER_TO_DRAW(%reg)
addi sp, sp, -4
sw s11, 0(sp)
la %reg, FRAME_TO_DRAW
lb %reg, 0(%reg)
slli %reg, %reg, 20
li s11, BUFFER_ADRESS
add %reg, s11, %reg
lw s11, 0(sp)
addi sp, sp, 4
.end_macro
######### Verifica se eh a DE1-SoC #############... |
nqd1/FPGRARS | 1,813 | samples/test/Mage-Embler/src/game_audio.s | ######################################################################
# Roda a lógica de audio do jogo baseado no
######################################################################
RUN_GAME_AUDIO:
addi sp, sp, -4
sw ra, 0(sp)
la t0, AUDIO_STATE
lb t0, 0(t0)
li t1, AUDIO_STATE_NOTHING
beq t0, t1, nothing_ru... |
nuew/varian620i | 2,174 | sqrt/sr.S | *
* This is in the public domain in the United States, as it is a work
* of the U.S. Government made by an employee in the course of their
* official duties per 17 USC 105.
*
* SUBROUTINE SR COMPUTES THE SQUARE ROOT OF THE INPUT A REGISTER.
* CERTAIN STRINGENT LIMITS ARE PLACED ON THE INPUT. IT MUST ALWAYS BE
* A WHOLE... |
oizys7/rCore_leaning | 1,053 | os/src/link_app.S | .align 3
.section .data
.global _num_app
_num_app:
.quad 5
.quad app_0_start
.quad app_1_start
.quad app_2_start
.quad app_3_start
.quad app_4_start
.quad app_4_end
.section .data
.global app_0_start
.global app_0_end
app_0_start:
.incbin "../user/target/riscv64g... |
oizys7/rCore_leaning | 1,620 | os/src/trap/trap.S | .altmacro
.macro SAVE_GP n
sd x\n, \n*8(sp)
.endm
.macro LOAD_GP n
ld x\n, \n*8(sp)
.endm
.section .text
.globl __alltraps
.globl __restore
.align 2
# 实现 Trap 上下文保存
__alltraps:
csrrw sp, sscratch, sp
# now sp->kernel stack, sscratch->user stack
# allocate a TrapContext on kernel stac... |
Okm165/sp1-poseidon2 | 8,450 | crates/zkvm/entrypoint/src/memset.s | // This is musl-libc memset commit 37e18b7bf307fa4a8c745feebfcba54a0ba74f30:
//
// src/string/memset.c
//
// This was compiled into assembly with:
//
// clang-14 -target riscv32 -march=rv32im -O3 -S memset.c -nostdlib -fno-builtin -funroll-loops
//
// and labels manually updated to not conflict.
//
// musl as a wh... |
Okm165/sp1-poseidon2 | 11,855 | crates/zkvm/entrypoint/src/memcpy.s | // This is musl-libc commit 37e18b7bf307fa4a8c745feebfcba54a0ba74f30:
//
// src/string/memcpy.c
//
// This was compiled into assembly with:
//
// clang-14 -target riscv32 -march=rv32im -O3 -S memcpy.c -nostdlib -fno-builtin -funroll-loops
//
// and labels manually updated to not conflict.
//
// musl as a whole is ... |
oknotokcomputer/roar | 1,406 | libcrosvm/kernel_loader/src/test_elf.S | # Copyright 2022 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Build instructions:
# x86_64-linux-gnu-as test_elf.S -o test_elf.o
# x86_64-linux-gnu-ld test_elf.o -o test_elf.bin -T test_elf.ld
.intel_syntax noprefix
.section ... |
OmarBenGacem/osmium | 1,671 | kernel/boot.s | .option norvc
.section .reset.boot, "ax",@progbits
.global _start
.global abort
_start:
/* Set up stack pointer. */
lui sp, %hi(stack_end)
addi sp, sp, %lo(stack_end)
/* Now jump to the rust world; __start_rust. */
j __start_rust
.section .elfdata
.incbin "../misc/bin/nop"
.option n... |
Omerhrr/Tswapper | 71,202 | .cargo/registry/src/index.crates.io-6f17d22bba15001f/blake3-1.5.1/c/blake3_sse2_x86-64_windows_gnu.S | .intel_syntax noprefix
.global blake3_hash_many_sse2
.global _blake3_hash_many_sse2
.global blake3_compress_in_place_sse2
.global _blake3_compress_in_place_sse2
.global blake3_compress_xof_sse2
.global _blake3_compress_xof_sse2
.section .text
.p2align 6
_blake3_hash_many_sse2:
blake3_hash_many_sse2:
pu... |
Omerhrr/Tswapper | 66,735 | .cargo/registry/src/index.crates.io-6f17d22bba15001f/blake3-1.5.1/c/blake3_avx2_x86-64_windows_gnu.S | .intel_syntax noprefix
.global _blake3_hash_many_avx2
.global blake3_hash_many_avx2
.section .text
.p2align 6
_blake3_hash_many_avx2:
blake3_hash_many_avx2:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
push ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.