TweetFollow Us on Twitter

Sep 86 Letters
Volume Number:2
Issue Number:9
Column Tag:Letters

Letters

Fortran Bugs

Jim Bishara

New Orleans

Help, Help, I can't get SetItemStyle toolbox call to work. I've spent at least 40 hours reading the Microsoft Fortran manual and no luck. I'm running a Mac Plus under Finder 4.1 (dumb Microsoft), with version 2.1. I used the DEMO.INC file supplied with the Fortran. When it tries to execute the trap, a bomb message returns ID=02. What can be wrong?

call toolbx(GetItemStyle, menuhandle, itemcount, chstyle) {works fine}

call toolbx(SetItemStyle,menuhandle,itemcount, chstyle) {bombs like a champ with ID 02}

[Probably the toolbx.par file is wrong. We've found lots of errors in it in the past. SetItemStyle probably is not a VAR. Just a guess. -Ed]

Aztec C 1.06H Release

Don McCauley

Ridgecrest, CA

I purchased my Aztec C from ComputerWare, a MacTutor advertiser, and on May 20, I received a beta release of version 1.06H, created May 12th. This time I received tens of pages of update documentation from their new manual, fresh off the press. Included with this update is an index. Unfortunately, the index seldom includes the key words I've looked for. For example, try to find in the index where to find how many characters are significant in a variable declaration? I've had trouble with multiple defined symbols using "theWindow" from Takatsuka's book Using the Macintosh Toolbox with C, page 70. Struct assignments in SetRects don't seem to work right for me. Any help for us Aztec'ers in the ABC's of C column? As far as HFS goes, basically it's "so far, so good" with this version. I really love the Manx UNIX like vi editor, Z. Manx is worth it just for z. I'm excited about C as a language and more specifically, about Aztec C for my Mac Plus.

[I'm sorry to report that Bob Gordon, our ABC's of C author, became seriously ill this month and has been unable to work on his C column for some time. We've talked to him and he reports he is beginning to recover and hopes to contribute another ABC article next month. We wish Bob a speedy recovery as I'm sure all our C fans do. A few notes and letters to Bob would be most appreciated I'm sure. Send them to Bob care of MacTutor and we will forward them on. -Ed.]

What's Wrong with this Picture?

move.l  #4, D0
_NewHandle
LEA   #$40E132,A1  ;get icon pointer in rom
move.l  A1, (A0) ;save pointer in new handle
 pea  top(A5)  ;set up rom call
move.l  A0, -(SP)  ;handle to icon
_PlotIcon ; plot it

[Note: I tried to write an assembly routine to plot the famous stolen icon from ROM memory, but it didn't work. -Ed.]

Icon Problem Above

Lon Kelly

College, AK

Thank you for your recent letter regarding the stolen icon problem. The simple explanation for the failure is that the line

LEA #$A0E132, A1

is not a legal 68000 assembler statement. This is because LEA will not use the immediate mode for the effective address field: only control addressing modes are allowable (see Morotola's Programmer's Reference Manual, p. 102 and p. 53). However, Mac C will assemble the line, setting the effective address bits as though it were a MOVE instruction. The linker listing shows the code actually generated:

Mac C Linker Listing:

4: 43 FC 00 40 E1 32    lea   #$40E132, A1
A: 20 89  move.l a1, (a0)
C: 48 6D FF  FC  pea top(a5)

Note that the first six bits indicate the effective address mode. Mac Nosy version 2.1 will disassemble the errant code without comment, as shown by the Nosy listing, but it loses track of 2 bytes and the next instruction:

Nosy output:

4: 43FC 0040 E132  LEA  #$40E1232,A1
; where did location A go?
C: 486D FFFC     PEA glob1(A5)

The Mac Zap listing shows that the code is actually on the disk as in the linker listing and that Nosy just got confused. It is interesting that Mac Zap and TMON, which have relatively simple disassemblers, recognize the illegality, while the assembler and Nosy do not.

Mac Zap Disassembly:

00F3C4  43FC   DC.W $43FC  ;illegal 

I believe you have another, more insideous problem doe to direct manipulation of "master pointers" created by _NewHandle. You seem to simply write over them. This leaves the memory manager with a master pointer pointing to ROM or to part of your code, rather than to a "relocatable block". I've never done this, but I sure expect it would cause problems with heap compaction, etc. What will happen if you call _DisposeHandle for a "handle" to ROM?

I think it would be a lot safer to do something like this: first make a constant pointer in your code, then push it's address (which would be a handle in the sense of a pointer to a pointer, but not in the context of the memory manager) as a parameter to _PlotIcon. See the untested suggestion below:

romicon:  dc.l   $40E132
 pea  top(a5)
 pea  romicon
 _PlotIcon

More on the Icon Problem

Peter Brown

La Mirada, CA

Thank you for your response to my letter. I have to admit my surprise at receiving it. You must be swamped wiath mail and I really appreciate your taking time out to write.

I took a look at the code you sent me and the stolen mac icon problem in particular. I banged in the whole listing as it stood and then fiddled around with it. The problem looked like this: the "LEA" instruction does not require use of the immediate mode designator, '#'. If it wasn't just a handwriting boo-boo, I'm surprised your assembler took the statement. [See previous letter. -Ed] This is possible pitfall #1. Well, to test things out using TMON, I inserted an:

LEA $40AD40, A1 ; NOTE FOR OLD ROMS

instruction at the spot in question, set the program counter to the beginning of ICONSTUFF: and let 'er rip (an instruction at a time). Lo and behold, I got a bunch of barbage in the output icon.

I then thought I'd trace through the ROM code to see what it looked like. The routine itself is pretty compact and straight forward, and no special handling of address registers. After a few different efforts, including getting garbage plotted from the icon data in RAM, I realized that the LEA 'ROM' location, A1 instruction assembled as 6 bytes, not 4 as with the LEA ICON, A1 which uses program counter relative addressing. I was coding over the next instruction! This is possible pitfall #2.

After re-assembling the file with the LEA $40AD40, A1 in place, (and no typos!), the code worked! Best of luck and keep up the great work with MacTutor.

 lea  icon, a1 ;assembles in 4 bytes 
 move.l a1, (a0) ;move pointer to a0 h
 pea   top(a5) ;push rect
 move.l a0, -(SP);push handle
 _PlotIcon;plot icon

[The advantage of being Editor of MacTutor, is that I have 6,000 "registered" programmers to call on for assistance! Thanks guys! -Ed]

Loves TML

Micahael Rollins

Broken Arrow, OK

I appreciate all the help your publication has provided over the last few months. There is nothing better than good examples to help learn a system as sophisticated as the Mac's. Since I have started using MacTutor and programming with TML's Pascal, I have managed to come a long way up the learning curve on the Mac. I find that I turn frequently to Mactutor for help with ROM calls and Resource Files that are not well explained in Inside Macintosh. I looke forward to each month's copy. Keep up the good work.

Tutor and TML Great

Terry Permeuter

Seattle, WA

Just got the TML Pascal compiler and saw an issue of MacTutor. Both look great! Enclosed is my check for a year's subscription. If you haven't done so yet, could you plan on an article or two on the differences between MacPascal and TML? The ads say TML compiles MacPascal programs, but I've already found some walls when trying that. A short guide on what to look for would be helpful! Keep up the good work!

[MacPascal is so non-standard that it is a dis-service to try and maintain compatibility with it. See the new LightSpeed Pascal, which IS TML compatible. -Ed]

Thanks for the Review

Dan Weston

Famous Assembly Author

I hope that by now you have received a final manuscript copy of volume two of the Complete Book of Macintosh Assembly Language Programming that you so thoroughly reviewed at the mid-way point. I was able to incorporate many of your suggestions into the final version, but not all. In particular, I didn't write anything about AppleTalk because I haven't ever had the opportunity to use it in any real situation. I think the strength of my books is that they are derived from my experience as a software developer, so I am reluctant to write about things that I have no direct experience with. Also, AppleTalk seems to be worth an entire book all by itself. I am very grateful for the comments that you made however, because I think they helped me produce a better book in the end.

I don't know exactly when we will go into final editing, but I assume that it will begin July sometime. I expect the final book out sometime in November. Thanks for the nice words in MacTutor on my new books!

Language Fanatic

David Adamski

Tulsa, OK

Well, I see by the EXP 5/1/86 notcie on my mailing label that it's time to renew my subscription to MacTutor. Enclosed please find my personal check for $30. MacTutor is one programming journal that I would NOT want to be without. Although I subscribe to a variety of computer publications, I look forward to receiving yours each month. As a language fanatic I feel that MacTutor is by far the most informative Journal, with regular articles on all the popular programming languages for the Mac. Sorry to hear about your robbery, hope my renewal helps you get back on track. Keep up the good work, and I wish you luck in the future. [MacTutor is enjoying great success this summer, thank you. -Ed.]

Questions

Bill Westcott

San Leandro

I got an idea! I've been trying to learn TML Pascal and Mac programming at the same time and your magazine has been a great help, but when my programs don't work, it's sort of like playing Zork. I keep trying everything till it works. Very time consuming. I noticed a green "3" sticker on one of my last MacTutor issues. That means that there are at least ten people in my three digit zip code who subscribe to your magazine. What do you think of a "Mac.Guru" program where people who know what they're doing might volunteer to answer stupid questions and your organization could somehow bring them together with askers of stupid questions? Just thought I'd ask. [Here's a stupid question: How would you do that? -Ed]

How do others do it?

J.M. Puckett

Austin, Tx

Oh No! I just received my April issue of MacTutor and on my label I see that my subscription is due to run out beginning of next month. So enclosed herein is a check for $30. Also I would like to know if you could send me an author's kit. I have just completed a series of desk accessories and applications using Megamax C, and am anxious to share some of the neat things I have found.

Yours is an excellent publication. I have learned a lot from it. However, I would like to submit a suggestion: Please suggest that some of your experts write articles on defining one's own menu, window, and control definitions. I have been attempting to write these kind of programming objects, and have had, for the most part, great success just by following the hints in Inside Macintosh; but I would sure like to see how others are creating such things. [Keep watching my Intermediate Mac'ing column especially last month's TML shell program. It had a lot of goodies! -Ed]

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Hazel 5.3 - Create rules for organizing...
Hazel is your personal housekeeper, organizing and cleaning folders based on rules you define. Hazel can also manage your trash and uninstall your applications. Organize your files using a familiar... Read more
Duet 3.15.0.0 - Use your iPad as an exte...
Duet is the first app that allows you to use your iDevice as an extra display for your Mac using the Lightning or 30-pin cable. Note: This app requires a iOS companion app. Release notes were... Read more
DiskCatalogMaker 9.0.3 - Catalog your di...
DiskCatalogMaker is a simple disk management tool which catalogs disks. Simple, light-weight, and fast Finder-like intuitive look and feel Super-fast search algorithm Can compress catalog data for... Read more
Maintenance 3.1.2 - System maintenance u...
Maintenance is a system maintenance and cleaning utility. It allows you to run miscellaneous tasks of system maintenance: Check the the structure of the disk Repair permissions Run periodic scripts... Read more
Final Cut Pro 10.7 - Professional video...
Redesigned from the ground up, Final Cut Pro combines revolutionary video editing with a powerful media organization and incredible performance to let you create at the speed of thought.... Read more
Pro Video Formats 2.3 - Updates for prof...
The Pro Video Formats package provides support for the following codecs that are used in professional video workflows: Apple ProRes RAW and ProRes RAW HQ Apple Intermediate Codec Avid DNxHD® / Avid... Read more
Apple Safari 17.1.2 - Apple's Web b...
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
LaunchBar 6.18.5 - Powerful file/URL/ema...
LaunchBar is an award-winning productivity utility that offers an amazingly intuitive and efficient way to search and access any kind of information stored on your computer or on the Web. It provides... Read more
Affinity Designer 2.3.0 - Vector graphic...
Affinity Designer is an incredibly accurate vector illustrator that feels fast and at home in the hands of creative professionals. It intuitively combines rock solid and crisp vector art with... Read more
Affinity Photo 2.3.0 - Digital editing f...
Affinity Photo - redefines the boundaries for professional photo editing software for the Mac. With a meticulous focus on workflow it offers sophisticated tools for enhancing, editing and retouching... Read more

Latest Forum Discussions

See All

New ‘Zenless Zone Zero’ Trailer Showcase...
I missed this late last week, but HoYoverse released another playable character trailer for the upcoming urban fantasy action RPG Zenless Zone Zero. We’ve had a few trailers so far for playable characters, but the newest one focuses on Nicole... | Read more »
Get your heart pounding quicker as Autom...
When it comes to mobile battle royales, it wouldn’t be disrespectful to say the first ones to pop to mind would be PUBG Mobile, but there is one that perhaps doesn’t get the worldwide recognition it should and that's Garena’s Free Fire. Now,... | Read more »
‘Disney Dreamlight Valley Arcade Edition...
Disney Dreamlight Valley Arcade Edition () launches beginning Tuesday worldwide on Apple Arcade bringing a new version of the game without any passes or microtransactions. While that itself is a huge bonus for Apple Arcade, the fact that Disney... | Read more »
Adventure Game ‘Urban Legend Hunters 2:...
Over the weekend, publisher Playism announced a localization of the Toii Games-developed adventure game Urban Legend Hunters 2: Double for iOS, Android, and Steam. Urban Legend Hunters 2: Double is available on mobile already without English and... | Read more »
‘Stardew Valley’ Creator Has Made a Ton...
Stardew Valley ($4.99) game creator Eric Barone (ConcernedApe) has been posting about the upcoming major Stardew Valley 1.6 update on Twitter with reveals for new features, content, and more. Over the weekend, Eric Tweeted that a ton of progress... | Read more »
Pour One Out for Black Friday – The Touc...
After taking Thanksgiving week off we’re back with another action-packed episode of The TouchArcade Show! Well, maybe not quite action-packed, but certainly discussion-packed! The topics might sound familiar to you: The new Steam Deck OLED, the... | Read more »
TouchArcade Game of the Week: ‘Hitman: B...
Nowadays, with where I’m at in my life with a family and plenty of responsibilities outside of gaming, I kind of appreciate the smaller-scale mobile games a bit more since more of my “serious" gaming is now done on a Steam Deck or Nintendo Switch.... | Read more »
SwitchArcade Round-Up: ‘Batman: Arkham T...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for December 1st, 2023. We’ve got a lot of big games hitting today, new DLC For Samba de Amigo, and this is probably going to be the last day this year with so many heavy hitters. I... | Read more »
Steam Deck Weekly: Tales of Arise Beyond...
Last week, there was a ton of Steam Deck coverage over here focused on the Steam Deck OLED. | Read more »
World of Tanks Blitz adds celebrity amba...
Wargaming is celebrating the season within World of Tanks Blitz with a new celebrity ambassador joining this year's Holiday Ops. In particular, British footballer and movie star Vinnie Jones will be brightening up the game with plenty of themed in-... | Read more »

Price Scanner via MacPrices.net

Apple M1-powered iPad Airs are back on Holida...
Amazon has 10.9″ M1 WiFi iPad Airs back on Holiday sale for $100 off Apple’s MSRP, with prices starting at $499. Each includes free shipping. Their prices are the lowest available among the Apple... Read more
Sunday Sale: Apple 14-inch M3 MacBook Pro on...
B&H Photo has new 14″ M3 MacBook Pros, in Space Gray, on Holiday sale for $150 off MSRP, only $1449. B&H offers free 1-2 day delivery to most US addresses: – 14″ 8-Core M3 MacBook Pro (8GB... Read more
Blue 10th-generation Apple iPad on Holiday sa...
Amazon has Apple’s 10th-generation WiFi iPad (in Blue) on Holiday sale for $349 including free shipping. Their discount applies to WiFi models only and includes a $50 instant discount + $50 clippable... Read more
All Apple Pencils are on Holiday sale for $79...
Amazon has all Apple Pencils on Holiday sale this weekend for $79, ranging up to 39% off MSRP for some models. Shipping is free: – Apple Pencil 1: $79 $20 off MSRP (20%) – Apple Pencil 2: $79 $50 off... Read more
Deal Alert! Apple Smart Folio Keyboard for iP...
Apple iPad Smart Keyboard Folio prices are on Holiday sale for only $79 at Amazon, or 50% off MSRP: – iPad Smart Folio Keyboard for iPad (7th-9th gen)/iPad Air (3rd gen): $79 $79 (50%) off MSRP This... Read more
Apple Watch Series 9 models are now on Holida...
Walmart has Apple Watch Series 9 models now on Holiday sale for $70 off MSRP on their online store. Sale prices available for online orders only, in-store prices may vary. Order online, and choose... Read more
Holiday sale this weekend at Xfinity Mobile:...
Switch to Xfinity Mobile (Mobile Virtual Network Operator..using Verizon’s network) and save $500 instantly on any iPhone 15, 14, or 13 and up to $800 off with eligible trade-in. The total is applied... Read more
13-inch M2 MacBook Airs with 512GB of storage...
Best Buy has the 13″ M2 MacBook Air with 512GB of storage on Holiday sale this weekend for $220 off MSRP on their online store. Sale price is $1179. Price valid for online orders only, in-store price... Read more
B&H Photo has Apple’s 14-inch M3/M3 Pro/M...
B&H Photo has new Gray and Black 14″ M3, M3 Pro, and M3 Max MacBook Pros on Holiday sale this weekend for $100-$200 off MSRP, starting at only $1499. B&H offers free 1-2 day delivery to most... Read more
15-inch M2 MacBook Airs are $200 off MSRP on...
Best Buy has Apple 15″ MacBook Airs with M2 CPUs in stock and on Holiday sale for $200 off MSRP on their online store. Their prices are among the lowest currently available for new 15″ M2 MacBook... Read more

Jobs Board

Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Senior Product Manager - *Apple* - DISH Net...
…Responsibilities** We are seeking an ambitious, data-driven thinker to assist the Apple Product Development team as our Wireless Product division continues to grow Read more
Senior Product Manager - *Apple* - DISH Net...
…Responsibilities** We are seeking an ambitious, data-driven thinker to assist the Apple Product Development team as our Wireless Product division continues to grow Read more
Senior Software Engineer - *Apple* Fundamen...
…center of Microsoft's efforts to empower our users to do more. The Apple Fundamentals team focused on defining and improving the end-to-end developer experience in Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.