Getting same MIPS error message

spim: (parser) syntax error on line 11 of file /Users/TheKid/Documents/ProgramTemplete.s
file 1 “”
^


I am using TextEdit on Macbook & QT Spim
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
file   1 “”
        .section .mdebug.abi32
        .previous
        .nan    legacy
        .module fp=32
        .module nooddspreg
        .abicalls
        .rdata
        .align  2
$LC0:
        .ascii  "Enter the upperbound: \000"
        .align  2
$LC1:
        .ascii  "%d\000"
        .align  2
$LC2:
        .ascii  "The sum of odd numbers is %d.\012\000"
        .align  2
$LC3:
        .ascii  "The sum of even numbers is %d.\012\000"
        .align  2
$LC4:
        .ascii  "The absolute difference is %d.\012\000"
        .text
        .align  2
        .globl  main
        .set    nomips16
        .set    nomicromips
        .ent    main
        .type   main, @function
main:
        .frame  $fp,56,$31              # vars= 24, regs= 2/0, args= 16, gp= 8
        .mask   0xc0000000,-4
        .fmask  0x00000000,0
        .set    noreorder
        .cpload $25
        .set    nomacro
        addiu   $sp,$sp,-56
        sw      $31,52($sp)
        sw      $fp,48($sp)
        move    $fp,$sp
        .cprestore      16
        movz    $31,$31,$0
        sw      $0,24($fp)
        sw      $0,28($fp)
        lw      $2,%got($LC0)($28)
        nop
        addiu   $4,$2,%lo($LC0)
        lw      $2,%call16(printf)($28)
        nop
        move    $25,$2
        .reloc  1f,R_MIPS_JALR,printf
1:      jalr    $25
        nop

        lw      $28,16($fp)
        addiu   $2,$fp,40
        move    $5,$2
        lw      $2,%got($LC1)($28)
        nop
        addiu   $4,$2,%lo($LC1)
        lw      $2,%call16(__isoc99_scanf)($28)
        nop
        move    $25,$2
        .reloc  1f,R_MIPS_JALR,__isoc99_scanf
1:      jalr    $25
        nop

        lw      $28,16($fp)
        li      $2,1                    # 0x1
        sw      $2,36($fp)
        b       $L2
        nop

$L5:
        lw      $2,36($fp)
        nop
        andi    $2,$2,0x1
        bne     $2,$0,$L3
        nop

        lw      $3,28($fp)
        lw      $2,36($fp)
        nop
        addu    $2,$3,$2
        sw      $2,28($fp)
        b       $L4
        nop

$L3:
        lw      $3,24($fp)
        lw      $2,36($fp)
        nop
        addu    $2,$3,$2
        sw      $2,24($fp)
$L4:
        lw      $2,36($fp)
        nop
        addiu   $2,$2,1
        sw      $2,36($fp)
$L2:
        lw      $2,40($fp)
        lw      $3,36($fp)
        nop
        slt     $2,$2,$3
        beq     $2,$0,$L5
        nop

        lw      $3,24($fp)
        lw      $2,28($fp)
        nop
        slt     $2,$2,$3
        beq     $2,$0,$L6
        nop

        lw      $3,24($fp)
        lw      $2,28($fp)
        nop
        subu    $2,$3,$2
        sw      $2,32($fp)
        b       $L7
        nop

$L6:
        lw      $3,28($fp)
        lw      $2,24($fp)
        nop
        subu    $2,$3,$2
        sw      $2,32($fp)
$L7:
        lw      $5,24($fp)
        lw      $2,%got($LC2)($28)
        nop
        addiu   $4,$2,%lo($LC2)
        lw      $2,%call16(printf)($28)
        nop
        move    $25,$2
        .reloc  1f,R_MIPS_JALR,printf
1:      jalr    $25
        nop

        lw      $28,16($fp)
        lw      $5,28($fp)
        lw      $2,%got($LC3)($28)
        nop
        addiu   $4,$2,%lo($LC3)
        lw      $2,%call16(printf)($28)
        nop
        move    $25,$2
        .reloc  1f,R_MIPS_JALR,printf
1:      jalr    $25
        nop

        lw      $28,16($fp)
        lw      $5,32($fp)
        lw      $2,%got($LC4)($28)
        nop
        addiu   $4,$2,%lo($LC4)
        lw      $2,%call16(printf)($28)
        nop
        move    $25,$2
        .reloc  1f,R_MIPS_JALR,printf
1:      jalr    $25
        nop

        lw      $28,16($fp)
        move    $2,$0
        move    $sp,$fp
        lw      $31,52($sp)
        lw      $fp,48($sp)
        addiu   $sp,$sp,56
        j       $31
        nop

        .set    macro
        .set    reorder
        .end    main
        .size   main, .-main
        .ident  "GCC:  
Last edited on
Registered users can post here. Sign in or register to post.