Page 1 of 1

ASM, can't think of anything better

Posted: Tue Nov 09, 2004 8:17 pm
by soks
So I was looking at some beginner stuff for PS2 development and I suddenly saw something scarier than the intense use of macros (which I'm slowly liking more), ASM! AH!

Now don't get me wrong I get the basics behind ASM as well as hardware logic but I've never written more than 3 lines of assembly first hand, and that was HLA which seemed... well... let's just say like SUSE as opposed to LFS. I was just wondering if more knowledge than put something into registers, command, hey there it goes, is needed and possibly what good resources any of you guys ever used or know? (prefferably something that doesn't involve Win32 ASM crap that is pointless for me, maybe some linux =p ).

Also if anyone knows good free or book resources on circuits and stuff... I've never been good with that either... come to think of it all I can do is program and err... graphics stuff... damn. Hi PS2... please don't bite me.

At least the loader works =P

Posted: Tue Nov 09, 2004 10:52 pm
by Drakonite
If you are using one of the graphics libs then techincally you can get by without knowing ASM at all.

If you really want to take control and push the PS2 you'll have to access the graphics hardware on your own and write some vu code... And you have to program the VUs in ASM ;)

Posted: Wed Nov 10, 2004 3:33 am
by soks
Wow, thanks a lot, I didn't think I would get an answer that's so specific, I had no idea the VU's required ASM.

Any idea on places I can learn it? Whenever I try I can never really decide on WHAT freakin' assembler to use and then I find people talking about legality issues with MASM and it's all very very sad. Then again I might just be nuts, any ideas on sites to learn? Yeah I know, google, but I'm wondering about personal opinions and maybe "how you learned".

Personally I'm at a University right now that has a Game Development degree and from what I hear, they recommend you learn ASM, but they don't teach it! O_o

Posted: Wed Nov 10, 2004 6:08 pm
by soks
Ok, so I'm browsing ASM tuts, will read more specific stuff for a bit better understanding of syntax, but this stuff surely doesn't directly relate to the VU's.

That is... VU ASM is different than x86 ASM right? I mean it HAS TO BE, it's a different friggin' chip right?

That being said the commands are the main difference then right? So is there anywhere I can get ASM info on the VU's directly? or is that something the PS2-Linux docs have, and thus I can't?

Posted: Wed Nov 10, 2004 11:25 pm
by Drakonite
ASM for different archs is completely different. From what I've been told the VU ASM seems extremely different from anything else out there you might have worked with...
But then again, I do not know ASM, so how much you can trust what I say you'll have to decide.
The majority of VU docs are with the linux kit. There are a bit more floating around the web I think, but I'm not sure where or how much.

I don't know much on the subject, so I'll just stop here and hope someone else helps you out with the rest.

Posted: Thu Nov 11, 2004 12:05 am
by pixel
Well, you've told basically everything: asm is different for each machine. Learning x86 asm won't really help you understanding ps2 asm. Well, okay, you may understand the vague 'register-based' concept of the language asm, but that's all. When I moved to mips asm some years ago, it was quite a difficult task to get myself used with it, and I had a quite non-neglectable x86 experience.

Now, I think learning ps2 asm is quite helpful, especially when you have to decypher ps2link's exceptions. That's always better to have some hints about "what is my compiled code doing wrong here", in order to guess what is the C code doing wrong.

Posted: Thu Nov 11, 2004 8:42 am
by soks
Wow, ok, I'll poke around for VU info then... but yeah I got the basic register stuff a few years ago, took hardware course just didn't write ASM, so then I looked at VU an I see some bizzare commands and I thought maybe... I dunno. Yeah.

Anyways, the sytax looks kinda the same as x86, then again that's porbably just because of registers, so yeah.

Fun, thanks for the info, I should like.... go code SOMETHING before poking the ASM... I really should...

Posted: Fri Nov 12, 2004 8:39 am
by mharris
One of the best ways to learn asm for an unfamiliar architecure is to look at compiler-generated code. Use ee-gcc with the "-S" option (rather than "-c") to generate an assembly file. (Use the -o <output_filename>, or it will write it to a.out or somewhere odd like that).

You can also disassemble .o and .elf files using ee-objdump -d <filename>

Posted: Fri Nov 12, 2004 9:14 am
by soks
That's an interesting thought... O_O

Although it seems a little frightening, it makes a lot of sense, not to mention small snippets of code can't be too hard to figure out, right?... eheh.

Posted: Fri Nov 12, 2004 1:36 pm
by Guest
soks wrote: Although it seems a little frightening...
You should be safe. It is the rare ASM that looks at you with malicious red baleful eyes while baring its big sharp pointy teeth.

When that happens, I suggest retreating from the room and calling 911 or whatever your emergency response number is.

After they have applied the holy hand grenade of Antioch, consult back here on your next step.

Posted: Fri Nov 12, 2004 3:01 pm
by soks
O_O