home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!agate!spam.berkeley.edu!kientzle
- From: kientzle@spam.berkeley.edu (Tim Kientzle)
- Newsgroups: comp.os.os9
- Subject: Re: getc() bug?
- Date: 28 Aug 1992 21:43:52 GMT
- Organization: University of California, Berkeley
- Lines: 20
- Message-ID: <17m6moINNaeh@agate.berkeley.edu>
- References: <17h1seINNcj4@agate.berkeley.edu> <1992Aug27.172741.8294@aimla.com>
- NNTP-Posting-Host: spam.berkeley.edu
-
-
- I earlier described:
- >>I had this odd bug in a program which I finally solved by moving some
- >>calls to getc. From studying the effect on the assembly, it looks as
- >>if getc() is trashing D1.
-
- Ron Moore (uunet!aimla!optimla!ron) asks:
- > How did this show up for you? The Microware compiler knows better
- >than to rely on holding onto D1. Are you using GNU?
-
- I'm using the Microware compiler from OS9 2.3 (my distributor
- is being rediculously slow about getting 2.4 stuff out), so this
- may have been fixed. The abbreviated, simplified version is that a
- statement such as
- wordval = firstbyte * 256 + getc(file);
- doesn't work, but
- wordval = getc(file) + firstbyte * 256;
- does. From the assembly, D1 is being used to hold the intermediate
- value, hence my assumption that D1 is being trashed.
- - Tim
-