68kMLA Classic Interface

This is a version of the 68kMLA forums for viewing on your favorite old mac. Visitors on modern platforms may prefer the main site.

Click here to select a new forum.
Wanted: A List of Macintosh Toolbox A-Line Traps.
Posted by: Dennis Nedry on 2010-02-28 18:10:05
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.

Posted by: techfury90 on 2010-02-28 19:09:03
Might not have the jump instructions, just addresses. There are some features of 68k addressing modes that make that feasible.

Posted by: techfury90 on 2010-02-28 19:13:29
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.

Posted by: ClassicHasClass on 2010-02-28 20:44:35
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.

Posted by: Dennis Nedry on 2010-03-01 14:01:00
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?

Posted by: ClassicHasClass on 2010-03-01 21:29:42
Actually, I think I may still have it in my archives. Can you accept a gopher link?

Posted by: Dennis Nedry on 2010-03-01 21:34:58
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!

Posted by: ClassicHasClass on 2010-03-03 08:30:41
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/by-request/classic-mac

It's a very handy tool.

Posted by: Dennis Nedry on 2010-03-03 10:31:37
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/by-request/classic-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.

Posted by: yuhong on 2010-04-15 23:52:18
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.

Posted by: Dennis Nedry on 2010-04-16 08:54:04
Thanks for the info.

1