> On19 Feb 2025 18:39:08 -0500, Chuck Guzis via cctalk wrote: > >>> >>>> One of most ingenious coding tricks to me was the problem of saving and >>>> restoring all registers without resorting to an exchange jump. We used >>>> that one as a test for applicants. >>> >>> Argh... I know I've seen this trick, but it's been too many years. How >>> about a hint? >> >> It uses the RJ instruction to record register content, bit-by-bit. >> Think about it--RJ is about the only instruction that can modify memory >> without fiddling with the A6 and A7 registers. >> > > Of course... I vaguely recalled there was a bit-by-bit save, but didn't > think of the RJ. Thanks.
A full example of this code is in the DEBUG package of CAL SNOBOL <https://mcjones.org/CAL_SNOBOL/>, starting at label SAVEREG: Original version: https://mcjones.org/CAL_SNOBOL/UArizona/SNOBOL.MAC.html Revised version: https://mcjones.org/CAL_SNOBOL/UTexas/DEBUG.html