^ma 1 56 ^pl 0 ^ju ^ceAUTO LOOP POWER DOWN FOR HP-41 ^ce============================== ^coEquipment required: HP-41 (any model) ^co RAM box. ^co HP-IL ^ju^sk01"BOTHERATION, that's another set of printer/tape drive Ni-Cads that need reviving!" ^sk1These, (or stronger, less printable!), words used to be well known to my friends. While I would always remember to turn my '41 off, I frequently left my thermal printer on. This if un-noticed would flatten the batteries to such an extent that the printer could not charge them, and they required a higher voltage shock to revive them. Ni-Cads cannot stand this abuse often and I was beginning to fear that I would need to buy a new set. The alternative was to buy a HP-71B which issues a loop power down command when it is switched off. For a student on a meagre budget this was out of the question. I therefore wrote a routine to simulate this effect on the '41. It makes use of the interrupt location at xFF7 which is checked when the calculator is turned off using the 'ON' key or function OFF. ^sk1 ^co pwrdn xFBD 398 C=ST Save C[13:3] and SS0 in N xFBE 070 N=C xFBF 3B8 READ 14(d) Set error ignore xFC0 17C RCR 6 (flag 25) xFC1 358 ST=C xFC2 148 SETF 6 xFC3 398 C=ST xFC4 13C RCR 8 xFC5 3A8 WRIT 14(d) xFC6 05A C=0 M Make addr. 7000h {ROMCHK xFC7 1D0 LD@R 7 guarantees R=6} xFC8 330 FETCH xFC9 106 A=C S&X xFCA 130 LDI xFCB 01C HEX 01C xFCC 366 ?A#C S&X Is IL ROM present? If so xFCD 02F JC +05 xFD2 XEQ PWRUP, XEQ PWRDN. If xFCE 301 NC XQ transition error PWRUP xFCF 1DC 77C0 will not return but the xFD0 329 NC XQ '41 will turn off. xFD1 1FC 7FCA # xFD2 0B0 C=N Restore C[13:3] and SS0 xFD3 35B ST=C xFD4 3CD NC GO xFD5 09E RMCK10 Exit off xFF7 233 JNC pwrdn ^ju^sk1# If only PWRDN is used and the loop is asleep, it will power up, and the ignored transmit error that is caused will turn the calculator off, leaving the loop on! This routine is not perfect. If the calculator turns itself off after 10 minutes the loop is left on. ^sk1Rabin Ezra [#19H]