Dokumente und Mars-Simulator
This commit is contained in:
18
MARS/Simulationen/Simulation 07 Addition/Simulation 07.asm
Normal file
18
MARS/Simulationen/Simulation 07 Addition/Simulation 07.asm
Normal file
@@ -0,0 +1,18 @@
|
||||
#############################################################################
|
||||
# Addiert zwei Integerzahlen, legt die Summe im temporaeren Register $t2 ab #
|
||||
#############################################################################
|
||||
.data
|
||||
# Deklaration der Variablen
|
||||
number1: .word 3
|
||||
number2: .word 11
|
||||
.text
|
||||
# Laden der Werte in die temporaeren Register
|
||||
lw $t0, number1($zero)
|
||||
lw $t1, number2($zero)
|
||||
|
||||
# Addition t2 = t0 + t1
|
||||
add $t2, $t0, $t1
|
||||
|
||||
# exit
|
||||
li $v0, 10 # der Wert 10 fuer den syscall bedeutet: exit (terminate execution)
|
||||
syscall
|
||||
Reference in New Issue
Block a user