Skip to content

Commit

Permalink
Run make build-mips-programs
Browse files Browse the repository at this point in the history
  • Loading branch information
dannywillems committed Dec 23, 2024
1 parent 4cf77b5 commit 49235d3
Show file tree
Hide file tree
Showing 128 changed files with 3,235 additions and 0 deletions.
Binary file added o1vm/resources/programs/mips/bin/add
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/addi
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/addiu
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/addu
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/and
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/andi
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/beq
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/bgez
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/bgtz
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/blez
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/bltz
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/bne
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/brk
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/clo
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/clone
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/clz
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/div
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/divu
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/exit_group
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/fcntl
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/j
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/jal
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/jalr
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/jr
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/lb
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/lbu
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/lh
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/lhu
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/lui
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/lw
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/lwl
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/lwr
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/mfthi
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/mftlo
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/mmap
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/movn
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/movz
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/mul
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/mult
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/multu
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/nor
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/oracle
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/oracle_kzg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/ori
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/sb
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/sh
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/sll
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/sllv
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/slt
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/slti
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/sltiu
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/sltu
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/sra
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/srav
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/srl
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/srlv
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/sub
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/subu
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/swl
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/swr
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/xor
Binary file not shown.
Binary file added o1vm/resources/programs/mips/bin/xori
Binary file not shown.
38 changes: 38 additions & 0 deletions o1vm/resources/programs/mips/src/add.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
###############################################################################
# File : add.asm
# Project : MIPS32 MUX
# Author: : Grant Ayers (ayers@cs.stanford.edu)
#
# Standards/Formatting:
# MIPS gas, soft tab, 80 column
#
# Description:
# Test the functionality of the 'add' instruction.
#
###############################################################################


.section .text
.global __start
__start:
lui $s0, 0xbfff # Load the base address 0xbffffff0
ori $s0, 0xfff0
ori $s1, $0, 1 # Prepare the 'done' status

#### Test code start ####

lui $t0, 0xffff # A = 0xfffffffd (-3)
ori $t0, 0xfffd
ori $t1, $0, 0x3 # B = 0x3
add $t2, $t0, $t1 # C = A + B = 0
sltiu $v0, $t2, 1 # D = 1 if C == 0

#### Test code end ####

sw $v0, 8($s0) # Set the test result
sw $s1, 4($s0) # Set 'done'

$done:
jr $ra
nop

38 changes: 38 additions & 0 deletions o1vm/resources/programs/mips/src/addi.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
###############################################################################
# File : addi.asm
# Project : MIPS32 MUX
# Author : Grant Ayers (ayers@cs.stanford.edu)
#
# Standards/Formatting:
# MIPS gas, soft tab, 80 column
#
# Description:
# Test the functionality of the 'addi' instruction.
#
###############################################################################


.section .text
.global __start
__start:
lui $s0, 0xbfff # Load the base address 0xbffffff0
ori $s0, 0xfff0
ori $s1, $0, 1 # Prepare the 'done' status

#### Test code start ####

lui $t0, 0xffff # A = 0xfffffffd (-3)
ori $t0, 0xfffd
addi $t1, $t0, 5 # B = A + 5 = 2
addi $t2, $t1, 0xfffe # C = B + -2 = 0
sltiu $v0, $t2, 1 # D = 1 if C == 0

#### Test code end ####

sw $v0, 8($s0) # Set the test result
sw $s1, 4($s0) # Set 'done'

$done:
jr $ra
nop

38 changes: 38 additions & 0 deletions o1vm/resources/programs/mips/src/addiu.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
###############################################################################
# File : addiu.asm
# Project : MIPS32 MUX
# Author : Grant Ayers (ayers@cs.stanford.edu)
#
# Standards/Formatting:
# MIPS gas, soft tab, 80 column
#
# Description:
# Test the functionality of the 'addiu' instruction.
#
###############################################################################


.section .text
.global __start
__start:
lui $s0, 0xbfff # Load the base address 0xbffffff0
ori $s0, 0xfff0
ori $s1, $0, 1 # Prepare the 'done' status

#### Test code start ####

lui $t0, 0xffff # A = 0xfffffffd (-3)
ori $t0, 0xfffd
addiu $t1, $t0, 5 # B = A + 5 = 2
addiu $t2, $t1, 0xfffe # C = B + -2 = 0
sltiu $v0, $t2, 1 # D = 1 if C == 0

#### Test code end ####

sw $v0, 8($s0) # Set the test result
sw $s1, 4($s0) # Set 'done'

$done:
jr $ra
nop

38 changes: 38 additions & 0 deletions o1vm/resources/programs/mips/src/addu.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
###############################################################################
# File : addu.asm
# Project : MIPS32 MUX
# Author : Grant Ayers (ayers@cs.stanford.edu)
#
# Standards/Formatting:
# MIPS gas, soft tab, 80 column
#
# Description:
# Test the functionality of the 'addu' instruction.
#
###############################################################################


.section .text
.global __start
__start:
lui $s0, 0xbfff # Load the base address 0xbffffff0
ori $s0, 0xfff0
ori $s1, $0, 1 # Prepare the 'done' status

#### Test code start ####

lui $t0, 0xffff # A = 0xfffffffd (-3)
ori $t0, 0xfffd
ori $t1, $0, 0x3 # B = 0x3
addu $t2, $t0, $t1 # C = A + B = 0
sltiu $v0, $t2, 1 # D = 1 if C == 0

#### Test code end ####

sw $v0, 8($s0) # Set the test result
sw $s1, 4($s0) # Set 'done'

$done:
jr $ra
nop

42 changes: 42 additions & 0 deletions o1vm/resources/programs/mips/src/and.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
###############################################################################
# File : and.asm
# Project : MIPS32 MUX
# Author: : Grant Ayers (ayers@cs.stanford.edu)
#
# Standards/Formatting:
# MIPS gas, soft tab, 80 column
#
# Description:
# Test the functionality of the 'and' instruction.
#
###############################################################################


.section .text
.global __start
__start:
lui $s0, 0xbfff # Load the base address 0xbffffff0
ori $s0, 0xfff0
ori $s1, $0, 1 # Prepare the 'done' status

#### Test code start ####

lui $t0, 0xdeaf # A = 0xdeafbeef
lui $t1, 0xaaaa # B = 0xaaaaaaaa
lui $t2, 0x5555 # C = 0x55555555
ori $t0, 0xbeef
ori $t1, 0xaaaa
ori $t2, 0x5555
and $t3, $t0, $t1 # D = A & B = 0x8aaaaaaa
and $t4, $t2, $t3 # E = B & D = 0
sltiu $v0, $t4, 1

#### Test code end ####

sw $v0, 8($s0) # Set the test result
sw $s1, 4($s0) # Set 'done'

$done:
jr $ra
nop

37 changes: 37 additions & 0 deletions o1vm/resources/programs/mips/src/andi.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
###############################################################################
# File : andi.asm
# Project : MIPS32 MUX
# Author: : Grant Ayers (ayers@cs.stanford.edu)
#
# Standards/Formatting:
# MIPS gas, soft tab, 80 column
#
# Description:
# Test the functionality of the 'andi' instruction.
#
###############################################################################


.section .text
.global __start
__start:
lui $s0, 0xbfff # Load the base address 0xbffffff0
ori $s0, 0xfff0
ori $s1, $0, 1 # Prepare the 'done' status

#### Test code start ####

ori $t0, $0, 0xcafe # A = 0xcafe
andi $t1, $t0, 0xaaaa # B = A & 0xaaaa = 0x8aaa
andi $t2, $t1, 0x5555 # C = B & 0x5555 = 0
sltiu $v0, $t2, 1

#### Test code end ####

sw $v0, 8($s0) # Set the test result
sw $s1, 4($s0) # Set 'done'

$done:
jr $ra
nop

50 changes: 50 additions & 0 deletions o1vm/resources/programs/mips/src/beq.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
###############################################################################
# File : beq.asm
# Project : MIPS32 MUX
# Author: : Grant Ayers (ayers@cs.stanford.edu)
#
# Standards/Formatting:
# MIPS gas, soft tab, 80 column
#
# Description:
# Test the functionality of the 'beq' instruction.
#
###############################################################################


.section .text
.global __start
__start:
lui $s0, 0xbfff # Load the base address 0xbffffff0
ori $s0, 0xfff0
ori $s1, $0, 1 # Prepare the 'done' status

#### Test code start ####

ori $t0, $0, 0xcafe
ori $t1, $0, 0xcafe
ori $v0, $0, 0 # The test result starts as a failure
beq $t0, $v0, $finish # No branch
nop
beq $t0, $t1, $target
nop

$finish:
sw $v0, 8($s0)
sw $s1, 4($s0)

$done:
jr $ra
nop
j $finish # Early-by-1 branch detection

$target:
nop
ori $v0, $0, 1 # Set the result to pass
beq $0, $0, $finish # Late-by-1 branch detection (result not stored)
nop
j $finish
nop

#### Test code end ####

48 changes: 48 additions & 0 deletions o1vm/resources/programs/mips/src/bgez.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
###############################################################################
# File : bgez.asm
# Project : MIPS32 MUX
# Author: : Grant Ayers (ayers@cs.stanford.edu)
#
# Standards/Formatting:
# MIPS gas, soft tab, 80 column
#
# Description:
# Test the functionality of the 'bgez' instruction.
#
###############################################################################


.section .text
.global __start
__start:
lui $s0, 0xbfff # Load the base address 0xbffffff0
ori $s0, 0xfff0
ori $s1, $0, 1 # Prepare the 'done' status

#### Test code start ####

lui $t0, 0xffff
bgez $t0, $finish # No branch
nop
bgez $s1, $target
nop

$finish:
sw $v0, 8($s0)
sw $s1, 4($s0)

$done:
jr $ra
nop
j $finish # Early-by-1 branch detection

$target:
nop
ori $v0, $0, 1 # Set the result to pass
bgez $0, $finish # Late-by-1 branch detection (result not stored)
nop
j $finish # Broken branch recovery
nop

#### Test code end ####

49 changes: 49 additions & 0 deletions o1vm/resources/programs/mips/src/bgtz.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
###############################################################################
# File : bgtz.asm
# Project : MIPS32 MUX
# Author: : Grant Ayers (ayers@cs.stanford.edu)
#
# Standards/Formatting:
# MIPS gas, soft tab, 80 column
#
# Description:
# Test the functionality of the 'bgtz' instruction.
#
###############################################################################


.section .text
.global __start
__start:
lui $s0, 0xbfff # Load the base address 0xbffffff0
ori $s0, 0xfff0
ori $s1, $0, 1 # Prepare the 'done' status

#### Test code start ####

ori $v0, $0, 0 # The test result starts as a failure
lui $t0, 0xffff
bgtz $t0, $finish # No branch
nop
bgtz $s1, $target
nop

$finish:
sw $v0, 8($s0)
sw $s1, 4($s0)

$done:
jr $ra
nop
j $finish # Early-by-1 branch detection

$target:
nop
ori $v0, $0, 1 # Set the result to pass
bgtz $s1, $finish # Late-by-1 branch detection (result not stored)
nop
j $finish # Broken branch recovery
nop

#### Test code end ####

Loading

0 comments on commit 49235d3

Please sign in to comment.