The Museum of HP Calculators

HP Forum Archive 15

[ Return to Index | Top of Index ]

Nonpareil news; HP-41 file format opinion request
Message #1 Posted by Eric Smith on 20 May 2005, 8:31 p.m.

I just released version 0.65 of Nonpareil, which finally fixes the bug in state restoration. ("This time, for sure!") I thought I'd fixed it a few days ago, but it turned out that the problem only manifested on 32-bit machines, and my primary development environment is now an Athlon 64.

Now that it is a very usable 41CV (soon to be 41CX, thanks to the efforts of Chris Roccati and Thomas Sonne Olesen), I'm considering adding the ability to load and save 41C programs and data registers from external files. This will be in a raw binary format. I can't decide, though, whether the files should have the 32-byte LIF directory entry prepended. I think there are good arguments both ways, and there are utilies than can strip the LIF directory entry, but it's harder to create a new one. I'm leaning toward including the LIF directory entry, but if anyone is strongly opposed to that, I'd like to know why.

Thanks!
Eric

      
Re: Nonpareil news; HP-41 file format opinion request
Message #2 Posted by Raymond Del Tondo on 21 May 2005, 4:58 a.m.,
in response to message #1 by Eric Smith

Hi,

AFAIK there are already file save/restore options for Emu42S,
so maybe that file format could be used,
and the LIF extension as option only.

Raymond

      
Re: Nonpareil news; HP-41 file format opinion request
Message #3 Posted by Tony Duell on 21 May 2005, 2:28 p.m.,
in response to message #1 by Eric Smith

Well, all the solution book programs I've uploaded here don't include the LIF directory header... My linux LIF utilities can optionally include the header when extracting a file from a disk, but the default is not to do so. All my decoding filters, etc in the LIF Utilies for Linux distribution require that the input file does not include the header.

And AFAIK the .raw format used by the MSDOS tools doesn't include the header either.

I don't think the LIF directory entry for an HP41 file includes anything that can't easily be recreated (unlike the entry for some HP71 files which contain record size info, etc). So there would seem to be little point in requiring it.

            
Re: Nonpareil news; HP-41 file format opinion request
Message #4 Posted by Eric Smith on 21 May 2005, 3:11 p.m.,
in response to message #3 by Tony Duell

Hmmm... I thought using the LIF directory entry would be useful since it allows the simulator (and other programs) to easily distinguish programs, data, key assignment, and "write all" files. This is useful in the simulator when one gives an "open" command, so that the simulator can automatically do the right thing. It would also allow the Linux/Unix "file" command to tell one what type of file it is (provided that the appropriate description is put into /usr/share/file/magic).

It would be even better if the LIF directory entry had a fixed magic number in it somewhere, but the LIF file type is probably good enough to identify 41C/71/75 files other than plain LIF1 text (which is used for 41C ASCII files).

                  
Subject-"drift": HP-12C on VM/ESA
Message #5 Posted by Mike (Stgt) on 24 May 2005, 4:20 a.m.,
in response to message #4 by Eric Smith

Hi Eric!

Just a quick note: Display ok, keybord ok, currently I try to "synchronize" the debounce logic (now and then a key hit is droped). On my plan: emulate Low-Bat (works for HP-41), discard dead code used only for HP-41, key hit while CPU running (not trivial as the host-OS is originally not designed for that). More off-list.

Ciao.....Mike

                        
Re: Subject-"drift": HP-12C on VM/ESA
Message #6 Posted by Mike (Stgt) on 25 May 2005, 8:52 a.m.,
in response to message #5 by Mike (Stgt)

Low Bat is detected in the display chips on HP-11C and -12C. So I am _not_ going to emulate that.

Ciao.....Mike

                              
Re: Subject-"drift": HP-12C on VM/ESA
Message #7 Posted by Eric Smith on 25 May 2005, 2:33 p.m.,
in response to message #6 by Mike (Stgt)

Quote:
Low Bat is detected in the display chips on HP-11C and -12C. So I am _not_ going to emulate that.

Bummer! :-)

I had this idea a few days ago for an evil plan to give away simulators that need "batteries", and selling the "batteries" on my web site. The batteries would be locked to a MAC address and good for a limited time, though someone could cheat by rolling back their system clock.

Of course, I'm not actually going to do such a thing.

                                    
Re: Subject-"drift": HP-12C on VM/ESA
Message #8 Posted by Cameron on 26 May 2005, 6:28 a.m.,
in response to message #7 by Eric Smith

I dunno Eric, you could be onto something... You could enhance the simulation by offering a "recharger" for your "batteries" for a few dozen extra bucks. You'd be (barely) compensated for your hard work and we could all enjoy the eBay ads for the "very rare", NIB, Nonpareil "battery pack" and "recharger" that would appear in a few years from now.

Cameron

xyzzy

                                    
Re: Subject-"drift": HP-12C on VM/ESA
Message #9 Posted by Mike (Stgt) on 30 May 2005, 4:47 a.m.,
in response to message #7 by Eric Smith

Hehe, "Bummer"!, yes - of cause!!

NutEm checks the CPU load at 160 LLD (HP-mnemonic), or ?BAT (ZENROM disassembler), or ?LOW BAT (Jacobs/De Arras-mnemonic). Here my 'user exit' that returns 1 if CPU load > 95%

 * * * Top of File * * *                                                
 /*Low Level Detect*/"PIPE CP IND!split 60-6c!drop!var p"; return p > 95
 * * * End of File * * *

NutEm *only* emulates the CPU and everything else (display, keybord, ...) is a simulation close to the host-OS. For example for the display of the Voyager I re-arrange the "on-off-bits" of the segments, transliterate to EBCDIC and merge with the punctuation (transliterated too). Drawback: incomplete display during keybord test (ON + /). So dropping the low bat annunciator for the Voyagers is a remissible omission, IMHO.

BTW - anybody here who could test "my" HP-12C on VM/ESA and/or z/VM? I am about to publish it this week.

Ciao.....Mike

      
Re: Nonpareil news; HP-41 file format opinion request
Message #10 Posted by Mike (Stgt) on 23 May 2005, 8:42 a.m.,
in response to message #1 by Eric Smith

IMHO, the best would be a format usable in Emu41 of JF Garnier and V41 of Warren Furlow. So files could be sent to someone else without discussion about the emulator (or simulator if you prefere).

Ciao.....Mike

            
Re: Nonpareil news; HP-41 file format opinion request
Message #11 Posted by Eric Smith on 23 May 2005, 3:42 p.m.,
in response to message #10 by Mike (Stgt)

I've decided to use my own XML-based format, but to provide import and export in other formats usable with V41 (and probably with other simulators and tools).

                  
Re: Nonpareil news; HP-41 file format opinion request
Message #12 Posted by Tony Duell on 25 May 2005, 2:22 p.m.,
in response to message #11 by Eric Smith

Does that include the 'raw' binary program/sdata file? If not, you're cutting out all the solution book programs I carefully read in and uploaded...

                        
Re: Nonpareil news; HP-41 file format opinion request
Message #13 Posted by Eric Smith on 25 May 2005, 2:29 p.m.,
in response to message #12 by Tony Duell

I assume that what you're talking about is the equivalent of the 41C file formats used on LIF volumes, without a directory entry?

I'll definitely provide for use of raw binary files, though it won't be the default format.

Eric

                              
Re: Nonpareil news; HP-41 file format opinion request
Message #14 Posted by Christoph Giesselink on 25 May 2005, 6:31 p.m.,
in response to message #13 by Eric Smith

Leo Duran wrote a MESSDOS utilty to convert HP41 user code file formats, available on TOS/LibView.cfm?Command=View&ItemID=32

In the Readme.txt file the different formats are described.

The RAW format is described there as

[compiled code] + [1-byte checksum] + [trailer]

In fact V41 use only the [compiled code] or generates only the [compiled code]. Emu42 is compatible with the V41 RAW code. The [1-byte checksum] and [trailer] section is ignored in both emulators. Leo Duran's program accept these also a RAW files where V41 and Emu42 also accepts Leo Duran's RAW format.

Emu42 has two minor modifications of this format:

The [compiled code] can contain more than one GLOBAL_END.

->

LBL "A"
  blabla
GLOBAL_END
LBL "B"
  blabla
GLOBAL_END

When V41 load such a user code file it load's only the first global label, LBL "B" is ignored.

When V41 see code like

LBL "A"
  blabla
LBL "B"
  blabla
GLOBAL_END

you have the ability to save the LBL "A" and LBL "B" object on V41. In Emu42 this makes problems when you select more than one global label. In this case the section between LBL "B" and GLOBAL_END would be twice on the user code file. To avoid this Emu42 shows only LBL "A".

Further V41 has a minor bug, it cannot save FOCAL programs like

  blabla
LBL "A"
  blabla
GLOBAL_END

The part before LBL "A" is ignored. In Emu42 this problem has been solved. V41 has no problems to load the code above.

You don't have to take care about the link fields inside the user code. Both V41 and Emu42 recalculate them during the user code load. This is especially neccessary in Emu42 because you may have more than on global label which aren't together in the source. Second Emu42 is making a PACK and adding some HP-42S specific 00 bytes after numbers at loading, so the link offsets in the source are wrong most times anyway.

Happy implementing,

Christoph

BTW, you should send Leo Duran a copy of your format that he can add it to his Hp41uc.zip program. ;-)

                                    
Re: Nonpareil news; HP-41 file format opinion request
Message #15 Posted by Mike (Stgt) on 30 May 2005, 3:52 a.m.,
in response to message #14 by Christoph Giesselink

I was a few days off, so here a delayed addition: The emulated HP-42S interprets correctly the 'short form exponent'. More clearly: E23 (short form) in a program is the same as 1E23 (normal form). Currently I am only abel to generate the short form by loading a RAW from an HP-41 emulator.

Ciao.....Mike


[ Return to Index | Top of Index ]

Go back to the main exhibit hall