STEALING THE ST PRINTER DRIVER (p. 20)
Tom Hudson sent us an Email recently in response to readers complaints that the JX80 printer driver source code on START #1 would not run correctly Tom says,
Well, I finally sat down and looked at the JX80 source. . . It turns out that when I rearranged the equates, I mistakenly allowed only two bytes for the MASK variable which is a LONG. Sheesh. So, the only change which needs to be made is:YCOUNT .equ 92At the top of the file.
SOPHISTICATED TEXT HANDLING (P. 52)
Corey Cole, another START author found a problem with his TEXTDEMO.C program in START #1. The fix applies only to users of Megamax C. Megamax users need to modify the malloc statement, casting the argument to an unsigned int. As it appeared on the START Disk, it was defined as a long int, which is correct for Alcyon, but will crash with Megamax. To do the cast, simply insert (unsigned int) immediately inside the first parenthesis of the malloc() statement.
CLIPBOARD (p. 75)
Douglas J Mathis, a system analyst from North Kingstown, Rhode Island, alerted us to the inefficiencies of the Clipboard trick which allows a program to ask, "Where am I?" He notes that the JSR plus MOVE solution takes 32 machine cycles, whereas the more elegant solution
LEA 2(PC),A0provides the same results in only 8 cycles, according to his calculations. Steve McIntosh of Long Beach, California, did a more ambitious dissection of the trick: he actually tried it with the AS68 assembler in the Developer's Kit. He found that AS68 had its own ideas about how
LABEL: MOVE.L (SP)+,A0
ought to be interpreted. It quietly changed the JSR to a BSR, but continued to list it as a JSR in the output. This actually makes a lot of sense: for most intents and purposes, a BSR would be preferred over a JSR. But, when the assembler swaps the JSR with a BSR, it winds up with a branch offset of zero! This gives the assembler tummy trouble, so it then changes the BSR to a NOP without even a hiccup, let alone an error message. When you execute the code, not only do you not find out where you are, but it messes up the stack, resulting in almost certain doom. Thanks Steve.