.txt
.globl main
main:
# f= (g+h)-(i+j);
li $s0,0
li $t1,0
li $t2,0
li $s1,4
li $s2,5
li $s3,6
li $s4,7
add $t1, $s1, $s2 # sum of s1,s2 is stored in t1 or temporary variable
t1 contains g+h
add $t2, $s3, $s4 # sum of s3,s4 is stored in t2 or temporary variable
t2 contains i+j
sub $s0, $t1, $t2 # s0 gets $t1- $t2, which is (g+h)-(i+j)
li $v0,1
move $ao, $s0 # suppose to printf("f=%d\n",f)
li $v0, 10
syscall
#it is giving me syntax error
shopnobhumi
0
Light Poster
Recommended Answers
Jump to PostYou have a problem with the MARS library.
li $v0,1 Print integer
mov $a0,$s0 a0 is integer
syscall <--- MISSINGli $v0,10
syscall #exit
Jump to PostI downloaded the PCSPIM simulator and it doesn't like the system calls or the .txt label. I typically use a real MIPS processor, with real tools. Were you instructed to use this simulator, and where did the sample program or the control syntax of your sample program come from? I …
All 6 Replies
wildgoose
420
Practically a Posting Shark
shopnobhumi
commented:
helpful
+1
shopnobhumi
0
Light Poster
shopnobhumi
0
Light Poster
shopnobhumi
0
Light Poster
wildgoose
420
Practically a Posting Shark
wildgoose
420
Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.