| | |
why is it not printing out.. please help
Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2008
Posts: 32
Reputation:
Solved Threads: 0
[code]
.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
[icode]
.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
[icode]
Last edited by shopnobhumi; Sep 15th, 2009 at 3:04 am.
•
•
Join Date: Sep 2008
Posts: 32
Reputation:
Solved Threads: 0
oh thank you but i am still getting syntax error while trying to load on PCSpim as it is saying problem with line where it says .globl main
•
•
Join Date: Sep 2008
Posts: 32
Reputation:
Solved Threads: 0
here is the code but it is giving me syntax error on function main. Can anyone tell me why please
[code].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
add $t2, $s3, $s4
sub $s0, $t1, $t2
li $v0,1
move $a0, $s0
syscall
li $v0, 10
syscall [icode]
[code].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
add $t2, $s3, $s4
sub $s0, $t1, $t2
li $v0,1
move $a0, $s0
syscall
li $v0, 10
syscall [icode]
I 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 see no reference to those declarations in PCPSIM's help file!
And no MARS library reference.
And no MARS library reference.
Okay, had to get away from it, download and read the Appendix A document, twiddle and retry. It ran. Answer -4.
I also tabbed the text as normally it isn't suppose to be in column 1 but not sure if that was it or not!
I also tabbed the text as normally it isn't suppose to be in column 1 but not sure if that was it or not!
Asm Syntax (Toggle Plain Text)
.text .align 2 .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 add $t2, $s3, $s4 sub $s0, $t1, $t2 li $v0,1 move $a0, $s0 syscall li $v0, 10 syscall
![]() |
Similar Threads
- edges of print missing when printing web pages (Web Browsers)
- Windows 2000 Adv Server and "Printing Subsystem" (Windows NT / 2000 / XP)
- Problem printing from IE6 (Web Browsers)
- Mac10.3 Printing Problems (OS X)
- WinXP, RH9, Samba, and Printing (*nix Software)
- Printing pictures (Windows NT / 2000 / XP)
- Linux printing questions (*nix Hardware Configuration)
Other Threads in the Assembly Forum
- Previous Thread: Assembly in ARM Devices
- Next Thread: Nohau Emulator Problem
Views: 351 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for Assembly
3d 68hc11 6811 80386 :( adress array asm assembler assembly boot bootloader buffer compression cursor debug directory division docs dos draw emulator endtask error exceptions file int10h integer intel interrupt interrupts language loop newbie nohau osdevelopment print program range read remainder shape string text theory tsr x86





