Question:
Does a Different System Architecture use different assembly language code?
Adam B
2009-01-08 09:07:21 UTC
Basically if i coded in assembly for an intel x86(PC) would it work on a mac or other system architecture?
Or does each system differ in commands etc?
Five answers:
Mike W
2009-01-08 09:49:02 UTC
Assembly language is not portable to different systems. x86 assembly language differs from Sparc assembly language, and Motorola 68000, or MOS 6502, or Zilog Z80 assembly language. You do bring up an interesting question about the x86 though. Both PC and Mac use the x86 processor, howbeit with different operating systems, but you may be able to port assembly code from a PC to a Mac, provided that they are both using the x86, but definitely not to a mac using a G5.



There are two high level programming languages that allow assembly level programming, and they should be source code portable between systems, meaning that you'd have to compile them on the machine that you intend to use the program. They are C and Forth.
anonymous
2009-01-08 09:48:20 UTC
In general no. But in the case you mention, modern Macs also use x86 hardware as well. I have an older iBookG4 which uses the PowerPC chip and x86 assembly code wouldn't work on that.



Most consumer class systems these days use x86 (Intel, AMD). There are exceptions but not many people have these as desktops. Older SGI machines (Indigo, Indy) used a type of RISC processor called MIPS. The place that I used to work used the VAX architecture which was made by DEC (now out of business). Sun Microsystems (the guys that make Java) made an architecture called SPARC. Even Intel has other lines of processors (the Itanium family).



These other architectures wouldn't be cheap though. Since there is less demand for anything other than x86 in the broad consumer market you don't see the economies of scale that bring prices down. Even though some of these other architectures are intrinsically faster than x86 (RISC is generally going to be faster), the huge development put into x86 has made it a dominant force.
anonymous
2009-01-08 09:11:18 UTC
no. Assembly language is dependent on the CPU.



from Wikipedia:

An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture
?
2016-05-26 04:26:41 UTC
Assembly language does not depends on the OS. Assembly language is specific to a processor. I am unaware about modern 64 bit specific Intel assemblers. However, checkup Intels sits
b-i-n-g-o
2009-01-08 12:46:05 UTC
yes they do


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...