Post Reply 
Time Module Clear Alarm
03-17-2023, 10:46 AM
Post: #1
Time Module Clear Alarm
Hi,
the standard Time Module does not have the possibility to clear any alarms like the CX has with CLRALMS.
Is there a mcode or synthetic program which can alter/clear the alarm registers?
Ralf

/41/48/
Find all posts by this user
Quote this message in a reply
03-17-2023, 02:53 PM
Post: #2
RE: Time Module Clear Alarm
I did a fast check on the HHC 2022 USB key and did not found a program that does this.

But it should not be that complicated to create.

You need to ...
  1. read the current curtain position (read register c) into X
  2. save X into a data register or keep it in the stack
  3. lower the curtain to 0C0 (update register c)
  4. scan data register to find the alarm I/O buffer (ID F)
  5. once found, clear the data registers related to the alarm buffer
  6. get the original curtain position (from the stack or data register)
  7. restore curtain position to the original location (update register c)

Another method ...
  1. read the current curtain position (read register c) into X
  2. save X into a data register or keep it in the stack
  3. lower the curtain to 0C0 (update register c)
  4. scan data register to find the alarm I/O buffer (ID F)
  5. change ID F to a ID that you do not have a module that will claim it at startup
    (let say ID C, used by the HP-IL development module and assuming that you do not have that module plugged-in)
  6. get the original curtain position (from the stack or data register)
  7. restore curtain position to the original location (update register c)
  8. power cycle (OFF then ON)
    → at power on the buffer will be cleared by the system because the ID will not be claimed by the ON (xFF9) polling point.

Keep in mind that most system registers and all I/O buffers content must be managed as NNN.

Sylvain
Find all posts by this user
Quote this message in a reply
03-17-2023, 04:48 PM
Post: #3
RE: Time Module Clear Alarm
Hi Sylvain,
that sounds good and possible.
I thought of saving the alms regs (no alarms, or one old) to x-memory, then setting my continuous 60 s timer for getting data from the 3421 and if the threshold reached restore the noalms back from x-memory hoping it will overwrite all exisiting alarms.
Your advice will be more professional and less bytes i think.

Points 1-3 and 5-7 sounds ok for me but how

4. scan data register to find the alarm I/O buffer (ID F)

I have only a minimum experience with syntehtic programming.

The alm regs are on top of the key asn regs, is this not 192 (+1) default ?
I have the PPC Rom, can i use the curtain finder CUR? or is RCL / STO c sufficient?

Ralf

/41/48/
Find all posts by this user
Quote this message in a reply
03-17-2023, 07:01 PM
Post: #4
RE: Time Module Clear Alarm
Hello Ralf,

I am at work, in the meantime, page 14 & 15 of Jeremy Smith's HP-41 Synthetic Quick Reference Guide contains the memory map and the I/O buffer structure.

You can find Jeremy Smith's HP-41 Synthetic Quick Reference Guide on Eric Rechlin's calculator literature archive web site.

Sylvain
Find all posts by this user
Quote this message in a reply
03-17-2023, 07:08 PM
Post: #5
RE: Time Module Clear Alarm
(03-17-2023 10:46 AM)Hiwi Wrote:  Hi,
the standard Time Module does not have the possibility to clear any alarms like the CX has with CLRALMS.
Is it possible to disassemble the CX rom code and reimplement it?
Find all posts by this user
Quote this message in a reply
03-17-2023, 08:03 PM
Post: #6
RE: Time Module Clear Alarm
(03-17-2023 07:08 PM)Dol Wrote:  Is it possible to disassemble the CX rom code and reimplement it?
Sure but will need a 10-bit word MLDL/EPROM/EEPROM/Flash/RAM box/module to run it.
Find all posts by this user
Quote this message in a reply
03-17-2023, 09:00 PM
Post: #7
RE: Time Module Clear Alarm
(03-17-2023 08:03 PM)Sylvain Cote Wrote:  
(03-17-2023 07:08 PM)Dol Wrote:  Is it possible to disassemble the CX rom code and reimplement it?
Sure but will need a 10-bit word MLDL/EPROM/EEPROM/Flash/RAM box/module to run it.

To expand a tiny bit on Sylvain's comment, in the 41, normal RAM can only be used for FOCAL programs; in order to run MCODE, one must put the code into a RAM or ROM device plugged into a Port/Page. The simplest way to do so is probably to get a NoV-64D module from Diego, but there are many options, depending on how far down the rabbit hole you want to go

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-17-2023, 10:29 PM
Post: #8
RE: Time Module Clear Alarm
I got it working with synthetic programming:
Save c
Set the curtain to 192 = 0C0 :-)
RCL regs to alpha
ATOX check for alm prefix byte, that is normalised 26.
Second byte is almregister byte count.
Store a zero to byte 0
Store c
Restore c

Since i have no key assignments and only one repeating alarm this works that simple.

I you have key assignments, you have to restore the normalised bytes, because RCL
alters the source data. Thats is a bit more code, but not a great problem.
I found some hints in Keith Jaretts book. Synthetik programming made easy.
Ralf

/41/48/
Find all posts by this user
Quote this message in a reply
03-17-2023, 11:39 PM
Post: #9
RE: Time Module Clear Alarm
BRAVO! Cool
Please publish your program when you feel it is good enough.
Sylvain
Find all posts by this user
Quote this message in a reply
03-20-2023, 10:01 AM (This post was last modified: 03-20-2023 10:04 AM by Hiwi.)
Post: #10
RE: Time Module Clear Alarm
Here is my code,
just synthetic no PPC Routines, XF-module needed for ATOX.
Since i have no key assignments the code is simple.
If one like to enhance the code, you can check after line 12 the identifier and in case it is 240
for keyassignment normalise the data and store it back and increase the c register to the next data.

I didn't try that yet. May be a pack key assignments is needed before.
Lines 03-05 are standard synthetic code to set the curtain to 192, see Keith Jarett "Synthetic programming made easy"

Code:

 01*LBL "CLALMS"
 02 CLKEYS    // to be sure, no key assignments
 03 "iu**"      // bytes: 245, 1, 105, 12, 0, 0
 04 X<> [           // exchange x with M
 05 X<> c           // exchange x with c (set c to 192) save c on stack
 06 RCL 00       // RCL dataregister 192
 07 X<> [        // exchange M
 08 X<>Y          // recall original value c
 09 X<> c          // put it back - to be sure that c is always set correct
 10 ATOX          // get first byte of dataregister,  alarm identifier, should be 170 normalised 26 
 11 ATOX          // get number of alarm regs, optional 
 12 RCL Z          // RCL c from stack, see line 05
 13 X<> c          // STO c
 14 11          // 11 or 0 for new identifier, use a value for buffer identifier for a modul that is not present 
 15 STO 00      // store it
 16 RDN          // trough away identifier from stack
 17 STO c          // original c msut be here, store it in c (this is very important, or a MEMORY LOST will appear)
 18 CLST          // clear stack
 19 END         // end
[/php]

/41/48/
Find all posts by this user
Quote this message in a reply
03-21-2023, 11:02 AM
Post: #11
RE: Time Module Clear Alarm
i removed 3 lines, which ar not needed. They were added, so that register c could be updated to the original value before special functions like ATOX will be excecuted. In case they will fail and the programm stops there will not be a Memory Lost.

Code:

01*LBL "CLALMS"
 02 CLKEYS    // to be sure, no key assignments
 03 "iu**"      // bytes: 245, 1, 105, 12, 0, 0
 04 X<> [           // exchange x with M
 05 X<> c           // exchange x with c (set c to 192) save c on stack
 06 RCL 00       // RCL dataregister 192
 07 X<> [        // exchange M
 10 ATOX          // get first byte of dataregister,  alarm identifier, should be 170 normalised 26 
 11 ATOX          // get number of alarm regs, optional 
 12 RCL T          // RCL c from stack, see line 05
 14 11          // 11 or 0 for new identifier, use a value for buffer identifier for a modul that is not present 
 15 STO 00      // store it
 16 RDN          // trough away identifier from stack
 17 STO c          // original c msut be here, store it in c (this is very important, or a MEMORY LOST will appear)
 18 CLST          // clear stack
 19 END         // end
[/php]

/41/48/
Find all posts by this user
Quote this message in a reply
03-23-2023, 04:52 PM (This post was last modified: 03-23-2023 04:53 PM by Sylvain Cote.)
Post: #12
RE: Time Module Clear Alarm
HP-41C Suspend Alarms Routine by Tapani Tarvainen
Published in PPC Calculator Journal V10 No 7 Pg 11 August 1983.
Alarm are suspended until OFF or CLOCK is executed.
Code:
01 LBL "SUSAL"
02 "\F5\01\69\01\00\10"  ; string with synthetic characters
03 X<> M
04 X<> c
05 XROM 26,03  ;ALMNOW
06 X<> c
07 X<> M
08 CLA
09 END
Find all posts by this user
Quote this message in a reply
03-23-2023, 08:28 PM
Post: #13
RE: Time Module Clear Alarm
(03-23-2023 04:52 PM)Sylvain Cote Wrote:  HP-41C Suspend Alarms Routine by Tapani Tarvainen
Published in PPC Calculator Journal V10 No 7 Pg 11 August 1983.
Alarm are suspended until OFF or CLOCK is executed.
Code:
01 LBL "SUSAL"
02 "\F5\01\69\01\00\10"  ; string with synthetic characters
03 X<> M
04 X<> c
05 XROM 26,03  ;ALMNOW
06 X<> c
07 X<> M
08 CLA
09 END

Excellent find Sylvain!! When this question was posted, I recalled someone had written something that does this back in the mid-80s', and searched for some time looking for it, but it appears I gave up too easily. It's also not a surprise this came from Tapani, a true tour-de-force back in that timeframe.

How did you find it, if other than just wading through lots of Journal issues?

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-29-2023, 03:37 AM
Post: #14
RE: Time Module Clear Alarm
(03-23-2023 08:28 PM)rprosperi Wrote:  How did you find it, if other than just wading through lots of Journal issues?
By wading through lots of PPC Calculator Journal issues. Wink
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)