Subject: Sheepish question

From: Mike Shaver <[email-masked]>
Date: Thu, 27 Mar 1997 15:48:38 -0500 (EST)

If I were, say, a total newbie when it comes to assembly, what would
be a good place to start?  I've always meant to learn assembly, and
this would seem an ideal opportunity -- and to do it on real hardware!
=)

Any good references?  Anything MIPS-specific?

Mike
(or should I just harass Ralph and you guys until you kick me off? =) )

-- 
#> Mike Shaver ([email-masked]) Ingenia Communications Corporation 
#>                 Ignore the man behind the curtain.                  
#>                                                                     
#> "And then I realized that it never should have worked in the first  
#>  place.  Thus, it would not work again until rewritten." --- Anon.

---

From: [email-masked] (Ariel Faigon)
Date: Thu, 27 Mar 1997 12:54:34 -0800 (PST)

Mike, please check the pointers (external URLs) mentioned
in the linux archive (did you get my pointer?).

There are also a few good books.  Ralf can recommend some.
The problem is that they don't talk about the newest ISAs
and have next to nothing about low level system stuff.

Also, register to "clubdev" on www.sgi.com (costs nothing)
and you'll have access to SGI's online technical books.

Last option is to contact MIPS marketing (try [email-masked]
Bill Jackson) maybe he can send you some paper docs. 

:
:If I were, say, a total newbie when it comes to assembly, what would
:be a good place to start?  I've always meant to learn assembly, and
:this would seem an ideal opportunity -- and to do it on real hardware!
:=)
:
:Any good references?  Anything MIPS-specific?
:
:Mike
:(or should I just harass Ralph and you guys until you kick me off? =) )
:

-- 
Peace, Ariel

---

From: Mike Shaver <[email-masked]>
Date: Thu, 27 Mar 1997 16:13:59 -0500 (EST)

> Mike, please check the pointers (external URLs) mentioned

http://www.mips.com/r4400/UMan/R4000.book_5.html
translates to
http://www.sgi.com/MIPS/r4400/UMan/R4000.book_5.html
which doesn't exist.

I'll poke around the site, though...no worries.

> in the linux archive (did you get my pointer?).

Yup, I did.
Cool stuff.
(I just haven't had time to really read through it all properly
yet...some of that stuff is pretty hard-core. =) )

> and have next to nothing about low level system stuff.

That's OK...I'm starting _really_ low on the clue chain.

> and you'll have access to SGI's online technical books.

Good plan, thanks.

> Bill Jackson) maybe he can send you some paper docs. 

That might be an idea for later.

Thanks a lot (you guys are great!).

Mike

-- 
#> Mike Shaver ([email-masked]) Ingenia Communications Corporation 
#>                 UNIX medicine man -- dark magick, cheap!            
#>                                                                     
#>  When the going gets tough, the tough give cryptic error messages.  
#>          "We believe in rough consensus and running code."

---

From: Emmanuel Mogenet <[email-masked]>
Date: Thu, 27 Mar 1997 13:42:40 -0800

> Any good references?  Anything MIPS-specific?

For general references on assembly programming, I'm not sure.
Is there a need for such a thing ?

But for MIPS specific, if you've go an SGI with a proper
development toolkit on it, it should come with an online
book entitled "MIPS Assembly Programming Guide".

That's quite a complete reference, but not a tutorial.

The hacker way of looking at things (the one I like) is
to write tiny C programs, compile them with cc -S,
look at the output, and try to understand what happens.

Even better, compile your c program and use dis (the sgi disassembler)
to look at the result (cc -S output something that's not really the
final
thing the CPU groks)

Also, dbx has quite a few command that allow you
to follow a program step by step at  assembly level:

ni			(next instruction, don't follow subroutine calls)
si			(next instruction, follow)
stopi at 		(add an asm level breakpoint)
syscall catch call xx	(stop on system call xx)
$pc-20/50i		(list asm fragment around current PC)
pr			(dump registers)
assign $pc=xxxx		(change value of register pc to xxxx)

etc ...

Finally, beware of pipelining weirdies.
A most striking example is:

[   4] 0x40092c:  03 e0 00 08         jr        ra		// Return from
subroutine
[   4] 0x400930:  24 02 00 03         li        v0,3		// Load return
value in v0

At first reading, it seems like the routine returns
before loading the return value in v0.

Actually, both instructions are executed at the same time.

	- Mgix