LisaList2

General Category => LisaList2 => Building LOS From Source => Topic started by: Eschaton on March 02, 2026, 11:20:15 PM

Title: Lisa A-trap dispatcher
Post by: Eschaton on March 02, 2026, 11:20:15 PM
The Lisa OS sources don't include the sources to Lisa's A-trap dispatcher, instead it's just a CodeBlock that's copied forward from one copy of INTRINSIC.LIB to the next, and is set as the handler in source/LOAD.TEXT by Setup_IUInfo.

For that reason, I've used my tools to extract the code and have a disassembled version here:

https://gist.github.com/eschaton/2c9cdcddccd3dde177005872ddd6e946

This should help us figure out how to interpret A-traps located in Lisa code. I'm pretty sure they get inserted by the linker (rather than the compiler's code generator) for calls to intrinsic libraries, or something like that, since the 68000/8/10/12 only have 16-bit PC-relative branches.

From disassembling several different bits of Lisa code, it looks like the A-line instruction word and the following word contain some sort of index that's used to determine the destination of the call. Unfortunately, it's not immediately obvious how to interpret that destination.
Title: Re: Lisa A-trap dispatcher
Post by: TorZidan on March 03, 2026, 05:52:11 PM
I don't really understand what the A-trap dispatcher assembly code does, but I wonder is this code the same "aha" moment that Ray Arachelian talks about at https://youtu.be/o5bZBXqfeAU?si=miO4k4Bk6kBB4jKt&t=560 ? Understanding that assembly code allowed him to get LOS to finally work in LisaEm, after many years of try-and-fail.
Title: Re: Lisa A-trap dispatcher
Post by: Eschaton on March 03, 2026, 08:13:07 PM
I've never seen that video, I'll have to check it out!

Lars Brinkhoff found an older version of the annotated assembly—and a description of the IUJSR, IUJMP, IULEA, and IUPEA instructions it's used to implement—in the Pascal internals manual on Bitsavers, so I've annotated my disassembly based on that and included a description of the instructions.

When I add disassembly to lisaobj (or write a separate lisadis), I'll be able to actually include these IUxxx instructions too.