TweetFollow Us on Twitter

Feb 97 Tips

Volume Number: 13 (1997)
Issue Number: 2
Column Tag: Tips & Tidbits

Tips & Tidbits

By Steve Sisak

I hope this surprises at least some readers and helps avoid a bug or two. Here's a self-test to see what you know about subtraction. Be honest.

On a PPC chip, which of the following sets the carry bit (assuming an instruction form that sets the carry is used)?

a) 0 - 0

b) 0 - 1

On a 68K chip, which sets the carry?

c) 0 - 0

d) 0 - 1

Did you answer (a) and (d)? That's right. Subraction is defined differently on PPC than on 68K, which might catch you off guard, especially if you're an old hand at 68K asm.

On 68K, sub d0,d1 is defined as d1 = d1 - d0, and the carry behaves like a simple borrow. However, PPC makes direct use of the definition -n = NOT(n) + 1 and, subf r5,r3,r4 is defined as r5 = r4 + NOT(r3) + 1, making the XER[CA] bit (for instructions that update it) reflect an addition carry instead of a borrow.

This difference propagates to extended subtraction. You would do extended subtraction similarly on either chip.

68K:

1) sub low words.

2) subx high words.

PPC:

1) subfc low words.

2) subfe high words.

However, the internal details are different.

subx d0,d1 --> d1 = d1 - d0 - X bit.

subfe r5,r3,r4 --> r5 = r4 + NOT(r3) + XER[CA].

There are many other examples where the carry works completely differently on the two chips (e.g., arithmetic right-shifts).

68K: carry is set (for any type of source) if and only if the LAST bit shifted out of the right was a one.

PPC: carry is set only if the source was negative and ANY ones are shifted out of the right.

Yes, it's all in the manuals, but who reads manuals?

Bill Karsh
billKarsh@aol.com

1) When patching a libraray, _Open needs more param block fields cleared than does _OpenDF.

2) when changing the font of a (popup) menu by hooking the MDEF, LastSPExtra must be set to -1 to clear the font cache both before calling the MDEF and after restoring the font stuff.

Tony Nelson
tonyn@tiac.net

Having trouble getting Apple Menu Options' hierarchical menus to show? You may not have called MaxApplZone() early in your application. The various patches AMO installs require sufficient heap to draw the menus; if you don't expand your heap to its maximum early on, the patches may not have the right amount of memory available when first called, and your hierarchical Apple menu will not draw.

Brian Bechtel
blob@apple.com

Apple's System 7.5.3 (aka System 7.5 Update 2.0) adds a slick new way to quickly get around while in a StandardFile dialog. While the dialog is up, click on the desktop or any folder open on your desktop. You did not receive the annoying beep you expected as in 7.5.1 and earlier - instead, StandardFile took you right to that directory! This is invaluable when you have your deeply-nested work folder opened on the desktop and StandardFile decides to stick you in some remote location. Now anything visible is one click away! If Apple would give us the new movable modal file dialogs, we could really take advantage of this. These are coming in Copland, but I am hoping they will appear in System 7.6 that has OpenDoc built-in.

Bill Hayden
nikol@codewell.com

 
AAPL
$565.32
Apple Inc.
+0.00
MSFT
$29.07
Microsoft Corpora
+0.00
GOOG
$603.66
Google Inc.
+0.00
MacTech Search:
Community Search:

Empire of the Eclipse Review
Empire of the Eclipse Review By Carter Dotson on May 24th, 2012 Our Rating: :: OVERSHADOWINGiPhone App - Designed for the iPhone, compatible with the iPad Empire of the Eclipse is an ambitious strategy MMO that is very deep, and... | Read more »
Bejeweled HD Review
Bejeweled HD Review By Jennifer Allen on May 24th, 2012 Our Rating: :: ADDICTIVEiPad Only App - Designed for the iPad The iPad version of the ever addictive Match Three title.   Developer: PopCap Price: $3.99 Version Reviewed: 1... | Read more »
Facebook Releases New Camera App To Stre...
While not a replacement for Instagram, Facebook Camera is a good first step in this month+ old union of the two companies. Released today, Facebook camera looks to streamline the viewing of photos and the uploading of them. The app allows you to... | Read more »
Missile Monkey Review
Missile Monkey Review By Lisa Caplan on May 24th, 2012 Our Rating: :: FLYING LOWUniversal App - Designed for iPhone and iPad Missile Monkey is a must miss   Developer: Munsey Clan Games Price: $0.99 Version Reviewed: 1.0 Device... | Read more »
Boomlings Review
Boomlings Review By Lisa Caplan on May 24th, 2012 Our Rating: :: FUN FREEBIEUniversal App - Designed for iPhone and iPad Boomlings is a traditional matching puzzle game, with some explosive twists   | Read more »
Dave vs Cave Review
Dave vs Cave Review By Jason Wadsworth on May 24th, 2012 Our Rating: :: WATCH FOR FALLING ROCKSUniversal App - Designed for iPhone and iPad Kid falls down hole, kid gets trapped in cave, kid fights evil rock monsters to escape... | Read more »
Python Pocket Power: Python Bytes 3 – Mo...
Python fans are certain to welcome the best bits from the penultimate season of the BBC sketch comedy in a new iPhone app: Python Bytes 3 – Monty Python Series 3. If you have a flair for the obvious, you’ll correctly assume this is third in a series... | Read more »

Price Scanner via MacPrices.net

13″ 2.8GHz MacBook Pro on sale for $100 off MSRP
Adorama has lowered their price on the 13″ 2.8GHz MacBook Pro to $1399 including free shipping plus NY/NJ sales tax only. Their price is $100 off MSRP, and it’s the lowest price for this model from... Read more
Apple refurbished iPads available starting at $279
 The Apple Store Online has dropped prices on Apple Certified Refurbished iPad 2s and original iPads by as much as $50, with models now starting at $279. Apple’s one-year warranty is included with... Read more
Security Based Portable Operating System, Pocket D...
In conjunction with their consumer technology product, Pocket Desktop, a USB device that offers consumers enhanced security and portability in computing, has announced a new strategic alliance with... Read more
Apple’s Jonathan Ive Knighted By Britain’s Princes...
The BBC reports that Apple Senior Vice President Of Industrial Design Jonathan Ive is now Sir Jonathan Ive, having been knighted by Queen Elizabeth II’s daughter Anne, the Princess Royal (and an iPad... Read more
Microsoft Fixing to release Office for iOS and And...
BGR’s Jonathan S. Geller says BGR has learned from a “reliable source” that Microsoft is planning to release the company’s full Office suite for not only Apple’s iPad, but for Android tablets as well... Read more
Mac mini Server available for $949, $50 off MSRP
Adorama has Mac mini Servers on sale for $949 including free shipping. Their price is $50 off MSRP, and it’s the lowest price available for this model from any Apple Authorized Reseller. NY and NJ... Read more
21″ 2.7GHz iMac on sale for $1399, $100 off full r...
Adorama has the 21″ 2.7GHz iMac on sale for $1399 including free shipping. Their price is $100 off MSRP, and it’s the lowest price for this model from any Apple Authorized Reseller. NY and NJ sales... Read more
iMacs on sale bundled with free upgrade to 8GB RAM
MacConnection has 2011 iMacs in stock today with a free upgrade to 8GB of RAM. Shipping is also free. Their prices represent a $200+ savings over custom 8GB iMacs at The Apple Store: - 21″ 2.5GHz... Read more

Jobs Board

iPhone Mobile Developer at Mapmyfitness...
About MapMyFitness, Inc.: We're a well-funded and fast growing start-up. We're building the future of fitness applications on both the web and mobile. MapMyFitness is consistently ranked among the... Read more
Civil Engineering iPhone/iPad Applicatio...
I want to hire an application developer to design a universal iPhone/iPad application. The app is a calculator for civil engineers. Please see the attached Scope of Work. Desired Skills: iPhone, iPad... Read more
Helpdesk Support Technician - Mac Expert...
Mac hardwaresoftware preferably as a Mac Genius or Apple technician Demonstrated ability to troubleshoot ... in Mac OS X/Windows OS administration, exp supporting Mac, certified Apple and/or Windows... Read more
Mac Expert - Apple Online Store at Apple...
before calling a helpdesk for assistance). Description The Mac Expert is responsible for providing consultative ... to be effective, the Mac Expert will be knowledgeable about Mac product features... Read more
iOS Developer (iPhone and iPad) at Mahal...
Mahalo is looking for talented iOS developers to join its team of highly skilled engineers. Weve already released multiple successful apps in the Apple App Store with well over a million installs... Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.