-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathout.asm
More file actions
42 lines (32 loc) · 722 Bytes
/
out.asm
File metadata and controls
42 lines (32 loc) · 722 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
.data
d1: .float 0.0 # double decl.
arthDoubleStackPtr: .word 268501152
doubleConst0: .float 3.1415
newLine: .asciiz "\n"
.text
main:
l.s $f4 , doubleConst0
la $t0 , 268501152
s.s $f4, 0($t0)
addi $t0, $t0, 4 # push double mips.
sub $t0, $t0, 4
l.s $f4, 0($t0) # pop double mips.
add.s $f6, $f30, $f4 # double assignment
la $t5, d1
s.s $f6, 0($t5)
s.s $f6, 0($t0)
addi $t0, $t0, 4 # push double mips.
la $t5, d1 # rval fetch double op.
l.s $f4, 0($t5)
s.s $f4, 0($t0)
addi $t0, $t0, 4 # push double mips.
sub $t0, $t0, 4
l.s $f4, 0($t0) # pop double mips.
add.s $f12, $f31, $f4
li $v0, 2
syscall
addi $v0, $zero, 4
la $a0, newLine
syscall
li $v0, 10
syscall