Good morning,does anyone know if it is possible to create
one or several extra register(s) in the ROM of an HP-41
and instructions like STO U RCL U STO V RCL V ... ?Many thanks in advance.
JMB.
HP-41 a M-Code question
|
|
« Next Oldest | Next Newest »
|
▼
Post: #11
04-07-2009, 07:14 AM
Good morning, ▼
Post: #12
04-07-2009, 09:53 AM
JMB, Your question is a little confusing. You may be confusing synthetic techniques with micro-code capabilities. Extra registers, accessible through normal HP-41 programs (using functions such as STO and RCL) are available through synthetics, and are limited. Depending on what else is going on in the calculator at the time from 1 to maybe 5 or 6 are available. The standard ROM of the HP-41 is truly "Read Only Memory" which means that nothing can be written to it, or changed. It is hard coded during manufacture to always be the intended value. There is such as thing as quasi-ROM (which is special 3rd party hardware) that the HP thinks is ROM, but can be changed using special micro-code functions, again supplied by a third party. But, STO and RCL don't work with such memory, only the special 3rd party functions do. Dan ▼
Post: #13
04-07-2009, 10:09 AM
JMB, to expand on Dan's excellent comments - the ability to store data-registers is made available by devices such as the W&W rambox, the Profiset as well as the NoV (and Clonix). In general they are called MLDL devices (Machine Language Development Laboratory IIRC) and they provide what is commonly called QROM (Quasi-ROM) as it actually is RAM. The above mentioned operating systems provide functions to treat this Q-ROM pretty much the same way as you use X-Memory and allow storage of data-registers, ASCII files and Program files. If you want specific STO V, STO W functions for convenience, it would be quite easy to implement in MCODE. However, you would never be able to say burn an EPROM with that code as you need the Q-ROM functionality. But you could burn it into a NoV for example. There is a configuration of the Clonix where you have 512 words of Q-Rom available which would be enough to generate a whole alphabet soup of extra registers. The underlying MCODE function that is uses is WROM (040h) which writes the content of a portion of the C-register to a specific QROM location. Care has to be taken to make sure your MCODE is not portdependent as the user could plug in the Q-ROM in any port. But for simple STO V and RCL V functions, this is quite easy. HTH Cheers Peter ▼
Post: #14
04-07-2009, 05:39 PM
Thank you for your responses. ▼
Post: #15
04-07-2009, 08:49 PM
There are two different ways you could put this together. The simpler way is to create "STO U" and "RCL U" m-code functions that move the X register to/from a quasi-ROM register that is reserved for that storage. You would have to create two functions for every register (U, S, T, U, etc.) that you would like to use, and the normal -41 STO, RCL, and X<> functions would not be able to access those registers. The more complex way would be to reproduce the register sto-rcl-exchange functions in ROM, and grab control from the HP-41 system ROM through the use of an polling vector; I believe the CCD module does this, and could be considered a reference. I'm not the expert on m-code programming; I've read some, but never tried it. Dan ▼
Post: #16
04-07-2009, 10:22 PM
Not surprisingly, fully agree with Dan's excellent explanation (and don't be fooled when he says 'I'm not an expert', he is very good at these things!) Given that e.g. RCL M and STO M are 2 bytes anyway, I don't think there is any pressing reason to try to go the hard way via the polling points. Below is a simple, non-optimized MCODE for a STO function that should get you going. For the RCL function, use the same principle but use CXISA which reads from QRAM. You can find explanations about WROM and CXISA for example here (SDK41 Manual) (BTW - the SDK41 kit is a fantastic MCODE development environment that I highly recommend...) Basically you reserve a fixed space in your QROM for each register. The version below does this in a very inefficient way - storing only 2 bytes per QROM word and hence using 7 words per register. You can adopt this for your needs if for example you only want to store normalized numbers you can compress the storage. Each word in QROM can only carry values from 000h - 3ffh so you might need dec->hex conversions. Please be aware the code below is written for simplicity, not tested (so most likely it will have typos and bugs) and not optimized in any way. Nevertheless, I hope it helps. Cheers
Peter ;******************************************** ▼
Post: #17
04-08-2009, 04:54 PM
Hi, Dan and Peter. ▼
Post: #18
04-08-2009, 10:26 PM
Love the writ 0, rollup trick! Very cool. One thought: your code currently only works if you have a mldl rom plugged into port 4 and mapped to the f page. I never trust myself to remember such things so I try to make my code port independent, but that's just my preference. What math functions have you written? Cheers Peter ▼
Post: #19
04-09-2009, 06:10 PM
Hi, ▼
Post: #20
04-10-2009, 12:48 AM
Jean-Marc, Wow, that's an impressive list, awesome! Did you send to Dave just the compiled ROM or the actual listing with comments as well? Given my limited knowledge I find it very hard to understand MCODE listings without any comments... I'd love to take a peek at your code if possible. Cheers Peter |