Posts: 1,216
Threads: 75
Joined: Jun 2011
Today I finally tried to switch to the newest SVN 2083/2085 and now nothing is working anymore. :-(
First problem is the new assembler: I compiled my 4 programs PF, TVM, TRIGON and PRS together with the new option '-lib' and got a wp34s-lib.dat, but when I tried to list it in the WP34s each of the 4 Libs just displayed END, none of the program was visible.
Then I compiled it without '-lib' (and had to use '-dl' because of the size) and then it seemed to work in the emulator - at least I could see, load and run the programs.
But now my PRS program suddenly stopped with an error message "Out of range" and the command was R-SWAP.
A few manual tests showed that this R-SWAP is now only working if the number nn is less than half of the sss number.
The R-SWAP parameter is sss.nnddd, and here are a few examples how R-SWAP behaves in the current version:
10 -> error
10.09 -> error
...
10.06 -> error
10.05 -> works
Maybe this has something to do with the new double precision (because of the half registers), but I definitely haven't set this mode (I've checked it).
Good that I still have some older versions ...
Franz
Posts: 1,216
Threads: 75
Joined: Jun 2011
Oh my god, it's even worse! :-(
I just realized that for my test polynomial this R-SWAP code shouldn't even have been reached in my PRS program, so I single-stepped through the program and found that now even simple test functions don't work anymore!
For example: with 0 in the X-register the test x=1? returns true!!!
Posts: 255
Threads: 22
Joined: May 2011
Quote:
Oh my god, it's even worse! :-(
Ya know... you could supply feedback without all of the emotive angst. It would be just as helpful and not nearly so irritating.
If you are willing to go with the bleeding edge of the development, you will get paper cuts now and then. Calling on the almighty for deliverance will not hasten your respite.
There is (was?) a problem with the assembler up until a few minutes ago that it generated images of the wrong style for the latest calculator design. It should be fixed now. We are still trying to mix and match the images into the machine-as-a-whole. Your patience and understanding is encouraged.
From where did you get the idea to use the '-lib' switch with the assembler? The SVN log maybe? I didn't exposed it in the help menu (-h) for the very good reason that it shouldn't be enabled by the end user. It is used as part of the internal tool chain. Nothing good will likely come from trying to turn it on. It works in conjunction with the new LIB tool to modify how images are created.
Posts: 1,216
Threads: 75
Joined: Jun 2011
Quote:
Ya know... you could supply feedback without all of the emotive angst. It would be just as helpful and not nearly so irritating.
If you are willing to go with the bleeding edge of the development, you will get paper cuts now and then. Calling on the almighty for deliverance will not hasten your respite.
Could you please stop trying to tell me what I should write and how I should write it?
Can't you imagine that everyone has it's own style?
Quote: From where did you get the idea to use the '-lib' switch with the assembler? The SVN log maybe?
Yes, exactly from there!
Now I've recompiled it (or better: tried to do it) with your new SVN 2086 build and without this '-lib' switch and now guess what I get: an error message "ERROR: Too many program steps encountered (> 922 words)."
With the '-lib' switch it compiles without error - strange, isn't it? ;-)
Franz
Edited: 27 Dec 2011, 5:56 p.m.
Posts: 255
Threads: 22
Joined: May 2011
Quote:
Could you please stop trying to tell me what I should write and how I should write it?
Can't you imagine that everyone has it's own style?
Dial back your emotions and it will help all around. It is not "style" if my teenager says "Shut Up, Dawg!" to my mother. Such indiscriminate pleas to deities can offend a reasonable fraction of people.
Quote:
Now I've recompiled it (or better: tried to do it) with your new SVN 2086 build and without this '-lib' switch and now guess what I get: an error message "ERROR: Too many program steps encountered (> 922 words)."
With the '-lib' switch it compiles without error - strange, isn't it? ;-)
This is telling me that you probably have more than 922 words in your program. Is that correct? If so, then the assembler is doing exactly what it should and trapping the error. If you have fewer than 922 words in your program and this is occurring, then there is a bug in the assembler and we will attempt to track it down.
The reason it may have "worked" before was that the limit check had been modified (note the use of past tense) to use the wrong value -- a MUCH larger value than was legal. I recently discovered that this has been the case for a few weeks (since SVN 2062). If you used these previous versions and your jobs went through, chances are the output image was not strictly legal if you were exceeding the 922 limit.
Can you provide the log spit out by the assembler after you ran with '-lib' switch on? That that would be very helpful. For example, the lines similar to these:
// Opcode map source: /home/nhamilton/Downloads/wp34s/wp34s_svn/trunk/tools/wp34s.op
// Opcode SVN version: 2083
// WP 34s version: 30
// CRC16: E02F
// Running in V3 RAM-mode. RAM-mode max words: 922
// Total words: 37
// Total steps: 36
If your image is truly too large, you might have to assemble it with the LIB tool since that tool was designed to generate images for use with the flash. The flash has more space available than the RAM. As of now, the RAM is capable of holding 922 words and the flash 4094 words. You can look for these values at the top of the ./trunk/tools/wp34s.op file.
[It might be possible to assemble a monster program with the ASM tool using the '-lib' switch but this has not been tested in this exact manner as yet.]
Note that the emulator may behave differently from the actual calculator WRT to these numbers. So even if the emulator worked with these previous images, the actual calculator may not. Marcus will likely update you more completely on that matter.
Regards...
Posts: 1,216
Threads: 75
Joined: Jun 2011
Quote:
Such indiscriminate pleas to deities can offend a reasonable fraction of people.
Well, "Oh my god" is in fact a very usual saying in German if you're shocked about something - and I was indeed shocked about such terrible bugs.
Quote:
Can you provide the log spit out by the assembler after you ran with '-lib' switch on? That that would be very helpful.
Ok, the call in my batchfile looks like this (everything needed is in the current folder):
tinyperl wp34s_asm.pl -op wp34s.op PF.wp34s TVM.wp34s TRIGON.wp34s PRS.wp34s -o wp34s-lib.dat -lib
And the assembler output is this:
// Opcode map source: wp34s.op (specified)
// Opcode SVN version: -- unknown --
// WP 34s version: 30
// CRC16: AC41
// Running in V3 Lib-mode. Lib-mode max words: 4094
// Total words: 1100
// Total steps: 1071
Quote:
If your image is truly too large, you might have to assemble it with the LIB tool since that tool was designed to generate images for use with the flash. The flash has more space available than the RAM. As of now, the RAM is capable of holding 922 words and the flash 4094 words. You can look for these values at the top of the ./trunk/tools/wp34s.op file.
[It might be possible to assemble a monster program with the ASM tool using the '-lib' switch but this has not been tested in this exact manner as yet.]
Yes, my image is indeed too large (for RAM), but what I want is a library file (wp34s-lib.dat) containing all my programs, since now it's not possible anymore to use/load those single wp34s-n.dat files.
And I've said already more than once that I can't get the LIB tool to work, so I have to do it directly with the ASM tool.
Franz
Edited: 28 Dec 2011, 5:46 a.m.
Posts: 1,216
Threads: 75
Joined: Jun 2011
I've now tracked down these 2 (maybe related) bugs about R-SWAP and tests x=1? to SVN 2071, here both appeared the first time (in SVN 2070 everything was still ok).
Posts: 3,283
Threads: 104
Joined: Jul 2005
I'll check it out. X=1? not working and R-SWAP, even in standard precision throws an error?
Edit: The X=1? issue should be fixed with the next revision. I still have to look after the R-SWAP problem.
Edited: 28 Dec 2011, 7:56 a.m. after one or more responses were posted
Posts: 1,216
Threads: 75
Joined: Jun 2011
Quote:
I'll check it out. X=1? not working and R-SWAP, even in standard precision throws an error?
Yes, x=1? e.g. gives 'true' also with 0 in X.
And R-SWAP (with sss.nn in X) gives an error if nn>sss/2.
Both errors since SVN2071.
Edited: 28 Dec 2011, 7:57 a.m.
Posts: 1,216
Threads: 75
Joined: Jun 2011
BTW Marcus, I saw that there's now a new function 'RND nn', that's really a great enhancement! :-)
I believe this new function will be used much more often than the ROUND function, and so I would prefer having this new RND on the keyboard on [g]0 where currently ROUND is located (and also the current keyboard label RND would better fit to this new function), and put ROUND into the catalog where also ROUNDI is.
So maybe you could change this during your bugfixing, but of course only if you agree with me ... ;-)
Edited: 28 Dec 2011, 8:17 a.m.
Posts: 3,283
Threads: 104
Joined: Jul 2005
I found the R-SWAP error but I need a good idea on how to fix it. Hold on!
Posts: 3,283
Threads: 104
Joined: Jul 2005
I will not walk into Walter's territory without further consultation. Having ROUND on the keyboard is quite reasonable for the average user who wants to make the displayed result the present value of X. Being able to round to a given number of significant digits is more a matter of programming, I suppose.
Posts: 1,216
Threads: 75
Joined: Jun 2011
Quote:
I found the R-SWAP error but I need a good idea on how to fix it. Hold on!
Well, without going through your C-sources I can't really help you of course, but I guess that both bug may be related. Maybe the true bug is in the test function, and the R-SWAP fails because testing source, destination and number of registers returns a wrong result if nn>sss/2 !?
(just a guess, but it would indeed be a coincidence if both bugs would have appeared independently in the same SVN)
And I have no clue how introducing double precision could have any influence on R-SWAP or testing x=_?
Posts: 1,216
Threads: 75
Joined: Jun 2011
Quote:
I will not walk into Walter's territory without further consultation.
Yes, as for predators it's very dangerous to intrude into the marked territory of others. :-)
Quote:
Being able to round to a given number of significant digits is more a matter of programming, I suppose.
Well maybe, but for programming it would even be more useful if the parameter nn (the number of digits to round) could be taken from any register - but that was already discussed for SDL/SDR too, and probably it's just too complicated to implement.
Posts: 3,283
Threads: 104
Joined: Jul 2005
All argument taking commands support the -> indirection operator.
The bugs should be fixed. Can you try again?
Posts: 3,283
Threads: 104
Joined: Jul 2005
The x=1 test was affected by a bad copy and paste. I had to provide for a double precision compare against zero and one in both single and double precision (complex and real variants). I changed the code for zero and pasted it for one without updating it correctly in all places.
R-SWAP did some pointer arithmetic for range checking which needed an update.
Posts: 1,216
Threads: 75
Joined: Jun 2011
Quote:
All argument taking commands support the -> indirection operator.
Aaah, that's great - I must have overlooked this so far!
Quote:
The bugs should be fixed. Can you try again?
Yep, both things are working correctly again - thanks! :-)
BTW, I just found that [g]RTN doesn't display the BEG announciator anymore (if I have a program in RAM and I'm within this program).
Is this intended?
Posts: 3,283
Threads: 104
Joined: Jul 2005
Quote:
BTW, I just found that [g]RTN doesn't display the BEG announciator anymore (if I have a program in RAM and I'm within this program).
Is this intended?
Another one I have to look into... [g]RTN no longer goes to location zero if not in program mode but to location 001 instead which isn't indicated by the annunciator.
Posts: 1,216
Threads: 75
Joined: Jun 2011
Quote:
Another one I have to look into... [g]RTN no longer goes to location zero if not in program mode but to location 001 instead which isn't indicated by the annunciator.
Thinking a bit more about this [g]RTN it seems not so clear where this command should actually go!?
If you have more than one program in RAM and you're currently within (running) e.g. program 2, then should [g]RTN really put you on line 000, which would mean you're kicked out of your program 2 and have to choose it again via the CATalog if you want to restart it!
Maybe it would be better if [g]RTN would put you at the beginning of the current/active program (so a simple R/S would run it again) instead of line 000 - but I guess this won't be easy to implement (and maybe it would even require that each program has its own line numbers, i.e. start with 001 or 000).
Edited: 28 Dec 2011, 10:33 a.m.
Posts: 1,545
Threads: 168
Joined: Jul 2005
Hey Marcus!
Probably a dumb idea/question, as I haven't had enough coffee yet today.
Can the round function round values in a register other than X? Usually, we round the "displayed" value to the display setting.
how about rounding the value in a register in the same way?
Again, probably a way to do this already, but thought I'd ask.
Posts: 1,216
Threads: 75
Joined: Jun 2011
Quote:
Can the round function round values in a register other than X?
No Gene, that's not possible.
This would require 2 parameters (which register to round and how many digits), and I can't imagine that such double-parameters would ever be implemented.
Posts: 3,283
Threads: 104
Joined: Jul 2005
Use GTO [dot] [up] for this! (You can leave out the h prefix: XEQ [dot] is the same as [h] GTO [dot]).
Put LBL A in front of each program and a simple A will restart it.
A manual return is mainly useful to get you out of library space.
Posts: 3,283
Threads: 104
Joined: Jul 2005
Franz has hit the nail on the head. You will need an exchange operation before and after applying the rounding operation (ROUND or RND nn) to get this effect.
Posts: 1,216
Threads: 75
Joined: Jun 2011
Quote:
Use GTO [dot] [up] for this! (You can leave out the h prefix: XEQ [dot] is the same as [h] GTO [dot]).
Put LBL A in front of each program and a simple A will restart it.
Good tips, thanks! :-)
Quote:
A manual return is mainly useful to get you out of library space.
Are you sure? IIRC it didn't work this way when I last tried it - but I'm not sure, I'll check it again.
Posts: 1,216
Threads: 75
Joined: Jun 2011
Quote:
Are you sure? IIRC it didn't work this way when I last tried it - but I'm not sure, I'll check it again.
Yes, I was wrong, [g]RTN gets you out of the library.
Another question, Marcus:
In the CATalog I see Lib1, Lib2 and Lib3.
Lib1 is the file wp34s-lib.dat, Lib2 is wp34s.dat (backup?), but what's Lib3?
Couldn't this be named a bit better, e.g. Lib, Bak and ??? (don't know what Lib3 is for)?
And what's wp34s.dat (Lib2) really good for? Isn't this file always updated with the current RAM content when I close the emulator? And if it's automatically reloaded when I start the emulator again, then RAM and Lib2 should contain the same programs, right?
Posts: 1,545
Threads: 168
Joined: Jul 2005
Actually, I intended to say to the display setting.
So a round command like this would round register XY to the number of decimal places of the display setting.
More coffee so perhaps a clearer explanation of what I meant. ;-)
Posts: 1,216
Threads: 75
Joined: Jun 2011
And another thing, a little request:
It now has already happened more than once to me that loading a program into the RAM automatically reduced the registers, and then running the program gave an error message.
Won't it be nice if this register reducing would give a short warning before or even ask if it should indeed be done (i.e. if the program should be loaded)? Something like "Reduce regs?" or "Set regs to nn?", as it is done when you try to clear a program.
Posts: 3,283
Threads: 104
Joined: Jul 2005
The respective chapter in the manual is still to be written. It should state: "Use local registers or start using global registers with low addresses first because high addresses may become deallocated when the program area grows."
Lib 3 is the ROM contents. It was just a little bit shorter to just number the areas instead of naming them.
Lib 2 is the backup. Do a SAVE to copy RAM to lib 2. This will prevent any automatic generation of backup data that you have observed. (It happens on startup of the emulator when no valid backup is detected.)
Posts: 3,229
Threads: 42
Joined: Jul 2006
Quote: All argument taking commands support the -> indirection operator.
Almost all argument taking commands support ->. The exceptions are few: conversions, constants, alpha characters which you won't ever see directly and LBL which you will.
I'm likely to change SKIP and BACK to not accept -> and instead increase the branch range (via the assembler if not via the keyboard too). In light of this, can anyone suggest a good use for indirect SKIP or BACK? I can come up with a couple of things where it could be used but nothing that shouts out and demands its use.
- Pauli
Posts: 1,216
Threads: 75
Joined: Jun 2011
Ok, so the relations are the following:
RAM <-> wp34s.dat
Lib1 <-> wp34s-lib.dat
Lib2 <-> wp34s-backup.dat
Lib3 <-> ROM
BTW, an automatic backup-file is NOT created on startup (as you wrote), you definitely have to do a SAVE to create it (I've just tested it).
And for Lib3 I would really prefer the name ROM instead. OTOH what is this Lib3/ROM still good for, after WHO and deltaX have now also removed from there? Is this any area the user himself could access? Or is it just reserved for any future use?
One more question:
Is there any useful purpose for listing all those ENDs in the CATalog? I find it a bit annoying to get an END after each name/label when scrolling through this list.
Edited: 28 Dec 2011, 6:05 p.m.
Posts: 3,283
Threads: 104
Joined: Jul 2005
Quote:
BTW, an automatic backup-file is NOT created on startup (as you wrote), you definitely have to do a SAVE to create it (I've just tested it).
The backup is created internally but not written to a file. So you just get the same information in the backup that was in the state file on startup. This is only done if no backup file is found.
Quote:
And for Lib3 I would really prefer the name ROM instead. OTOH what is this Lib3/ROM still good for, after WHO and deltaX have now also removed from there? Is this any area the user himself could access? Or is it just reserved for any future use?
This looks more like a bug than a feature. I'll check it. WHO and '[delta]X' should still be present.
Quote:
One more question:
Is there any useful purpose for listing all those ENDs in the CATalog? I find it a bit annoying to get an END after each name/label when scrolling through this list.
It helps you to distinguish between separate programs. Look into the vector or matrix code which has many global labels in a single program.
Posts: 1,216
Threads: 75
Joined: Jun 2011
Quote:
This looks more like a bug than a feature. I'll check it. WHO and '[delta]X' should still be present.
I believe that Pauli has removed those 2 entries from the ROM catalog - look at SVN 2087.
Posts: 3,283
Threads: 104
Joined: Jul 2005
I've removed XROM from the CAT display.
|