TweetFollow Us on Twitter

Apr 91 Mousehole
Volume Number:7
Issue Number:4
Column Tag:Mousehole Report

MC68XXXX FP and the LC

By Larry Nedry, Mousehole BBS

From: Emrte

Re: MC68XXXX FP DATA FORMAT

I’m porting some binary data files from a PDP 11 system to the Mac. When I swap bytes on the Mac short ints are OK but floats are still all wrong. The DEC LSI fp data format is the typical sign bit+7bit exp + 24 bit fraction in that order from high byte to low byte. Any help would be appreciated.

From: Istewart

Re: MC68XXXX FP DATA FORMAT

You probably need to get the “Apple Numerics Manual, Second Edition”, published by Addison-Wesley. I’ll try to interpret the format of the single and double floating point formats; I hope I’ve got it right, as I haven’t looked into this before ...

According to this publication, the 32-bit (single precision) floating point format is as follows, from msb to lsb, msb in lowest memory location:

1 bit - sign

8 bits - exponent

0<e<255: normalized, exponent is 2 raised to (e-127)

0 and fraction not = zero: denormalized exponent is 2 raised to -126

0 and fraction = zero: zero

255 and fraction = zero: infinity

255 and fraction not = zero: NaN (type signalled by value of fraction)

23 bits - fraction, if normalized, then there’s an implicit 1 inserted to the left of the fraction; if denormalized, then it’s zero.

For double, it’s similar, except that it’s 1 bit sign, 11 exponent and 52 fraction. For normalized, it’s (e-1023), and for denormalized, it’s -1022.

I hope this is some help; there’s quite a lot more on NaN’s in the manual, which I won’t pretend to understand.

From: Emrte

Re: MC68XXXX FP DATA FORMAT

Thanks for the info. I do have a copy of the Manual. I’m bringing the binaried byte). I’m just wondering whether the byte scan and parsing occurs after the initial byte swap? Straight byte swapping gives me the correct integer (short) values. Anyhow, I’ll keep hacking away. Thanks again.

From: Istewart

Re: MC68XXXX FP DATA FORMAT

I’m not quite sure what you mean by “... add byte”. What I think should happen, when you transfer the files with Kermit, is that you get an exact binary image of the original files from the PDP-11.

Kermit shouldn’t be swapping bytes, and parsing would only be done if you’re transferring the data in character format.

If that’s the case, then you can just call the SANE conversion routines to translate the string into internal (float or double) format, the internal details of the binary format are of no consequence.

However, the way I interpreted the problem initially is that you’re dealing with binary data. That being the case, you’re going to have to pick the PDP-11 version apart byte-by-byte, and possibly bit-by-bit in some cases!

As far as I can tell, the problem isn’t too difficult in principle, but making sure you’ve covered all the special cases (if any) could be another problem.

Let me know if I can give any more specific help (I’ll try, if I can figure it out!) Maybe you could post a detailed description of the PDP-11 format, and some examples of some of the data (just dump out a few of the numbers on the PDP-11 in Hex (or can you only do it in octal?) and post them in a bulletin, along with what they should be in decimal.

From: Mward

Re: MC68XXXX FP DATA FORMAT

Files sent using Kermit’s text mode can have conversions done to them. For example, a text file sent from a DOS machine to a Mac will have the nasty linefeed removed. If you want a bit-by-bit exact image of a file you have to specify a binary transfer.

From: Istewart

Re: MC68XXXX FP DATA FORMAT

Thanks for the information - I must admit that I’m not that familiar with Kermit ... however, I can’t imagine that he’d be doing anything other than a binary transfer if the data contains binary fields!

From: Walrus

Re: The LC

Don’t throw away the LC yet. I’ve heard of a company that is going to be marketing an upgrade for the LC that uses a 68040 processor. It could be the best upgrade deal since the Mac II/fx upgrade package.

From: Frankh

Re: The LC

Yeah, and it’ll probably cost more than the machine itself, and it’ll still be crippled by the narrow 16 bit bus (the ‘040 won’t be able to downgrade itself like the ‘020. I’m sure you can work around that with some simple logic, but that’s more nanoseconds lost...).

[Talk to Fusion Data Systems represented by Quantum Leap Systems at 15875 Highland Ct., Solana Beach, CA 92075, (619) 481-8427 or Fax (619) 481-3192. It costs about $3,000.-ed]

From: Gator

Re: 32-bit QD dev note

Can anyone tell me where I can get a copy of the 32-bit QD developers note mentioned in the Mac Primer Vol. 2? APDA has no ideas. Thanks!

From: Dandu

Re: 32-bit QD dev note

To my knowledge, the only official documentation Apple has issued regarding 32-bit QD was in the premiere issue of d e v e l o p. Aside from IM VI, of course.

From: Btoback

RE: 32-bit QD dev note

I’m enclosing copies of the docs. They were sent to all developers a couple of years ago; these are from the Developer CD series, vol. 4.

From: Btoback

Re: String formatting

I had to look up SysEnvirons! Try this:

sv = myEnv.systemVersion; /* For convenience */

sprintf(systemStr, “%d.%d.%d”, sv >> 8, /* Major version */

(sv >> 4) & 0xf, /* Minor version */

(sv & 0xf)); /* Fix level */

I’m doing it this way in order to split the system version into its three components. The major version is in the high-order 8 bits, hence the shift of 8 bits to the right to isolate it. The minor version is in the next four bits, so shift right four bits, and then mask off all the other bits. Finally, the fix is in the low-order four bits, so just mask off everything else.

Each “%d” is a placeholder for a single decimal number. I changed from hex (“%x”) to decimal because that’s what the user will want to see. The sprintf routine will copy the format string one byte at a time, and whenever it runs into a “%”, it assumes that the next few characters of the format string are a specification for an argument to sprintf.

By the way, if all you want to do is print the version, and don’t need to save the formatted version, you can use printf instead of sprintf, and omit the destination string (the first argument, in your case, <systemStr>). That’ll just print it.

From: Btoback

Re: THINK C Compilation and RAM cache

The RAM disc software on my friend’s PC is interesting: it survives anything except a power cycle, including a hardware reset. What I do on the PC is copy the BIG, static .h files to RAM disc (equivalent to combining most of the toolbox .h files), and let the compiler read everything else off disc. But the biggest win for a compile is to do the preprocessor’s and/or parser’s work for it, like the load/dump facility in MPW C/C++ (or Think C, for that matter).

I’ll have to find time to write the INIT. It would still be interesting, and we don’t know the behavior of the Mac’s file system -- how much looking does it do to find directory entries, etc.? That will also have a bearing on performance.

From: Siegel

Re: THINK C Compilation and RAM cache

The built-in RAM cache uses a linear search, so it does get very slow for large caches. There is an INIT called FTL which speed up THINK C and THINK Pascal builds by hitting the RAM cache as much as possible, but the benefits are superficial: (1) The entire project needs to fit into the cache, or else the cache hit rate drops so low that there’s practically no speedup; (2) The speedup is only noticeable for full builds when the project cache hit rate is very high; (3) Since the cache doesn’t get flushed until after the build is finished, there is a very real danger of project corruption in case of a crash, power outage, etc.

From: Dave

Re: THINK C Compilation and RAM cache

I know about FTL, but I think the author is mistaken about the usefulness of avoiding FlushVol. I believe that the Mac’s ram cache is a write-through cache for data integrity (so that danger you mentioned is moot). If you can verify/debunk this info, let me know.

From: Dave

Re: THINK C Compilation and RAM cache

Check out the upcoming version of 4Plus when it comes out. I have it on inside information from the author that he’s implemented a caching scheme that he and I were working on, based on what we were discussing. Apparently it works great.

From: Istewart

Re: That heap ...

Am I being paranoid?

In my continuing campaign aimed at learning to program the Mac, I’ve come across a situation that I don’t think should be occurring!

I’m testing my (fairly standard TextEdit based text editor!) program under Finder, seeing if I can break something by loading up all the DA’s in sight.

I’ve got this menu that allows me to purge memory, compact memory and break into MacsBug (each is a separate option). I execute them in that order, and examine the heap upon startup.

After loading DA’s and then closing them, I repeat the process, and look for anything that might be swallowing memory (I’ve already gone through this with the program itself).

Surprisingly enough, many DA’s seem to leave non-purgeable resources floating around in memory!!

For instance, the Chooser will leave two STR’s, one of them with my name in. Backdrop is even cleverer! It leaves itself there!? (if that’s the DRVR resource?)

Now, shouldn’t a DA zap anything it’s created, within reason, when it disappears? I mean, in theory, if I keep invoking a DA to do something, and then close it, reopen it ... after a while, couldn’t I run out of memory? (OK, it’ll take me a long time as my little program’s running on a 4meg SE, but surely some users may not have as much ...)

I guess under MultiFinder, it isn’t such a problem as the DA Handler will go away when all DA’s are closed, releasing this memory!

Thanks in advance for any thoughts on the subject ...

From: Mward

Re: That heap ...

You must be looking at the system heap. You would expect DAs like Chooser and Backdrop to leave stuff there, else how could they do their jobs? And the system heap is where you’re supposed to put stuff that survives application launches under Finder.

Do either of these DAs leave multiple copies of their “stuff”? That would be poor.

From: Istewart

Re: That heap ...

Thanks. But I’m actually looking at my application heap. After my purge, there isn’t much in it, except my CODE resources, several blocks of master pointers that I assigned at the start (after I found DA’s could temporarily allocate a lot of stuff, forcing new blocks to fragment the heap), and some MENU type resources etc.

Also, as I understand things, under Finder, the DA’s occupy the application heap. Under Multi-Finder, they’re loaded into a separate heap (the DA Handler that’s loaded for the purpose when a DA is opened).

I checked out the Chooser - it doesn’t seem to create multiple copies of the strings ... it just leaves them loaded and non-purgeable. This seems to me to be a bug - I can’t think of any reason why the Chooser would need them to be left there. After all, if they’re resources (on reflection, there’s more than enough evidence to presume this) it can just reload them next time it’s called!

From: Siegel

Re: THINK Pascal Future...

When THINK Pascal does a Reset, it calls both the user’s IAZNotify hook, if there is one, as well as calling ExitToShell on behalf of the user’s program. The IAZNotify hook is no longer used for standalone applications under MultiFinder, since the application zone is no longer initialized (strictly speaking), but you can use this technique when debugging inside the environment.

For more general-purpose use, you may want to install an _ExitToShell bottleneck.

From: Dave

Re: User-specified line breaks in TextEdit

Anybody out there know how to get TextEdit to break lines where YOU say it should? The best I can do so far is (ugh!) patch the TEWidthHook (See tech. note #207) so that TextEdit thinks that things have different widths from what they actually do. The problem with this is that you have to make assumptions about the algorithm that the Toolbox uses to break lines. I already tried using the wordBreak hook. It isn’t good enough. Please help!

I have an answer that works well, but is probably Apple-illegal. It involves patching the TERecal global variable. The mac will call through your own hook if you change the value of TERecal.

From: Walrus

Re: MacApp and LSP

Just after I posted that original message, I think I know what the problem is -- it’s running out of memory. MacApp under TP oinks, and the manual does say that it needs about 4 megs (I think). But they aren’t very adamant about it and they don’t tell you what might happen if you don’t have quite that much space (i.e. does it give you a friendly DLOG saying low on memory or does it just crash?). I might try to work in that environment again if I get some more SIMMs, otherwise I will work out the basic logic in TP and use MPW for the full-on compiles with MacApp.

From: Atom

Re: MacApp and LSP

You can get by with a 3 meg TP partition for small compiles, if I remember correctly... and I also seem to recall that TP sometimes fails, ah, ungracefully when running out of memory. Corrupted project files seem to be quite common when a MacApp program running inside TP crashes for whatever reason. I was running TP in a 4 MB partition and still had this problem. My suggestion that a file buffer wasn’t being flushed was really a shot in the dark, and I’d be very interested if anyone has any better idea as to what’s really going on here.

From: Bunk

Re: Writing a Time Mgr. Routine in C

*&#^@&$@&*#$. I’ve been trying to write a Time Manager called routine in Think C v4.0, and I can’t find a way to access application globals from the Time Mgr. routine. I’ve tried using the IM routines SetUpA5(etc.), and directly accessing the global CurrentA5 (move.l CurrentA5, A5 etc.) and tried looking at whether A0 (or A?) holds a pointer to the Time Mgr. task queue block (so I can indirectly store the app. A5), but I’ve been marginally successful at best. Can anyone give me any hints? A Time Mgr. task function shell would be nice! I’m slowly reaching the end of my rope about this and thinking of moving on to alternatives......

From: Myschif

Re: CTB and ADSP..

Howdy... I was wondering if anyone out there had had any luck getting some good documentation and source examples using the Comm. Toolbox and the Appletalk Data Stream Protocol. I’ve gotten varying levels of documentation about these two bits of code, but its all a mess.. I’m using Think C 4.0, and I’ve got access to the Dev. CD 5, 7.0b1 CD, and reams of technical documentation from Apple.... Any advice on a good place to start would be helpful...

From: Johnbaro

Re: Desktop pictures

I have several color pictures that I intended using as desktop pictures. I have ColorDesk, v1.0B7 (does anybody know where I can get a more recent version?), which puts up a PICT file as a desktop. The problem is that ColorDesk apparently uses the system’s default CLUT, rather than the CLUT saved with the PICT files. The result is that these great pictures look terrible on the desktop. Anybody know of a way around this, or another INIT that I could use to show color pictures on the desktop with their proper colors?

From: Aikidoka

Re: Desktop pictures

There is an init called CLUT-thing which allows you to use any CLUT you want for the system. A friend of mine has it, and I’ll see if I can get it and upload it here.

From: Rguerra

Re: Desktop pictures

You might consider DeskPicture, a component of Now Utilities 2.0, which does a remarkably good job at displaying (and customizing) desk pictures in their own colors. You can pick it up for a reasonable price from various mail order houses.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Posterino 4.4 - Create posters, collages...
Posterino offers enhanced customization and flexibility including a variety of new, stylish templates featuring grids of identical or odd-sized image boxes. You can customize the size and shape of... Read more
Chromium 119.0.6044.0 - Fast and stable...
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all Internet users to experience the web. List of changes available here. Version for Apple... Read more
Spotify 1.2.21.1104 - Stream music, crea...
Spotify is a streaming music service that gives you on-demand access to millions of songs. Whether you like driving rock, silky R&B, or grandiose classical music, Spotify's massive catalogue puts... Read more
Tor Browser 12.5.5 - Anonymize Web brows...
Using Tor Browser you can protect yourself against tracking, surveillance, and censorship. Tor was originally designed, implemented, and deployed as a third-generation onion-routing project of the U.... Read more
Malwarebytes 4.21.9.5141 - Adware remova...
Malwarebytes (was AdwareMedic) helps you get your Mac experience back. Malwarebytes scans for and removes code that degrades system performance or attacks your system. Making your Mac once again your... Read more
TinkerTool 9.5 - Expanded preference set...
TinkerTool is an application that gives you access to additional preference settings Apple has built into Mac OS X. This allows to activate hidden features in the operating system and in some of the... Read more
Paragon NTFS 15.11.839 - Provides full r...
Paragon NTFS breaks down the barriers between Windows and macOS. Paragon NTFS effectively solves the communication problems between the Mac system and NTFS. Write, edit, copy, move, delete files on... Read more
Apple Safari 17 - Apple's Web brows...
Apple Safari is Apple's web browser that comes bundled with the most recent macOS. Safari is faster and more energy efficient than other browsers, so sites are more responsive and your notebook... Read more
Firefox 118.0 - Fast, safe Web browser.
Firefox offers a fast, safe Web browsing experience. Browse quickly, securely, and effortlessly. With its industry-leading features, Firefox is the choice of Web development professionals and casual... Read more
ClamXAV 3.6.1 - Virus checker based on C...
ClamXAV is a popular virus checker for OS X. Time to take control ClamXAV keeps threats at bay and puts you firmly in charge of your Mac’s security. Scan a specific file or your entire hard drive.... Read more

Latest Forum Discussions

See All

‘Monster Hunter Now’ October Events Incl...
Niantic and Capcom have just announced this month’s plans for the real world hunting action RPG Monster Hunter Now (Free) for iOS and Android. If you’ve not played it yet, read my launch week review of it here. | Read more »
Listener Emails and the iPhone 15! – The...
In this week’s episode of The TouchArcade Show we finally get to a backlog of emails that have been hanging out in our inbox for, oh, about a month or so. We love getting emails as they always lead to interesting discussion about a variety of topics... | Read more »
TouchArcade Game of the Week: ‘Cypher 00...
This doesn’t happen too often, but occasionally there will be an Apple Arcade game that I adore so much I just have to pick it as the Game of the Week. Well, here we are, and Cypher 007 is one of those games. The big key point here is that Cypher... | Read more »
SwitchArcade Round-Up: ‘EA Sports FC 24’...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for September 29th, 2023. In today’s article, we’ve got a ton of news to go over. Just a lot going on today, I suppose. After that, there are quite a few new releases to look at... | Read more »
‘Storyteller’ Mobile Review – Perfect fo...
I first played Daniel Benmergui’s Storyteller (Free) through its Nintendo Switch and Steam releases. Read my original review of it here. Since then, a lot of friends who played the game enjoyed it, but thought it was overpriced given the short... | Read more »
An Interview with the Legendary Yu Suzuk...
One of the cool things about my job is that every once in a while, I get to talk to the people behind the games. It’s always a pleasure. Well, today we have a really special one for you, dear friends. Mr. Yu Suzuki of Ys Net, the force behind such... | Read more »
New ‘Marvel Snap’ Update Has Balance Adj...
As we wait for the information on the new season to drop, we shall have to content ourselves with looking at the latest update to Marvel Snap (Free). It’s just a balance update, but it makes some very big changes that combined with the arrival of... | Read more »
‘Honkai Star Rail’ Version 1.4 Update Re...
At Sony’s recently-aired presentation, HoYoverse announced the Honkai Star Rail (Free) PS5 release date. Most people speculated that the next major update would arrive alongside the PS5 release. | Read more »
‘Omniheroes’ Major Update “Tide’s Cadenc...
What secrets do the depths of the sea hold? Omniheroes is revealing the mysteries of the deep with its latest “Tide’s Cadence" update, where you can look forward to scoring a free Valkyrie and limited skin among other login rewards like the 2nd... | Read more »
Recruit yourself some run-and-gun royalt...
It is always nice to see the return of a series that has lost a bit of its global staying power, and thanks to Lilith Games' latest collaboration, Warpath will be playing host the the run-and-gun legend that is Metal Slug 3. [Read more] | Read more »

Price Scanner via MacPrices.net

Clearance M1 Max Mac Studio available today a...
Apple has clearance M1 Max Mac Studios available in their Certified Refurbished store for $270 off original MSRP. Each Mac Studio comes with Apple’s one-year warranty, and shipping is free: – Mac... Read more
Apple continues to offer 24-inch iMacs for up...
Apple has a full range of 24-inch M1 iMacs available today in their Certified Refurbished store. Models are available starting at only $1099 and range up to $260 off original MSRP. Each iMac is in... Read more
Final weekend for Apple’s 2023 Back to School...
This is the final weekend for Apple’s Back to School Promotion 2023. It remains active until Monday, October 2nd. Education customers receive a free $150 Apple Gift Card with the purchase of a new... Read more
Apple drops prices on refurbished 13-inch M2...
Apple has dropped prices on standard-configuration 13″ M2 MacBook Pros, Certified Refurbished, to as low as $1099 and ranging up to $230 off MSRP. These are the cheapest 13″ M2 MacBook Pros for sale... Read more
14-inch M2 Max MacBook Pro on sale for $300 o...
B&H Photo has the Space Gray 14″ 30-Core GPU M2 Max MacBook Pro in stock and on sale today for $2799 including free 1-2 day shipping. Their price is $300 off Apple’s MSRP, and it’s the lowest... Read more
Apple is now selling Certified Refurbished M2...
Apple has added a full line of standard-configuration M2 Max and M2 Ultra Mac Studios available in their Certified Refurbished section starting at only $1699 and ranging up to $600 off MSRP. Each Mac... Read more
New sale: 13-inch M2 MacBook Airs starting at...
B&H Photo has 13″ MacBook Airs with M2 CPUs in stock today and on sale for $200 off Apple’s MSRP with prices available starting at only $899. Free 1-2 day delivery is available to most US... Read more
Apple has all 15-inch M2 MacBook Airs in stoc...
Apple has Certified Refurbished 15″ M2 MacBook Airs in stock today starting at only $1099 and ranging up to $230 off MSRP. These are the cheapest M2-powered 15″ MacBook Airs for sale today at Apple.... Read more
In stock: Clearance M1 Ultra Mac Studios for...
Apple has clearance M1 Ultra Mac Studios available in their Certified Refurbished store for $540 off original MSRP. Each Mac Studio comes with Apple’s one-year warranty, and shipping is free: – Mac... Read more
Back on sale: Apple’s M2 Mac minis for $100 o...
B&H Photo has Apple’s M2-powered Mac minis back in stock and on sale today for $100 off MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $100 –... Read more

Jobs Board

Licensed Dental Hygienist - *Apple* River -...
Park Dental Apple River in Somerset, WI is seeking a compassionate, professional Dental Hygienist to join our team-oriented practice. COMPETITIVE PAY AND SIGN-ON Read more
Sublease Associate Optometrist- *Apple* Val...
Sublease Associate Optometrist- Apple Valley, CA- Target Optical Date: Sep 30, 2023 Brand: Target Optical Location: Apple Valley, CA, US, 92307 **Requisition Read more
*Apple* / Mac Administrator - JAMF - Amentum...
Amentum is seeking an ** Apple / Mac Administrator - JAMF** to provide support with the Apple Ecosystem to include hardware and software to join our team and Read more
Child Care Teacher - Glenda Drive/ *Apple* V...
Child Care Teacher - Glenda Drive/ Apple ValleyTeacher Share by Email Share on LinkedIn Share on Twitter Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.