^ma 1 56 ^pl 0 ^ju ^sk0 PATCH FOR ESMLDL-OS ^sk0 ------------------- ^coEquipment required HP-41 (any model) ^co RAM and Eprom box. ^co ESMLDL-OS ^ju^sk1A bug was reported at the London meeting with ESMLDL-OS version 7B. With the OS attached, if a PSE was executed in a FOCal program, the calculator would hang. Investigation found the following code in the OS:- ^sk1 pse xFF4 3E0 RTN ^sk1xFF4 is the first of the interrupt locations at the end of the ROM and is checked whenever a PSE is executed. If the location is non-zero a jump is performed to xFF4. This is normally a JNC to the interrupt code. The correct way to exit an interrupt routine is to NC GO RMCK10 or RMCK15. The return stack contains no valid addresses and in any case appears to be 0. Thus when a PSE is executed, the calculator checks xFF4 and finding it non-zero executes a RTN to 0. As the display is on this puts the calculator into light sleep. ^sk1To solve the problem it is necessary to prevent the calculator checking the OS ROM. When the calculator is scanning the ROMs the C register is formatted as follows: ^sk1xx:xr:rr:rn:FF:4x:xx ^sk1with PTR P=6. ^sk1rrrr is the address that ROMCHK will return to after polling all the ROMs. n is the number of the ROM being entered. Two code segments can be used to prevent the OS ROM being checked. The first one restarts the checking of interrupt locations with the ROM after the OS ROM. ^sk1 ^coskip xFF1 350 LD@R D Where the OS ^co xFF2 3CD 09E NC GO RMCK10 Rom is in page ^copse xFF4 3EB JNC skip D & x ( D ^ju^sk1This makes n equal to the page address of the OS using the fact that P=6. On return to ROMCHK, n is incremented to create the address of the next ROM to be checked, thus starting at the page after the OS ROM. Obviously if this code is not in the page immediately before the OS ROM some ROMs will not be scanned. This is not as serious as it sounds as not many ROMs use this entry point. The other code segment is used if the OS is in page F or if there is no need to scan other ROMs. It kills the poll stone dead and is one word shorter. ^sk1 ^cokilpol xFF2 07C RCR 4 Get ROMCHK rtn ^co xFF3 1E0 GOTO ADR and jump to it ^copse xFF4 3F3 JNC kilpol ^ju^sk1ROMCHK is located at 27E6 (23746oct) and begins on page 270 of the VASM listings. For another interrupt routine see my auto loop power down routine. ^sk1Rabin Ezra [#19H]