The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

wp34s library tool
Message #1 Posted by Andrew Nikitin on 5 July 2013, 2:21 a.m.

How do I compile a program and put it into emulator?

When I create wp34s.dat and put it into the AppData\Roaming\WP-34s directory, the emulator complans that the file has to be 2048 bytes when it is 512. I thought it has something to do with the 'state' vs 'flash' subformats and try several combinations of -conv -flash and -state options to convert it, too numerous to list them here, but all unsuccessful.

What is the exact command line that would allow me to read a file that was created by the wp34s_asm.pl into format that emulator will understand?

      
Re: wp34s library tool
Message #2 Posted by Marcus von Cube, Germany on 5 July 2013, 4:02 a.m.,
in response to message #1 by Andrew Nikitin

Andrew, its a bit more complicated then I'd like but it is Neil's tool and he decided to do it the way it is now.

To update the wp34s-lib.dat file use the following syntax:

wp34s_lib.pl your_source.wp34s ... -ilib wp34s-lib.dat -olib wp34s-lib.dat

Multiple source files are possible. The program will be merged into the existing library. Without -ilib libfile the library would be created from scratch. If I read the manual correctly -olib libfile can be replaced by -f (force overwrite). -olib newlib can be used to leave the original untouched and create a new lib instead.

To update the state file instead use the same syntax but add the -state switch and name the state file in -ilib and -olib. You cannot create a valid state file from scratch, you'll need one created by the emulator.

The manual Neil wrote is worth a read!

It's easiest to create a program with Neil's tools, add it to a library (or state file), debug it on the emulator and then send it to the device with the I/O commands.

            
Re: wp34s library tool
Message #3 Posted by Andrew Nikitin on 11 July 2013, 12:38 a.m.,
in response to message #2 by Marcus von Cube, Germany

Marcus, thank you.

Quote:
You cannot create a valid state file from scratch, you'll need one created by the emulator.

This is the critical piece I was missing. The manual uses different wording that made me think that I need to create the clean state file with the tool and then update it (rather than specifying new name).

The command line I was after is:

perl %TOOLS%\wp34s_lib.pl temporary.wp34s -ilib %MEMFILE% -state -olib %MEMFILE%
%MEMFILE% points to location of emulators's .dat. I saved clean version of it into separate file and to intialize, just copy it over.
-state switch must be present
                  
Re: wp34s library tool
Message #4 Posted by Marcus von Cube, Germany on 11 July 2013, 3:45 a.m.,
in response to message #3 by Andrew Nikitin

If I understand the manual correctly, -olib %MEMFILE% can be replaced by -f (no further argument).

A few words why the state file must be created by the emulator: As of version 3, the size and location of various data such as registers and user code are no longer fixed but variable. The emulator puts pointers in fixed locations so that the assembler can find the area where to insert its output. The assembler has no chance to create a valid file from scratch. In V2 this was much easier because the program code was in a fixed location (first KB of memory) and the emulator just accepted such a short file and added the missing data. No chance to do the same in the current version.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall