The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

HP-41 NUT Assembler question
Message #1 Posted by MichaelG on 12 Feb 2012, 7:06 a.m.

While verifying the D41 NUT disassemlber I came across some strange code in the NUT ROM. It took me quite a while to figure out that the output of the disassemlber is wrong.

After digging deeper into the topic it turned out there is an ambiguity in the op codes.

It's about the op code 3E8. D41 turns it into "REGN=C 15" which doesn't make any sense in the context but the transformation seems to be right. Looking into the op code table there is a special case for 3E8 meaning "SLSABC" which is the right choice in the context.

I have the strong feeling there are more exceptions. My question is how are these exceptions defined? Do I need to check display writing op codes first? That would mean on the other hand there is a documentions error and "REG=C <n>" is valid for n=0..E instead of F.

Any ideas?

Michael

      
Re: HP-41 NUT Assembler question
Message #2 Posted by Meindert Kuipers on 12 Feb 2012, 7:37 a.m.,
in response to message #1 by MichaelG

Hi Michael,

This simply translates to WRIT 15(e) in JDA mnemonics, but could be a display write instruction, depending on the context. I think it will be very difficult to check for display instructions depending on which peripheral is selected.

You might want to take a look at my disassembler, built in the M2kM software. Take a look at the various options, it could be very interesting to take some of these in your software as well. I like your initiative, so please go on!

When you software is more stable, I will take it thorugh a test. I have a disassembly option to allow re-assembly with SDK41, and will test it with your assembler as well.

Regards,

Meindert

            
Re: HP-41 NUT Assembler question
Message #3 Posted by MichaelG on 12 Feb 2012, 8:27 a.m.,
in response to message #2 by Meindert Kuipers

Thx, got it. I wasn't aware about the fact that the display needs to be selected first (day by day I learn more about the inside of the 41). So, the disassembler creates the right code (or at least does it's best under the given circumstances).

Sure, I'll have a look at your suggestions.

Michael

                  
Re: HP-41 NUT Assembler question
Message #4 Posted by MichaelG on 12 Feb 2012, 9:08 a.m.,
in response to message #3 by MichaelG

Success! I simply enhanced the definition of the input label file. There you now specify the address range(s) where the assumed peripheral is active:

display 07ef 07fc

That results in the following code (addr 07f1 is the one of interest):

 07EF 1B0    [MESSL]         C=STK
 07F0 330    (L07F0)         CXISA   
 07F1 3E8                    SLSABC 
 07F2 23A                    C=C+1   M  
 07F3 2F6                    ?C#0    XS    
 07F4 3E3                    GONC    (L07F0)         ;-4    07F0
 07F5 1E0                    GOTOC  
 07F6 130010 [ENLCD]         LDI     010   
 07F8 270                    DADD=C 
 07F9 1300FD                 LDI     0FD 
 07FB 3F0                    PFAD=C 
 07FC 3E0                    RTN     

Thx to Warren, the rest was already prepared.

Michael

                        
Re: HP-41 NUT Assembler question
Message #5 Posted by MichaelG on 12 Feb 2012, 9:23 a.m.,
in response to message #4 by MichaelG

The new version is online.

Michael

                              
Re: HP-41 NUT Assembler question
Message #6 Posted by Kerem Kapkin (Silicon Valley, CA) on 14 Feb 2012, 2:49 a.m.,
in response to message #5 by MichaelG

Hi Michael, where is the new version stored? Also your link at TOS to SDK41R6.1-32V1.zip is broken. Thanks and Best Regards, Kerem

                                    
Re: HP-41 NUT Assembler question
Message #7 Posted by MichaelG on 14 Feb 2012, 3:35 a.m.,
in response to message #6 by Kerem Kapkin (Silicon Valley, CA)

I see, there are 2 threads running. This one was only about a specific question I had that's why I didn't post the link again. But here it is: http://download.michael-goericke.de/hp41/SDK41R6.1-32.zip

Michael


[ Return to Index | Top of Index ]

Go back to the main exhibit hall