WP-34s negative shifts



#7

Currently when r00=-3, SDL[->] 00 multiplies rX by 1000, I think it should
handle this case and divide it by thousand. As in "negative shift left is shift
right". Same for SDR.

I would also argue that ASR,SL,SR,RL,RLC,RR,RRC should handle negative numbers
whenever selected sub-mode implements negative numbers.


#8

The way arguments to commands are implemented mean positive (or zero) values only.

It would be possible to change this of course but I'm not going to do it. The source is available and open and we accept patches....


- Pauli


#9

Yes, that could actually be a reasonable training change to make myself.
However, I am not at the stage where I can make patches yet. I checked out the source with svn and tried to look at it and it is pretty overwhelming.

I understand, everything in root of wp34s folder and in atmel subfolder and in decNumber subfolder goes into the calculator. The rest is different platform emulator code, right?


#10

The definitive source for knowing what goes into the calculator is the Makefile.

The argument handling is a bit limited in the sense that the commands accepting arguments have no knowledge of the source of the argument. It's just an 8 bit number. Indirect arguments may use the full 8 bits while direct arguments are limited to 7 bits. The limit checking is done before the command is called and the sign of the register contents is lost. It would be tricky to allow arguments between -10 and 10 this way because the range is not contiguous if interpreted as unsigned values.


#11

Interesting. I just checked that
SDR ->00 works for r00=255, but fails with an error with r00=256. So it is 8 bits in a sense.

I am trying to figure out what is doing the preprocessing. I traced it to CMD macro which seems to be defined differently depending on who knows what. It looks like this specific op_shift_digit goes into argcmds_ct which is packed into command_info at which point I am lost, it is not apparent who is accessing the command_info. Do you have any words of wisdom for me?


#12

A warning: Don't mess with the command tables unless you really, really know how the whole build process works! We added some very tricky space saving logic (a post processing step on the compiled file) which can easily be messed up. The C preprocessor creates environment dependent versions of these tables (real build, emulator) because the latter does not use the space saving tricks.

The logic you want to interface to is all in xeq.c in the routine rargs().


Possibly Related Threads...
Thread Author Replies Views Last Post
  [WP-34S] Unfortunate key damage with update to V3 :( svisvanatha 5 2,471 12-10-2013, 11:37 PM
Last Post: Les Bell
  WP-34S (Emulator Program Load/Save) Barry Mead 1 1,346 12-09-2013, 05:29 PM
Last Post: Marcus von Cube, Germany
  DIY HP 30b WP 34s serial flash/programming cable Richard Wahl 2 1,944 12-04-2013, 11:14 AM
Last Post: Barry Mead
  WP 34S/43 ?'s Richard Berler 3 1,610 11-10-2013, 02:27 AM
Last Post: Walter B
  My FrankenCulator (wp-34s) FORTIN Pascal 4 1,690 11-09-2013, 06:18 PM
Last Post: FORTIN Pascal
  WP 34S Owner's Handbook Walter B 5 2,132 11-09-2013, 05:34 PM
Last Post: Harald
  wp 34s overlay and programming. FORTIN Pascal 6 2,321 11-08-2013, 01:28 PM
Last Post: Nick_S
  m.dy in display of WP-34S Harold A Climer 3 1,530 11-05-2013, 11:28 AM
Last Post: Andrew Nikitin
  WP 34s : An old problem coming back Miguel Toro 2 1,361 11-05-2013, 03:00 AM
Last Post: Marcus von Cube, Germany
  [WP 34s] Pressure Conversion Factors Timothy Roche 8 2,539 11-04-2013, 07:17 PM
Last Post: Dave Shaffer (Arizona)

Forum Jump: