Path: utzoo!attcan!uunet!eplrx7!udel!princeton!njin!aramis.rutgers.edu!porthos.rutgers.edu!friedman From: friedman@porthos.rutgers.edu (Gadi ) Newsgroups: comp.sys.apple Subject: Re: MSB Confusion! Message-ID: Date: 23 Nov 88 16:50:42 GMT References: <8811221902.aa26542@SMOKE.BRL.MIL> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 39 > From my machine language experience, I know for a fact that the Apple II line/ > 65xx series processors store integers with the Least Significant Byte (LSB) > first. I would assume that higher level number formats (like longints for > example) would also be stored that way, because it would be easier to implement > (you can use direct (not reversed) loads and stores). > > On an aside, the Mac line/ 68xxx series uses the MSB first. > > I hope that (finally) clears things up... > > -dan Boy, you know some strange facts. Say you have the command LDA $11ff -> 300:opcode 11 ff In the apple. Hence, the MSByte is stored first. How did you say you have been programming? Anyway, on a PC, the instruction MOV A, $11ff -> 300:opcode ff 11 With the LSByte first. Now in this case, it might be better to print MOV A, 11ffH -> 11 ff opcode:300 so that the output look right. On the mac you have MOV $11ff, D0 -> 300:opcode 11 ff 00 00 (Absolut Addressing!!!!) which is similar to the 6502. The addresses are longer, but the MSByte is still in the lowest address. In all these, however the MSBit is in the highest bit location (bit7). As as I mentioned in my previous posting. On the Perken Elmer machine. The MSbit is bit0. I don't know if that machine has bytes, or what its word size is, so I can't show an actual example. Gadi BTW. Bfox wrote Emacs(Amacs) for the AppleII in assembly language, so don't make fun of his 6502 programming!. -- uucp: {ames, cbosgd, harvard, moss}!rutgers!aramis.rutgers.edu!friedman arpa: FRIEDMAN@ARAMIS.RUTGERS.EDU