wp34s library tool



#3

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?


#4

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.


#5

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

#6

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.


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP Prime - definitely no education tool bluesun08 5 526 11-17-2013, 11:35 AM
Last Post: Alberto Candel
  "HexZombie - a tool for real programmers" Thomas Chrapkiewicz 8 786 11-16-2013, 12:46 AM
Last Post: Kiyoshi Akima
  Library#4 Modules mass-update and New Overlays Ángel Martin 0 374 11-09-2013, 05:55 AM
Last Post: 'Angel Martin
  [HP Prime] Constants Library Values Timothy Roche 24 1,965 11-02-2013, 04:17 PM
Last Post: Les Koller
  [HP-Prime CAS] Vector Calculus Library CompSystems 7 817 10-31-2013, 12:48 PM
Last Post: Han
  Equation Library/App for the Prime Harold A Climer 3 477 10-30-2013, 10:14 AM
Last Post: CompSystems
  Equation Library on the PRIME Harold A Climer 0 274 10-26-2013, 10:01 AM
Last Post: Harold A Climer
  CASplus Library for HP-Prime CompSystems 1 350 10-05-2013, 12:44 AM
Last Post: CompSystems
  The Rich HP Calculator Library Eddie W. Shore 0 240 09-27-2013, 10:19 PM
Last Post: Eddie W. Shore
  So, latest 41CL / Library 4 config is... Gene Wright 4 584 09-22-2013, 02:59 AM
Last Post: Ángel Martin

Forum Jump: