Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!tut.cis.ohio-state.edu!ucbvax!agate!shelby!neon!pescadero.Stanford.EDU!philip From: philip@pescadero.Stanford.EDU (Philip Machanick) Newsgroups: comp.sys.mac.programmer Subject: Re: Reading Text With Pointers... Message-ID: <1990Dec31.050056.1240@Neon.Stanford.EDU> Date: 31 Dec 90 05:00:56 GMT References: <50164@cornell.UUCP> <22358@well.sf.ca.us> Sender: news@Neon.Stanford.EDU (USENET News System) Reply-To: philip@pescadero.stanford.edu Organization: Computer Science Department, Stanford University Lines: 24 In article <22358@well.sf.ca.us>, oster@well.sf.ca.us (David Phillip Oster) writes: |> In article <50164@cornell.UUCP> wayner@kama.cs.cornell.edu (Peter Wayner) writes: |> >If I read in a file of text, each character fills a byte. The |> >problem is that the 68000 doesn't allow unalligned access, but |> >the 68020/30 does. What is the best way to pull of characters |> >one by one? |> Pulling the characters one by one is not a problem on the 68000. Byte |> access is always legal, alignment doesn't enter into it. The problme comes |> when you want to access Integer data that is not aligned on an even boundary. |> Ptr bufferPtr; |> ... |> nextChar := bufferPtr^; |> bufferPtr := bufferPtr + 1; |> for single char data. Simpler still (though you may have to turn off array bound checking): bufferPtr : ^packed array [1..whatever] of char; {create space for the array and fill it} for i:=1 to size of array nextchar := bufferPtr^[i]; -- Philip Machanick philip@pescadero.stanford.edu