Wanted: A List of Macintosh Toolbox A-Line Traps.

Includes system stuff, productivity, emulation, design, and games for pre-OS X Macs!

Wanted: A List of Macintosh Toolbox A-Line Traps.

Postby Dennis Nedry » 01 Mar 2010, 02:10

I am having a LOT of fun picking around in these ROMs. I was trying to extract the easter egg images from the Mac SE ROM, and I've hit a bump in the road. There are a few A-Line Trap instructions, which essentially allow your program to use some low-level subroutines provided by Apple.

I don't completely understand how these work though. For example, I've run into a call to _UnpackBits (instruction A8D0). The ROM code pushes a couple things onto the stack before this call. However, I'm not sure how this _UnpackBits thing works, nor where it's code is located in ROM.

I know that there is a "compressed A-line table" located at $0001 AA9C in the SE ROM. I believe that this is a vector (aka double-jump) table. So in theory, you should hit an A-line code, 68000 raises an invalid opcode interrupt, jumps to this table, then jumps again to the actual trap implementation. (We've all seen when this fails - "Unimplemented trap"!) But I'm not sure how this works. And how it says the table is "compressed" sounds daunting.

Has anyone had any experience with these strange A-line traps? Is there a spec somewhere that describes each A-Line instruction? I have found a listing of A-Lines but no descriptions.
Dennis Nedry's 68kMLA Wiki Userpage, including my extensive Mac collection.
Dennis Nedry was an awesome Mac hacker, but I hack Macs in his name to preserve, not to destroy.
User avatar
Dennis Nedry
 
Joined: 22 Jul 2008, 15:32
Location: Jurassic Park Visitor Center

Re: Wanted: A List of Macintosh Toolbox A-Line Traps.

Postby techfury90 » 01 Mar 2010, 03:09

Might not have the jump instructions, just addresses. There are some features of 68k addressing modes that make that feasible.
Power Mac G4 "QuickSilver 2002": 800 MHz G4, 768 MB RAM, 80 GB HD, CD-RW, Radeon 7500
PowerBook G3 "Wallstreet II/PDQ": 233 MHz G3, 384 MB RAM, 10 GB HD, Mac OS 9.2.2
techfury90
 
Joined: 01 May 2007, 23:27
Location: Raleigh, NC, USA

Re: Wanted: A List of Macintosh Toolbox A-Line Traps.

Postby techfury90 » 01 Mar 2010, 03:13

Oh, I forgot... you may want to disassemble the A-line trap handler. This is the code the 68k CPU calls when you call an A-line instruction. I believe it is located at address 0x30. Note that just the address is given at 0x30.
Power Mac G4 "QuickSilver 2002": 800 MHz G4, 768 MB RAM, 80 GB HD, CD-RW, Radeon 7500
PowerBook G3 "Wallstreet II/PDQ": 233 MHz G3, 384 MB RAM, 10 GB HD, Mac OS 9.2.2
techfury90
 
Joined: 01 May 2007, 23:27
Location: Raleigh, NC, USA

Re: Wanted: A List of Macintosh Toolbox A-Line Traps.

Postby ClassicHasClass » 01 Mar 2010, 04:44

There is a tool called CodeWriter (I know, not an original name) that documents the Toolbox, including the A-line traps, thoroughly. I used it heavily when I was still coding in MacMETH.
User avatar
ClassicHasClass
 
Joined: 03 Jul 2009, 16:48
Location: Electron Alley

Re: Wanted: A List of Macintosh Toolbox A-Line Traps.

Postby Dennis Nedry » 01 Mar 2010, 22:01

ClassicHasClass wrote:There is a tool called CodeWriter (I know, not an original name) that documents the Toolbox, including the A-line traps, thoroughly. I used it heavily when I was still coding in MacMETH.

This documentation sounds exactly like what I need. I can't find CodeWriter though. Google is notoriously bad for finding old stuff like that. Do you have any idea where I might find this?
Dennis Nedry's 68kMLA Wiki Userpage, including my extensive Mac collection.
Dennis Nedry was an awesome Mac hacker, but I hack Macs in his name to preserve, not to destroy.
User avatar
Dennis Nedry
 
Joined: 22 Jul 2008, 15:32
Location: Jurassic Park Visitor Center

Re: Wanted: A List of Macintosh Toolbox A-Line Traps.

Postby ClassicHasClass » 02 Mar 2010, 05:29

Actually, I think I may still have it in my archives. Can you accept a gopher link?
User avatar
ClassicHasClass
 
Joined: 03 Jul 2009, 16:48
Location: Electron Alley

Re: Wanted: A List of Macintosh Toolbox A-Line Traps.

Postby Dennis Nedry » 02 Mar 2010, 05:34

ClassicHasClass wrote:Actually, I think I may still have it in my archives. Can you accept a gopher link?

I haven't used the Gopher protocol before but I believe I can figure it out. It looks like there's an add-on for Firefox that will allow me to do it. Send away!
Dennis Nedry's 68kMLA Wiki Userpage, including my extensive Mac collection.
Dennis Nedry was an awesome Mac hacker, but I hack Macs in his name to preserve, not to destroy.
User avatar
Dennis Nedry
 
Joined: 22 Jul 2008, 15:32
Location: Jurassic Park Visitor Center

Re: Wanted: A List of Macintosh Toolbox A-Line Traps.

Postby ClassicHasClass » 03 Mar 2010, 16:30

Firefox can handle gopher links directly (at least currently -- see bug 388195). However, if you are referring to the OverbiteFF extension, I can endorse it wholeheartedly. ;) (The reason: I wrote it.) OverbiteFF patches some gaps in Fx's gopher support, so it's all good.

Anyway, I have created a by-request folder on the gopher server, so grab it out of

gopher://gopher.floodgap.com/1/archive/ ... lassic-mac

It's a very handy tool.
User avatar
ClassicHasClass
 
Joined: 03 Jul 2009, 16:48
Location: Electron Alley

Re: Wanted: A List of Macintosh Toolbox A-Line Traps.

Postby Dennis Nedry » 03 Mar 2010, 18:31

ClassicHasClass wrote:Firefox can handle gopher links directly (at least currently -- see bug 388195). However, if you are referring to the OverbiteFF extension, I can endorse it wholeheartedly. ;) (The reason: I wrote it.) OverbiteFF patches some gaps in Fx's gopher support, so it's all good.

Anyway, I have created a by-request folder on the gopher server, so grab it out of

gopher://gopher.floodgap.com/1/archive/ ... lassic-mac

It's a very handy tool.

Thanks I got it. I'll have a look at it a little later. The Mac I'm on is PPC, but I just discovered it does not have an OS 9 System Folder.
Dennis Nedry's 68kMLA Wiki Userpage, including my extensive Mac collection.
Dennis Nedry was an awesome Mac hacker, but I hack Macs in his name to preserve, not to destroy.
User avatar
Dennis Nedry
 
Joined: 22 Jul 2008, 15:32
Location: Jurassic Park Visitor Center

Re: Wanted: A List of Macintosh Toolbox A-Line Traps.

Postby yuhong » 16 Apr 2010, 06:52

The Universal Headers has a list of the documented ones in Traps.h.
You can look in other header files for the prototypes of the calls.
yuhong
 
Joined: 14 Mar 2010, 05:48

Re: Wanted: A List of Macintosh Toolbox A-Line Traps.

Postby Dennis Nedry » 16 Apr 2010, 15:54

Thanks for the info.
Dennis Nedry's 68kMLA Wiki Userpage, including my extensive Mac collection.
Dennis Nedry was an awesome Mac hacker, but I hack Macs in his name to preserve, not to destroy.
User avatar
Dennis Nedry
 
Joined: 22 Jul 2008, 15:32
Location: Jurassic Park Visitor Center


Return to Software

Who is online

Users browsing this forum: No registered users and 0 guests