PowerPC Assemblers?
tyler (asks) asks:
"I asked many people, but nobody had an answer for me, so
I figured i'd ask the most knowledgable people on the web:
Does anyone know where i can get an assembly development
environment for the PowerPC?"
← Back to Stories (view on slashdot.org)
Your flattery will never work against me, mere mortal! You shall never uncover the coveted secrets of PPC asm environments! mhuahahaha!
sleep deprivation kills
dammit, i want vi keys in these windows
Metrowerks CodeWarrior, for the MacOS, will do inline PPC Asm. Motorola also made something of the sort, apparently, but its difficult to locate. Might wanna call the boys in Pheonix up and ask them.
As for doing assembly for Linux/PPC, I'd ask the guys working on that project, or sniff around in their mailing list archives.
-- Alex
Since gcc needs an assembly backend, figure out what it uses (almost certainly gas) and use that. Environment? Emacs. :>
I think the best and easiest program to use is Fantasm. I have not used it in quite a while, but it appears that LightSoft is still updating their news page. Also, it appears a new game is in the works over there in the UK. Lightsoft
Apple's free development environment MPW (Macintosh Programmer's Workshop) has an assembler tool. MPW is a scriptable, UNIX-like development environment.
Posted by Nick Carraway:
Just download the GNU binutils and configure it for the appropriate host & target (in your case, probably host=Linux, target=PPC). Here's another hot tip -- they've got a couple of other packages you might be interested in: gcc & gdb, also available for a variety of different hosts and targets. Have fun...
Hmmm, I thought it was quite a bugger to write asm for PPC since it quite heavily pipedlined and all that stuff that's belongs to RISC. Mind you I suppose Intel is quite pipedlined now as well. (Haven't done any serious asm since M68000... the one and only beautiful one...)
cheers
fredrik
This is a good way to go. A nice free PPC assembler. You may want to see the very excellent cross compiler FAQ:
http://www.objsw.com/CrossGCC/
Lots of info on how to build the tools for any target gcc supports.
Sure! See Codewarrior from metrowerks . They make a very good IDE-based compiler-editor-debugger system. It includes PPC assembler as part of the C/C++ system for PPC.
Codewarrior also has compilers for Pascal, Java, etc. And it can target PPC, 68K, JRE, Wintel, and a number of embedded systems too.
It can't be that hard, it's only ones and zeros: http://onesandzeros.tangozulu.biz
doesn't gas have a platform-independent source language? I remember seeing something to that effect, for the purpose of making gcc an easier port.....but I can't remember (and I've never used it, so...)
cc1 translates the higher level language into an internal pcode, and then emits whatever format of assembler is required (AT&T PPC for instance)
I've heard nothing but horror stories about Fantasm. Surely there is something better out of the GNU project.
--Lenny
//"You can't prove anything about a program written in C or FORTRAN.
It's really just Peek and Poke with some syntactic sugar."
i recently took a class on CPUs and hardware architecture. One of the things that my teacher said is that because of RISC's reduced instr. set, and the fact that it took several instructions to do a simple thing, not to mention optimizing for multiple pipelines, etc, assembly level programming for a RISC cpu (like the PPC) is incredibly difficult, not to mention tedious. Which brings up my question, why would you want an assembler for a PPC? Today's compilers are very good, and for those optimization maniacs out there, inline assembly with C is easy to do with gcc. Do you simply want to try to learn a bit about the architecture? i can't think of any other reason for wanting a PPC assembler. Am i missing something?
Reid G. Ormseth, Esq.
Actually, I don't think any assembler language is all that non-tedius. But it's still quite approachable, if you know what you're doing.
your teacher must not be a fan of RISC architectures. i am currently a teaching assistant for an assembly programming class and they are learning MIPS. when i took the class it was x86. i will agree that RISC is a little bit more difficult to program, but not much. after all, you are doing the same thing, just with more instructions. i.e.
lw $3, numone
lw $4, numtwo
add $5, $4, $3
sw $5, numone
vs.
add numone, numtwo
(i think the x86 should work, know the MIPS does.)
if you really know what the x86 code does it is the same thing.
jeff espenschied
j-espenschied@onu.edu
Sure, today's compilers are fairly good, but they still aren't that close to the level of assembler hand-coded by a talented programmer. Can you write an 150-byte full-featured Tetris game in C? Didn't think so.
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
tell your teacher to redo his class had so should ya! PPC assembler is a beauty to program. I must say that i don't know x86. PPC is not difficult at all to programm. It is easy to optimize code that no compiler will do (branch prediction for example). I use it with Code Warrior on MAc OS &
BeOS for PowerPC. Anyway as all good thing it'll
disappeared 'cos apple sucks!
for the x86 assembly, I think you are looking for something more like:
mov numone,ax
add numtwo,ax
mov ax,numone
although the sources and destinations may need to be reversed. I don't think that x86 supports memory to memory operations directly.
The professor's comment about RISC being impossible to program in assembly simply shows that he has not kept current with modern technology. There was a time, about 10 years ago, when machine code needed to be carefully scheduled in order to get the best performance on RISC architectures. The MIPS line of processors were famous for requiring odd transformations of code in order to avoid stalls due dependancies on branches, arithmetic evaluation and memory accesses. With modern RISC architectures, however, the need to reschedule machine code -- in order to handle branch delay slots for instance -- is greatly reduced and RISC machine code can again be written by mere mortals. (or at least demi-gods)
- Jeff Dutky
just a ghost in the machine.
Um... while gas ppc is possible, it's not incredibly pleasant.
On the amiga, at least, there is a PPC assembler included in the StormC development environment for Haage&Partner's WarpOS system. It is a Macro Assembler, with syntax and functionality simlar to Amiga 68k Macro assembler ( i.e. C-like structures)
Note that Motorola-syntax assembler for PPC defines a large number of macros that are very useful, and I find PPC assembler programming far less trying than the icky, tacked-together x86.
NOT JUST FOR AMIGAS!!!
The VBCC package includes PASM, a motorola-syntax ppc macro assembler, and is open source and written to be portable, in theory. (although vbcc is unlikely to supplant gcc in the near future).
It can produce elf ppc binaries.
PASM:
http://devnull.owl.de/~frank/index_e.html
haage-Partner
www.haage-partner.com
go to amiga pages of
www.uk.aminet.org
or
www.cucug.org/amiga.html
and search vbcc and PPC too, if you're curious.
Choice of masters is not freedom.
From PASM readme :
pasm is a portable assembler for the PowerPC processors of the 60x-series, written completely in ANSI-C. All PPC standard instructions, all 32-bit extended mnemonics
and most of the 64-bit extended mnemonics are supported.
pasm knows about nearly 50 directives. Among them are directives for macros, conditional assembly, include files, base-relative addressing (small data), etc..
Currently, these output formats are available:
Absolute. Raw format.
ELF. 32-bit, PowerPC, big endian.
Extended Hunk Format (EHF).
Amiga DOS Format.
Choice of masters is not freedom.
Hi,
I know Lightsoft has one called Fantasm (for the MacOS). I don't know what the various linux distributions have though...
what ever it looks like, its got to be at least as fun as IBM/370 ASM ! (which has got to be the simplest ASM i've evered bothered with)
I had used the following texts to learn about PPC assembly:
Anybody know where I can find an online guide to PPC assembler? I'm a broke student, and I don't think my university bookstore has any books on the subject...
BTW, the newest version of CodeWarrior (v.5) can target Linux... Don't think it's released yet, though. Metrowerks has also announced CodeWarrior for Red Hat Linux. Although I don't have much experience with other compilers, CodeWarrior seems pretty good to me.
>> ...'cos apple sucks!
*sigh* It's really sad to me that people resort to such comments. It's like some sort of weird racism (OSism, if you will).
get over it.
get over yourself.
get over your near sightedness.
zork% mv *.asp
283 files eaten by a grue
The PowerPC User Manuals can be ordered from both Motorola and IBM. Two years ago, they had mailed them to me without a charge. And you can download the stuff from chips.ibm.com.
I do a lot of work with PPC embedded processors... IBM 403Gx stuff. I really enjoy using an assembler by Alfred Arnold called ASL, which targets just about every processor ever made ;-) It supports macros and so forth, and works very well. For more info check out http://john.ccac.rwth-aachen.de:8000/as/as_EN.html
As far as PPC assembler being usable, I enjoy it more than any other processor I've used, including x86, 680x0, AVR, PIC, HC11, etc. And it really isn't too bad to optimize either...
Larry
Someone out there wrote the compilers which generate the RISC optimized code. I see far too many people out there thinking in terms of what they can get by with knowing, rather than seeking to know as much as they can. Obviously you can't know everything about everything, but you should try to know as much as you can about the things you do study and know something about as many different things as you can. I've met many people who were considered to be Guru's but who didn't know a damn thing about anything outside their specialty. Some people consider me to be a guru and it is in no small part due to the fact that I know something about just about everything computer wise. I can hold my own in discussions with software developers, hardware engineers, Mac freaks, Amiga lovers, networking experts, MCSE's etc. I don't know everything, but the wide range of what I do know comes in very handy and I can't tell you how many times something I learned while studying one thing was applicable to a vastly different thing later on. Understanding the instruction set of a processor gives you an insight into how that machine really works, it may be a subtle insight, but it can and will make a difference. Someone has to create the compilers that 99% of the rest of the developers will use. Last time I checked IBM and Motorola weren't developing GCC. Someone in the community has to understand these chips on that level, otherwise GCC and other free development tools will quickly become obsolete.
Muslim community leaders warn of backlash from tomorrow morning's terrorist attack.
Answer: 10/15/98 -aao- there is a freeware assembler from motorola that runs on a
e /sw_prod.html
windows nt platform at url:
http://www.mot.com/SPS/PowerPC/products/softwar
there are also demo versions of third party compilers available from
metaware
metrowerks
diab data
green hills
the risc hotline has metaware demo copies. you could request a copy if you supply a mailing address one could be mailed to you.
finally *unsupported* gnu is available at url:
documentation: http://www.cygnus.com/pubs/gnupro/
distribution list: http://www.delorie.com
The best PPC development environment is called AIX.
Did you say fewer instructions?
Ofcource both ARM and x86 have a ROR instruction so the example is pretty theoretical.
p.s. Teachers often dont have a clue.
ARM (gcc)
===
rsb r3, r1, #32 ; r3=32-r1
mov r2, r0, lsr r3 ; r2=r0>>r3
orr r0, r2, r0, asl r1 ; r0=r2|(r0
x86 (gcc)
===
movl %eax,%edx
sall %cl,%edx
movl $32,%ebx
subl %ecx,%ebx
movl %ebx,%ecx
shrl %cl,%eax
orl %edx,%eax
Apple has a free full development environment for PPC, including an assembler called PPCAsm and highly-optimizing C/C++ compiler called MrC at http://developer.apple.com/tools/mpw-too ls.