HP Forums
wp34s library tool - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: wp34s library tool (/thread-246054.html)



wp34s library tool - Andrew Nikitin - 07-05-2013

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 - Marcus von Cube, Germany - 07-05-2013

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 - Andrew Nikitin - 07-11-2013

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 - Marcus von Cube, Germany - 07-11-2013

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.