Hacker News new | ask | show | jobs
by l1k 1900 days ago
> This was the first time that I was aware of Apple had shipped a little Endian processor.

FWIW, the LaserWriter 16/600 PS (introduced 1994) uses an Intel 80168 as I/O processor for AppleTalk serving etc.

So Apple did develop for and ship little endian CPUs way before the iPod.

2 comments

The MOS 6502 powering the apple II was as far as i know also litle endien.

Most PPC chips would actually run both big or little endian and but im not sure weather MAC OS Clasic ever ran anything other then big endian.

I've always found it interesting that the 6502 was little endian given that members of the team that designed it worked on the 6800 before, and that was big-endian. I keep meaning to comb through Chuck Peddle / Bill Mensch interviews to see if they comment on what led them to go little endian on the 6502.

EDIT, found it in this forum post on 6502.org http://forum.6502.org/viewtopic.php?f=1&t=6369&start=0

"I used to be a big-endian fan until I finally figured out why the 6502 designers switched to little-endian: it let them start the addition of an index to an address on the LSB before the MSB was read, whereas if you read the MSB first you need to wait for the LSB addition before you know if you need to add a carry to it."

Also re: Mac OS Classic on little-endian... the only attempt I think was the "Star Trek" project, an attempt to build a Mac OS that ran on Intel hardware as a competitor to Windows: https://en.wikipedia.org/wiki/Star_Trek_project

Never went far though.

> "So Apple did develop for and ship little endian CPUs way before the iPod."

ARM was always little-endian by default. It has a big-endian mode, too, but now days it's virtually never used.

But did Apple actually use the big endian mode in the Newton, which shipped in 1993? Google hasn't been able to give me a clear answer on this.

I was curious too, so I took a quick read through a Newton ROM hex dump. I'm pretty sure it's running in big endian mode.

   00000000  ea 00 06 2c ea 68 00 01 ea 6c ff ef ea 68 00 00
   00000010  ea 67 ff fc ea 67 ff fb ea 67 ff f9 ea 67 ff f7
Those e nybbles you see at the top of each word are pretty standard arm32, meaning "execute always" in it's ubiquitous conditional execution of instructions. Them being in byte 0 rather than byte 3 of each word means that it's stored in big endian order. The rest of the instruction makes sense too as branch offsets in big endian (since this would be the cpu exception vector table).

There for sure could be some weird other piece of information I'm missing (like maybe the rom image is pre swapped for efficient emulation on big endian systems like Mac/PowerPC?), but barring that it really looks like Newton was a big endian system.

I believe you're right. Looking at Makefiles for open source Newton projects, -mbig-endian is passed into GCC:

https://github.com/pguyot/DCL/blob/master/Sample_Code/Toolch...

MACHINEFLAGS := -march=armv3 -mbig-endian