Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[proj2] xspim going crazy

186 views
Skip to first unread message

Robert Gregg

unread,
Feb 27, 2004, 8:18:01 PM2/27/04
to
Hey umm, I honestly am completely stumped here.

I wrote the majority of my MIPS code for sprintf.s, and I tried loading the
two .s files to see if it would run at all. Upon loading I am receiving
parser errors on practically every line and I cannot make sense of what's
going on. I even used the template on the server for sprintf.s and the first
line of that template is causing an error as well. Here are the first three
errors, and unknown character errors go on throughout my code. Am I
forgetting something?

spim: (parser) Unknown character on line 1 of file sprintf.s
.text
^
spim: (parser) Unknown character on line 2 of file sprintf.s

^
spim: (parser) Unknown character on line 3 of file sprintf.s
sprintf:


If someone has an idea what's up I would greatly appreciate some help.
Thanks.

- Bobby


Dan Kim

unread,
Feb 27, 2004, 11:20:53 PM2/27/04
to
I'm having the same problem too, and I don't quite get why you want us to do
that, Jeremy. I did all that, and I got this error:

./runMe.sh: Exec format error. Binary file not executable.

Could you explain more of what this does and how this is supposed to help
us?

Daniel


"[TA] Jeremy Huddleston" <cs61...@cory.eecs.berkeley.edu> wrote in message
news:pan.2004.02.28....@cory.eecs.berkeley.edu...
> Here's how we're testing it (using spim rather than xspim):
>
> Create a file called 'runMe.sh' with this contents:
> --begin
> #! /usr/local/bin/bash
> tempFile=`basename $1`.$$.s
> cat $1 sprintf.s > $tempFile
> spim -file $tempFile
> rm $tempFile
> --end
>
> Set it executable:
> $ chmod 755 runMe.sh
>
> Then use it to test out specific spf-main.s files:
> $ ./runMe.sh spf-main.s
>
> --Jeremy

tri

unread,
Feb 27, 2004, 11:53:49 PM2/27/04
to
Trying removing the new file you have just created and compile again.

Dan Kim

unread,
Feb 28, 2004, 5:01:42 AM2/28/04
to
Ok cool. I got it to work. But spim still says I have parse errors all over,
but in the end, my function works fine. Is that a problem? Should I figure
out why it keeps giving me parse errors despite the fact that it works
correctly? I wouldn't know how to go about doing that anyways... I get parse
errors with just isolated single instructions in a different file. :-(

Daniel


"[TA] Jeremy Huddleston" <cs61...@cory.eecs.berkeley.edu> wrote in message
news:pan.2004.02.28....@cory.eecs.berkeley.edu...

> It's just a simple script to help you test out different spf-main.s files
> with your sprintf.s file.
>
> Create a file (emacs or whatever) and call it runMe.sh
> Put the contents between '--begin' and '--end' in that file.
> Set it executable (chmod 755 runMe.sh)
> Run the command passing in the spf-main.s file you want to test as an
> arguement (./runMe.sh spf-main.s)
>
> It just concatenates your two .s files into one temporary .s file which it
> runs through spim.
>
> --Jermey

tri

unread,
Feb 28, 2004, 11:04:51 AM2/28/04
to
I don't think it's a good idea to leave the parse errors even though your
program works. The TAs will make up some weird cases that will exploit
your parse errors. And in every cs class at Berkeley, you need all the points
you can get.

Robert Gregg

unread,
Feb 28, 2004, 5:35:02 PM2/28/04
to
Yeah, mine works using the method Jeremy described, but I'm still geting
parser errors on almost every line haha... this makes no sense. Like, how
can there be an error on the lines .data and .text when each has nothing
else on the line, yet both lines work fine in spf-main.s
Confused!

- Bobby

"Dan Kim" <d...@uclink.berkeley.edu> wrote in message
news:c1pou6$2181$1...@geode.berkeley.edu...

Dan Kim

unread,
Feb 28, 2004, 8:25:33 PM2/28/04
to
I feel your pain, Bobby. Even blank lines give me parse errors. :-(

Daniel


"Robert Gregg" <bob...@uclink.berkeley.edu> wrote in message
news:c1r52l$1u59$1...@agate.berkeley.edu...

Robert Gregg

unread,
Feb 29, 2004, 1:26:08 AM2/29/04
to
Ok figured out the problem.

I've been using emacs from the start (actually I started on notepad and
moved over to emacs)... and all the time I was using that I was getting the
anomaly parser errors.

I figured maybe it was something with how emacs saves or formats the .s
file. So I loaded my sprintf.s using pico, made some irrelevant change,
saved it, and lo and behold: no more parser errors!

So if they are annoying you, try loading your file in pico and save it.

- Bobby

"Robert Gregg" <bob...@uclink.berkeley.edu> wrote in message

news:c1oq88$19pi$1...@agate.berkeley.edu...

Imran Haque

unread,
Feb 29, 2004, 1:30:49 AM2/29/04
to
Since you started on notepad, it actually might not be emacs' fault. It's
possible that spim is choking on DOS-format text files, which end lines with
\n\r (or \r\n, i forget which), because it expects unix-style ones (lines
end with \n). i think emacs just preserves whatever format the file is
already in...so anyway, to solve the problem, you could try running your
file through dos2unix:

dos2unix FileThatWindowsB0rked.s > CoolUnixFile.s

This is all conjecture on my part, though.

//imran


"Robert Gregg" <bob...@uclink.berkeley.edu> wrote in message

news:c1s0lv$275a$1...@agate.berkeley.edu...

Alexei Gvozdev

unread,
Feb 29, 2004, 2:59:43 AM2/29/04
to
right ... got it ... gonna load it into pico ...
wait ... how do i do that ?

-alex

"Imran Haque" <cs61...@imail.eecs.berkeley.edu> wrote in message
news:c1s0v4$27ai$1...@agate.berkeley.edu...

carise fong

unread,
Feb 29, 2004, 3:11:11 AM2/29/04
to
wouldn't that just be "pico sprintf.s" ?

Jonathan Tsai

unread,
Feb 29, 2004, 4:24:33 PM2/29/04
to
i thought i had posted to the group, instead i only did it to one
personl.....

> read the post about text editing in dos vs unix a while back by edward
> lee...
>
> if you are editing on pc then uploading your code, it will include extra
> characters \r, instead of just \n like on unix
> use the unix tool:
>
> dos2unix pc-formattedfile.s > unixfile.s
>
> make sure they are different filenames
>
> jonathan tsai
>

"Robert Gregg" <bob...@uclink.berkeley.edu> wrote in message
news:c1oq88$19pi$1...@agate.berkeley.edu...

N1><0N

unread,
Mar 2, 2004, 9:51:22 PM3/2/04
to
I have the same problem as well. My only thought is that we need to change
the syntax of those lines so that they will not cause parser problems. I am
thinking my problems are caused by extra tabs or spaces (whitespace). Anyone
got any better ideas?

Thanks,
Rob

"li sun" <cs61...@cory.EECS.Berkeley.EDU> wrote in message
news:c1s7lv$28pf$1...@agate.berkeley.edu...
> is there any other way to fix it? i got the same problem too! upset!
> thank you!
>
>
> In article <pan.2004.02.28....@cory.eecs.berkeley.edu>, "[TA]

Brian

unread,
Mar 2, 2004, 11:26:55 PM3/2/04
to
I had the same problem where it gave a parse error for every line. I did
what robert said, which is to load it into pico using 'pico filename' and
then just save the file. Then it should be fine.

"N1><0N" <rvan...@berkeley.edu> wrote in message
news:c23h60$vq$1...@geode.berkeley.edu...

Geoffrey Kwan

unread,
Mar 3, 2004, 8:35:19 PM3/3/04
to
I think it's a prob goin from windows to unix. To bypass this I copied the
text from emacs into notepad and saved the file as sprintf.txt and then
uploaded that to my cs account and then changed the extension from .txt to
.s and then it works fine.

"Jonathan Tsai" <cs61...@cory.eecs.berkeley.edu> wrote in message
news:c1tl90$70p$1...@geode.berkeley.edu...

0 new messages