-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAngularResolution.asm
More file actions
74 lines (58 loc) · 1.09 KB
/
AngularResolution.asm
File metadata and controls
74 lines (58 loc) · 1.09 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Written by: Gopal Chitaure (gochit01@wsc.edu)
.data
messageR: .asciiz "\nThe Angular Resolution is: "
messageDeg: .asciiz " degree & "
messageArc: .asciiz " arcminutes\n"
rTd: .double 57.3
dTa: .double 60
const: .double 1.22
D: .double 100
L: .double 0.21
.text
l.d $f0, D
l.d $f4, L
l.d $f8, const
l.d $f6, rTd
l.d $f10, dTa
l.d $f12, ($at)
l.d $f14, ($at)
l.d $f16, ($at)
l.d $f18, ($at)
main:
#Calling function and passing values for degree
mov.d $f14, $f0
mov.d $f16, $f4
jal arDeg
#Printing message
li $v0, 4
la $a0, messageR
syscall
li $v0, 3
syscall
#Printing unit
li $v0, 4
la $a0, messageDeg
syscall
#Calling function and passing values for arch
mov.d $f14, $f0
mov.d $f16, $f4
jal arArc
li $v0, 3
syscall
#Printing unit
li $v0, 4
la $a0, messageArc
syscall
li $v0, 10
syscall
arDeg:
div.d $f12,$f16, $f14
mul.d $f12, $f12, $f8
mul.d $f12, $f12, $f6
jr $ra
arArc:
div.d $f12,$f16, $f14
mul.d $f12, $f12, $f8
mul.d $f12, $f12, $f6
mul.d $f12, $f12, $f10
jr $ra