Subject: Uploading stack from the HP49G to a PC Is there a way to transfer the stack info from my HP49G to my PC using the PC connectivity kit? I just completed a test and wanted to check my calculations and I think that it would be much easier from the PC than the calculator. TIA ==== Subject: Re: Uploading stack from the HP49G to a PC > Is there a way to transfer the stack info from my HP49G to my PC using > the PC connectivity kit? I just completed a test and wanted to check my calculations and I think > that it would be much easier from the PC than the calculator. Not directly, but I sugge4st you push the UP arrow, then RS-UP arrow to jump to the top, and push ->LIST. This will make a list of your answers. You can then run ->STR to convert it into a string. Then you can save that and up-load it to the computer. Alternatively, use this program: << DEPTH ->LIST ->STR 'STACK' STO >> That will create a STACK text file that can then be easily transfered. TW ==== Subject: Re: CN5 Serial Numbers X-RFC2646: Format=Flowed; Original Hi ! Are your really talking about CN5 or CNA5 ? If the last one - I got mine about 3 Month ago from Sam's Club. Carsten ==== Subject: I need help! Hi again, two HP49G+ questions. The first is: Tonight I was a little bit tired and I made the mistake to delete the hole content of my CASDIR directory. I know that there were stored some information need by the CAS but... no idea what exactly. So i need to restore these files. I tried searching about this topic, without success. I need the default files. The calc is new and I want just to bring it to the default stage :) The second problem is actualy the reason why I made this mistake. I just wanted to delete all possible files thet the calc creates in each directory where I am working. Thi is $/&%$Û=&(, I work with the plot and when I finish I find a coulple of variables saved in my working-directory. Ok, sometime some of them are usefull, for example the function that i worked in the plot with, but I just don't want to have all this bulk in my directories, with my files. It is just a Chaos and for the end..., I have no idea what happened but now when I try to draw one cos() funciton I get just one line on the plotter. It looks so that the calc thing that my Variable x is now constant 0. This is. Any help is very appreciated. Dimo Pepelyashev ==== Subject: Re: I need help! X-RFC2646: Format=Flowed; Original X > wanted to delete all possible files thet the calc creates in each > directory > where I am working. Thi is $/&%$Û=&(, I work with the plot and when I > finish I find a coulple of variables saved in my working-directory. Ok, > sometime some of them are usefull, for example the function that i worked > in the plot with, but I just don't want to have all this bulk in my > directories, with my files. It is just a Chaos and for the end..., I have In the future you could change the ORDER of the variables Just select the most wanted and hot ORDER (while in the FILER) Your other, less important variables will be on the subsequent pages VPN ==== Subject: Re: I need help! 1) Just press [ON]-[C] the system will reboot and the CASDIR will be recreated. 2) it's just a minimum and maximum vertical value of the axes. You can setup the limits of your axes by pressing: [APPS], select 1. Plot functions, press [ENTER], select 2. Plot window, press [ENTER]. Starting from this form, you can setup the limits of your axes. Be careful when trigonometric functions if you are in RAD or DEG mode. lol You can also delete the 'PPAR' variable wich contains the parameters of the Plotter. I hope this helps. Fred. ==== Subject: Re: I need help! Actually the CASDIR will be created automatically whenever it is needed if none is detected. TW ==== Subject: Re: I need help! I reseted and averything is back. I still don't understand where is the problem with RAD and DEG modes with the trigonometric funtions. In RAD the plotter is ok. In DEG I still get the line for cos(). When I make zout, nothing. I think when the plotter is set to 360 for x I must get the sine, because of the full period. Can someone explain to me why this doesn't happen. And second interessting question is, when I am in RAD and work with pi, everything is fine. But when I change to DEG and try to calc cos(pi), it still thinks that pi=3.14..... and not 180. If I understand it correctly the calc has only one value for pi, independent of the mode in that I am working. ==== Subject: Re: I need help! Have you ever heard of function analysing before plotting? :| It is a mathematical problem here. Steen is right. Pi is a universal mathematical constant from greeq antiques and it never has been 180... You may have missunderstood something: pi RADians=180 DEGrees. 2pi RADians=360 DEGrees. pi=3.14159 No matter the case you are in DEGree or RADian the image of sinus or cosinus functions will always be between -1 and 1. If you are in DEGree you may set your axes to the following values: x-min: -360 x-max: 360 y-min: -1 y-max: 1 360 will give you a full cycle of sinus or cosinus functions in DEGree. If you are in RADian you may set your axes to the following values: x-min: -2pi x-max: 2pi y-min: -1 y-max: 1 2pi will give you a full cycle of sinus or cosinus functions in RADian. To get -2pi, press [2] [LeftShift] [*] [+/-] [RightShift] [->NUM], and to get 2pi, press [2] [LeftShift] [*] [RightShift] [->NUM]. When drawing the function with these parameters, you will get exactly the same view of the sinus or cosinus functions, for both modes (RAD/DEG). This is mathematical. I hope this will clarify your problem. Fred. ==== Subject: Re: I need help! dimo, dumata adwajs nema mnovestweno chislo syshto kakto njuz :) ==== Subject: Re: I need help! > dimo, dumata adwajs nema mnovestweno chislo syshto kakto njuz :) @reth - You have right, grammatically it isn't correct to say advices, but people use it. The language changes with the time and my English is not perfect. ==== Subject: Re: I need help! > In RAD the plotter is ok. In DEG I > still get the line for cos(). How much of the primary axis are you viewing? > And second interessting question is, when I am in RAD and work with > pi, everything is fine. But when I change to DEG and try to calc > cos(pi), it still thinks that pi=3.14..... and not 180. Pi is never 180. Pi is a mathematical constant and is always ~3.1415... Steen ==== Subject: Re: I need help! X-RFC2646: Format=Flowed; Original > In RAD the plotter is ok. In DEG I >> still get the line for cos(). How much of the primary axis are you viewing? > And second interessting question is, when I am in RAD and work with >> pi, everything is fine. But when I change to DEG and try to calc >> cos(pi), it still thinks that pi=3.14..... and not 180. Pi is never 180. Pi is a mathematical constant and is always ~3.1415... AUTO will sample a few points (maybe 20) and will set the plot prarameters Why don't you use that (in the WIN window), Dimo ? VPN ==== Subject: Re: I need help! OK, analysing. You say: No matter the case you are in DEGree or RADian the image of sinus or cosinus functions will always be between -1 and 1. ...and I agree. The problem is that when i added f(x)=cos(x) in the ploter I achse to +/- 360 in WIN and I got the sine. I thought that the values in WIN just define the seeable part of the x-achse, and I thought too, that when I zout in the plotter I will see the whole picture, this didn't happen. That's why I was surprised. About pi ... I understand my error. I was just thinking about more comfortable way to do my calculations (Now when I'am working with complex digits for my exams I alway have to check what is the last set mode). But I understand that there is no other possible way. pi*r^2 will look funny with pi set to 360 :) ==== Subject: Re: I need help! <42b66745$0$163$edfadb0f@dtext02.news.tele.dk> <6fvte.7385$Q64.4890@reader1.news.jippii.net> So, now, before setting up your axes range, anaylize your function. According to your questions, I suppose you are currently learning this :) The Drawing system won't do that for you. The AUTO thing won't do the job. The best remains in analyzing your function first, finding the roots where your X is equal to 0 and find the maxima and minima values (derivate the function, get the roots and deduce the way your function where it goes up or down, minus infinite and infinite tends etc.). These minima and maxima values will setup your axes values. You may have learned (or currently learning) that. It is Coll.8fge and Lyc.8ee math program. Also, you're not obliged to store 'F(X)=SIN(X)' in 'EQ', you can directly type 'SIN(X)' and store this in the EQ variable (use the STEQ instruction). And if you don't want to use the silly choosers, just type DRAW GRAPH in the command line after having setting up the axes range. Fred. ==== Subject: Re: I need help! > Also, you're not obliged to store 'F(X)=SIN(X)' in 'EQ', you can > directly type 'SIN(X)' and store this in the EQ variable (use the STEQ > instruction). And if you don't want to use the silly choosers, just > type DRAW GRAPH in the command line after having setting up the axes > range. Ahaa, I didn't know this. It works :) this. ==== Subject: Re: I need help! <42b66745$0$163$edfadb0f@dtext02.news.tele.dk> <6fvte.7385$Q64.4890@reader1.news.jippii.net> you're welcome. :) Fred. ==== Subject: Re: Anyone have old FLASH eraser? Well I wonder if I have a record for damaged banks on the 49g+. A B and C all return 0. So is there anyway to fix this or do i get to mail it off to Cyrille so he can look at it. . . =( TW ==== Subject: Re: Anyone have old FLASH eraser? Wow, didn't know a software can cause that. Did you also try to reflash the calc, sort of install the OS again? Good luck with it. ==== Subject: Re: 48SX Accessing Library Data X-RFC2646: Format=Flowed; Original Hi Andreas, ich muss nat.9frlich auch meinen Senf dazugeben;-) There's an alternative for handling Library Data objects. Create a list of the objects (with ->LIST) you want to have in a Library Data container. The first element of the list should be the associated library number. Then apply the SysRPL word CHANGETYPE to that list, with the argument =DOEXT0 for the new type. To access the contents of your new Library Data object, you simply have to convert it back to a list. Because your first list element is the library number, you can immediately see if you have the correct LibDat object. The thing with the library number was used by convention with many (if not all) internal Library Data objects prior the 49g series. There are various different ways to create LibDat objects, but the standard methods work with the built-in tools. Raymond Andreas Delp schrieb im Newsbeitrag > Hello NG, > I am not common with system programming of the HP, but I can do RPL ;-) Now, I have a Library Data Object, binary data, I have to access > byte-by-byte. Can you post some code snippeds, how to get e.g. byte no. 44 > of objects like these? TIA, Andreas -- > Mails without the keyword 'erdbeere' in the subject will be deleted! > ==== Subject: Looking for: Formula display from RPN input ? Re: an ALG Formula display from RPN input sequences.. I have never seen a purple cow, but while I'd never hope to be one, If so, then I would tell you just one thing, I'd rather see than be one. -childhood rhyme- Does anyone know of any attempt to produce such an application? Or would this only reflect my own particular penchant for simplification? ==== Subject: Re: Looking for: Formula display from RPN input ? > Re: an ALG Formula display from RPN input sequences.. > > I have never seen a purple cow, > but while I'd never hope to be one, > If so, > then I would tell you just one thing, > I'd rather see than be one. > -childhood rhyme- > > > Does anyone know of any attempt to produce such an application? > > Or would this only reflect my own particular > penchant for simplification? There is a poem by Gilette Burgess that goes: I've never seen a purple cow. I never hope to see one. But I can tell you anyhow, I'd rather see than be one. Al least Gilette's version scans. ==== Subject: Re: CLKADJ <42b51a99$0$22338$ba620e4c@news.skynet.be> > adjusts the time according to the average daily error. On my 48GX it runs > beautifully. She loses a little over 2 seconds per day. My 49G+ is purely > random, losing up to 5 seconds some days an gaining 5 on others. > I found much the same thing. My 48/49G were consistently slow, and with OS v1.23, so was the 49G+. However, the 49G+ alarms were unreliable until I upgraded to v2.00. Now the alarms work fine, but the 49G+ clock swings the +/- 5 seconds as you said. I've given up chasing split-second accuracy on the calc. Nobody else in the world is ever on time within five seconds. :-) Bill ==== Subject: Re: CLKADJ alarms. adjusts the time according to the average daily error. On my 48GX it runs > beautifully. She loses a little over 2 seconds per day. My 49G+ is purely > random, losing up to 5 seconds some days an gaining 5 on others. > I found much the same thing. My 48/49G were consistently slow, and > with OS v1.23, so was the 49G+. However, the 49G+ alarms were > unreliable until I upgraded to v2.00. Now the alarms work fine, but > the 49G+ clock swings the +/- 5 seconds as you said. I've given up chasing split-second accuracy on the calc. Nobody else > in the world is ever on time within five seconds. :-) Bill > Hi Bill, I am obsessive compulsive with time, but not that bad! An accuracy of +/-5 seconds would be grand, but I'm not sure the 49G+ is even that accurate over the course of a week. I monitored it today and over the course of 8 hours, it is gaining about 3 seconds each day. That's OK, if the average daily error is constant, as I can adjust it wih an alarm, but it is not constant. Scott ==== Subject: Mod Functions Suppose I have 3 numbers, a,b and n. I want to calculate a*b=1 in mod N I know N and A. How do I find b? Al ==== Subject: Re: Mod Functions > > Suppose I have 3 numbers, a,b and n. I want to calculate > > a*b=1 in mod N > > I know N and A. How do I find b? > > > Al INVMOD if N=MODULO Or IEGCD with A and N ==== Subject: Re: Mod Functions X-RFC2646: Format=Flowed; Response Suppose I have 3 numbers, a,b and n. I want to calculate a*b=1 in mod N I know N and A. How do I find b? GCD ==== Subject: Re: Mod Functions X-GPG-FINGRPRINT: 6813 0372 183A 4E76 FB00 C858 1FFC A3A7 110E 3327 X-GPG-PUBLIC_KEY: http://n.ethz.ch/student/hasslerf/download/public_key.asc Hi Al, what you want to find is called a modulare inverse. The inverse may NOT exist unique unless N is prime. In the case N is prime, b can be found by applying Euclid's gcd algorithm to a and N: s= a, t= N c= 0, d= 1 // c*a= s and d*a= t mod N while(t neq 0) q= div(s,t), r= mod(s,t) s= t, t= r temp= (c-d*q) c= d, d= temp return c After each step the following relation is true: c*a= t(i-1) and d*a=t(i) mod N. In the last step t(L)= 0 and t(L-1)= gcd(a,N). If and only if a is invertible with respect to N, gcd(a,N)= 1 and c is the inverse of a. Hope, this helps. Fabian Suppose I have 3 numbers, a,b and n. I want to calculate a*b=1 in mod N I know N and A. How do I find b? > Al > ==== Subject: Linear system solver problem Hi again, new question. I tried to calculate this with the linear system solver: x-y=2 -2x+2y=0 It is obvious that there is no answer. The problem is that i got answer 0.2 for x and -0.2 for y. Why? I mean here is no problem, but in electrical engineering I have to solve VERY BIG systems and would like to know if there is no answer => there is an error in the network. Or I have to check each time if the system have an answer or not? Ok, it is called Linear system solver, but is there a trick to do the job. The bigger question, is that sometimes come problems, where for one of the indexes, there is an unknown values. And I have to know, what values should I keep away from my net. It means for what values of this unknown index the determinant of the matrix becomes 0. Ok it is note very hard to do it by myself, but i think that the calc can do it for me faster. ==== Subject: Re: Linear system solver problem > new question. I tried to calculate this with the linear system solver: > > x-y=2 > -2x+2y=0 > > It is obvious that there is no answer. The problem is that i got > answer 0.2 for x and -0.2 for y. Why? How did you enter the problem? Steen ==== Subject: Re: Linear system solver problem > Hi again, > > new question. I tried to calculate this with the linear system solver: > > x-y=2 > -2x+2y=0 > > It is obvious that there is no answer. The problem is that i got answer 0.2 > for x and -0.2 for y. Why? What calculator are you using? On my 49+, I get no solution (the empty list) . > I mean here is no problem, but in electrical engineering I have to solve > VERY BIG systems and would like to know if there is no answer => there is > an error in the network. Or I have to check each time if the system have an > answer or not? Ok, it is called Linear system solver, but is there a > trick to do the job. > The bigger question, is that sometimes come problems, where for one of the > indexes, there is an unknown values. And I have to know, what values should > I keep away from my net. It means for what values of this unknown index the > determinant of the matrix becomes 0. Ok it is note very hard to do it by > myself, but i think that the calc can do it for me faster. > ==== Subject: Re: Linear system solver problem Ok it must be something very simple that i do wrong, but.... I enter in ther lenear system solver: for matrix A: 1 -1 -2 2 and for matrix B: 2 0 and I get the result for x: 0.2 -0.2 ==== Subject: Re: Linear system solver problem > Ok it must be something very simple that i do wrong, but.... > I enter in ther lenear system solver: > for matrix A: > 1 -1 > -2 2 > > and for matrix B: > 2 > 0 > > and I get the result for x: > 0.2 > -0.2 I actually get X = [ 2E14 2E14], using the solver, which is way too large to be an actual solution for integer matrices A and B with such small integer values in A and B. You can always check your solution for X by back solving for B (just select B after solving for X and press the SOLVE softkey). Ideally it sold give you back your original B. If your solution for B is not the origial B (or at least not extremely close to it) then your indicated solution for X is not an actual solution. In this case, with A = [[1 -1][-2 2] and any X, solving for B gives B = [0 0], which says that the only X you can actually solve for when A = [[1 -1][-2 2]] is X = [0 0] when B = [0 0]. ==== Subject: Re: CASE in hp basic It is find in RPL but does not work in hp basic which is my problem... Arnaud ==== Subject: Re: CASE in hp basic What is hp basic? on which calculator is this language? ==== Subject: Re: CASE in hp basic X-RFC2646: Format=Flowed; Original Hi Fred, schrieb im Newsbeitrag > What is hp basic? on which calculator is this language? > AFAIK they call programming method in algebraic mode 'hp basic'. That was kinda irritating when I first heard of this, because in the nineties, I also used HP 9000 workstations with HP Technical BASIC (RMB), which was outstanding. I'm not sure if the 49g series 'basic' is comparable to RMB in any way;-) IIRC, the HP-71B also used a variation of RMB. Raymond ==== Subject: Re: CASE in hp basic X-Eric-Conspiracy: There is no conspiracy. > IIRC, the HP-71B also used a variation of RMB. Not really. The HP-75C/D and HP-71B are from the Technical BASIC family, which originated in the Series 80 desktop computers from Corvallis Division. Rocky Mountain BASIC came from Fort Collins Division or Loveland Division (I'm not sure which), and evolved from the 9830, 9835, and 9845 desktop machines. RMB was used in the early 68000-based machines (9816, 9826, 9836) and HP-9000 systems. There was also an ISA bus plugin coprocessor card for a PC which ran RMB. AFAIK, HP hasn't ever offered a native RMB for a PC, though third parties offer RMB-compatible BASICs. The HP Integral (9807), a 68000-based lunchbox style portable computer, came from Corvallis Division despite the 98xx number, and used Technical BASIC. Many customers were unhappy that Rocky Mountain BASIC was not available for it, even as an option. AFAICT, it used Technical BASIC at least partially because when Corvallis Division obsoleted the Series 80 machines, they promised customers that a future machine would have a compatible BASIC. Eric ==== Subject: Re: CASE in hp basic X-RFC2646: Format=Flowed; Response > Hi Fred, schrieb im Newsbeitrag >> What is hp basic? on which calculator is this language? > AFAIK they call programming method in algebraic mode 'hp basic'. > That was kinda irritating when I first heard of this, > because in the nineties, I also used HP 9000 workstations > with HP Technical BASIC (RMB), which was outstanding. I'm not sure if the 49g series 'basic' is comparable to RMB > in any way;-) it is not AND it is also different from the 3x series HP BASIC > IIRC, the HP-71B also used a variation of RMB. > Raymond > ==== Subject: Re: CASE in hp basic I thought it was RPL. I don't know these machines. I can't help. Sorry. HP9000 mmmh... I'm afraid Dave, but I can't do this. ;) fred. ==== Subject: Re: CASE in hp basic X-RFC2646: Format=Flowed; Original > ah ok. I thought it was RPL. I don't know these machines. I can't help. Sorry. > HP9000 mmmh... I'm afraid Dave, but I can't do this. ;) fred. Actually the 49 series HP BASIC *is* RPL it is just disguised as BASIC I would rather call it Algebraic-RPL is it oxymoron (or just moron) ? VPN ==== Subject: Re: CASE in hp basic X-RFC2646: Format=Flowed; Response Veli-Pekka Nousiainen schrieb im Newsbeitrag >> ah ok. >> I thought it was RPL. I don't know these machines. I can't help. Sorry. >> HP9000 mmmh... I'm afraid Dave, but I can't do this. ;) >> fred. > Actually the 49 series HP BASIC *is* RPL > it is just disguised as BASIC > I would rather call it Algebraic-RPL > is it oxymoron (or just moron) ? > VPN So it's a typical marketing 'irritation', like 'hp48gII'... That were nice times when you got what was advertized. Raymond ==== Subject: Algebraic function taking list as input? Hi. I'm working on an integration function that takes two arguments (using Debug4x, coding in SysRPL mostly): 'INTEGRATE(a,b)' Argument a can be real, complex, zint or symbolic. Argument b can be one of the following: id -> indefinite integral. {id point} -> the value of the integral at 'point'. {id lower upper} -> the value of the integral from lower to upper bound. The argument checking works fine on the stack, hence the following is handled correctly for instance: 'EXP(X^2)' 'X' INTEGRATE -> '1/2*SQRT(pi)*ERFI(X)' 'EXP(X^2)' {'X' 2.2 6.7} INTEGRATE -> 2.36240619911E18 When using INTEGRATE in an algebraic, only the first case is accepted: 'INTEGRATE(EXP(X^2),X)' -> '1/2*SQRT(pi)*ERFI(X)' This is not accepted: 'INTEGRATE(EXP(X^2),{X 2.2 6.7})' -> Invalid Syntax Generally it seems that arguments like strings and lists aren't valid for algebraic functions. Is there any way to get around this? Steen ==== Subject: Re: Algebraic function taking list as input? > This is not accepted: > > 'INTEGRATE(EXP(X^2),{X 2.2 6.7})' -> Invalid Syntax > This is not an error as such... It just means that the Decompiler is unable to process such objects... Jean-Yves ==== Subject: Re: Algebraic function taking list as input? > 'INTEGRATE(EXP(X^2),{X 2.2 6.7})' -> Invalid Syntax > > This is not an error as such... It just means that the Decompiler is > unable to process such objects... I understand it's not an error, I just wanted to know if there's any way for me to help the decompiler in this case? In algebraic mode the decompiler accepts strings and so on. I just wanted a single function to act as three different functions, taking two, three and four arguments. Since variable number of arguments isn't supported, I'd use an optional list for the surplus arguments. If it's not in any way straightforward to handle lists in algebraics in RPN mode, I can live with two separate functions - one for indefinite and one for definite integration for instance. Steen BTW two keys just broke within 20 minutes on my 49G+ (F5 & backspace :-) ==== Subject: Re: Algebraic function taking list as input? > BTW two keys just broke within 20 minutes on my 49G+ (F5 & backspace :-) A smiley? Never seen that response before. If you don't mind my asking, how did they break? Was it the hinges or something else? Have you ever applied the wiggle fix to these keys? I ask because I'm contemplating building a replacement keyboard/case for my calculator. Its reasonably affordable to buy real keys, I'm just stumped on the keycap/overlay situation. Daniel ==== Subject: Re: Algebraic function taking list as input? > A smiley? Never seen that response before. Well, I just find it pretty hillarious that the keys seem to break all over the place. It was the hinges, yes. The smiley was also because two keys broke with such short interval. > Have you ever applied the wiggle fix to these keys? No. I sincerely believe that'll just accelerate the keyboard harakiri. I'll see if I can dig up a new 49G+... Steen ==== Subject: Re: Algebraic function taking list as input? X-RFC2646: Format=Flowed; Original Hi Steen, Steen Schmidt schrieb im Newsbeitrag I'm working on an integration function that takes two arguments (using > Debug4x, coding in SysRPL mostly): > [..] > Generally it seems that arguments like strings and lists aren't valid > for algebraic functions. Is there any way to get around this? > I thought strings are just strings, to express textual things. How would you integrate a sentence like Frozen Hamster Butt ? Seriously, you could convert an expression stored as a string to an algebraic, which would be usable then . For lists, you could extend the wanted algebraic functions to perform kinda list processing, if that makes sense there. I did that once for my NoShift keys replacement library, but that was for the HP-48, of course. Or, if list processing isn't what you want, you would have to evaluate the list contents to a single expression. Raymond ==== Subject: Re: Algebraic function taking list as input? > I thought strings are just strings, to express textual things. > How would you integrate a sentence like Frozen Hamster Butt ? It was just an observation, that neither strings nor lists seem to be valid arguments in algebraic functions. Vectors and matrices aren't either. I don't plan to use strings for the integration function, but you could easily think of cases where it might be useful. How about to select algorithm, domain or maybe filters? A simple example would be an algebraic SIZEOF() function that takes a string - this is used all the time in C. > Seriously, you could convert an expression stored as a string to an > algebraic, which would be usable then. Yes, but that was not my question :-) > For lists, you could extend the wanted algebraic functions > to perform kinda list processing, if that makes sense there. It doesn't. Standard list processing applies to INTEGRATE, but a list is a valid argument for INTEGRATE. > Or, if list processing isn't what you want, > you would have to evaluate the list contents > to a single expression. The problem isn't handling the arguments per se - all that is taken care off. INTEGRATE functions fine taking arguments from the stack. It's when constructing an algebraic problems arise. If you wan't to do this: '2*n*INTEGRATE(X^2,{X 1 2})' ...you're out of luck. The list isn't accepted in the edit line (even though it's a valid argument to INTEGRATE). You can try this out for yourself real easy. Type 'F(X)' and press ENTER. That's ok. Now try with 'F({X})'. That's a no go. But nobody's decided that the user function F doesn't accept a list as input argument? I wan't to get around this limitation in the parser. Steen ==== Subject: Re: Algebraic function taking list as input? sschmidt@nospam.dk says... >A simple example would be an algebraic SIZEOF() function that takes a >string - this is used all the time in C. Bzzzzt .... wrong! IN several ways.... 1. C is case sensitive, and the identifier you're thinking of is named sizeof, not SIZEOF 2. In C (and C++) sizeof is not a function, it is an operator taking one argument. This is legal C and C++: char a; int b = sizeof a; /* Will always yield 1 */ Since sizeof is an operator, no parentheses are required - unless the argument is a type name instead of a variable: int a = sizeof(int); /* OK */ int b = sizeof int; /* Syntax error */ 3. sizeof returns the size (in byte) of a constant, variable, or type. It does not return the length of a string. To get the length of a string, use the library function strlen(), not sizeof! A few examples: char *s1 = Hello; char s2[] = Hello; char s3[100] = Hello; int i0 = sizeof Hello; /* Yields 6 - terminating NUL also counts */ int i1 = sizeof s1; /* Usually yields 2 or 4 or 8 */ /* i.e. the number of bytes in a pointer */ int i2 = sizeof s2; /* Yields 6 */ int i3 = sizeof s3; /* Yields 100 */ int j0 = strlen(Hello); /* Yields 5 */ int j1 = strlen(s1); /* Yields 5 */ int j2 = strlen(s2); /* Yields 5 */ int j3 = strlen(s3); /* Yields 5 */ If you (for e.g. performance reasons) want to compute the length of a string literal, you can use sizeof. But in that case it's convenient to embed it in a macro, showing the purpose of it all: #define STRLEN(s) ( sizeof s - 1 ) Note that one must subtract 1 since the terminating NUL is not included in the length of the string. sizeof is 1 but strlen() is 0 Thus, you want to make an algebraic equivalence to C's strlen(), not sizeof .... -- Paul Schlyter, Grev Turegatan 40, SE-114 38 Stockholm, SWEDEN e-mail: pausch at saaf dot se WWW: http://stjarnhimlen.se/ ==== Subject: Re: HPGCC: how to animate tiles? > > >> ... >> // this loop should animate the tiles >> while (!keyb_isAnyKeyPressed()) >> { >> i=((i == 12) ? 0 : i++); >> hpg_blit(xpm, i*8, 0, 8, 8, hpg_stdscreen, 0, 0); >> } >> ... >> <... Why not just use i=(i+1)%12; ? This is often seen and looks elegant, but it's rather inefficient since it involves a fairly costly division operation. You should use that pattern only, if the divisor (n) is a power of two and use a 'bit-and' (&) with (n-1). Ex. n=8 : i = (i + 1 ) % 8 <==> i = (i + 1) & 7 best Ingo ==== Subject: Re: HPGCC: how to animate tiles? Hi Ingo, >>Why not just use i=(i+1)%12; ? > > > This is often seen and looks elegant, but it's rather inefficient since it > involves a fairly costly division operation. > > You should use that pattern only, if the divisor (n) is a power of two and > use a 'bit-and' (&) with (n-1). > > Ex. n=8 : i = (i + 1 ) % 8 <==> i = (i + 1) & 7 I checked the output before writing; GCC does a reciprocal multiplication instead of a classic division. So it's not really as slow as you'd think. i=(i+1)%12; becomes 00000270
: [...] //add one to i, do the division by multipling by 1/12 278: e59f5028 ldr r5, [pc, #40] ; 2a8 <.text+0x2a8> 27c: e24cb004 sub fp, ip, #4 ; 0x4 280: e3a04000 mov r4, #0 ; 0x0 284: e2843001 add r3, r4, #1 ; 0x1 288: e0c12395 smull r2, r1, r5, r3 28c: e1a04fc3 mov r4, r3, asr #31 290: e06400c1 rsb r0, r4, r1, asr #1 294: e0802080 add r2, r0, r0, lsl #1 298: e0434102 sub r4, r3, r2, lsl #2 [...] 2a8: 2aaaaaab bcs feaaad5c <_end+0xf5aaa85c> i++; if(i==12)i=0; is only 27c: e3a04000 mov r4, #0 ; 0x0 280: e354000b cmp r4, #11 ; 0xb 284: 12844001 addne r4, r4, #1 ; 0x1 288: 03a04000 moveq r4, #0 ; 0x0 which saves 6 instructions, but that code takes 2 lines :) Good catch though. cheers, Al ==== Subject: Re: HPGCC: how to animate tiles? >> You should use that pattern only, if the divisor (n) is a power of two >> and >> use a 'bit-and' (&) with (n-1). >> Ex. n=8 : i = (i + 1 ) % 8 <==> i = (i + 1) & 7 > By the way, GCC already does trivial optimizations like these automatically. i = (i + 1 ) % 8 Generates the exact same code as i = (i + 1) & 7 Al ==== Subject: Re: HPGCC: how to animate tiles? <42b40126$0$11306$5a62ac22@per-qv1-newsreader-01.iinet.net.au> <42b6b610_2@news.arcor-ip.de> <42b6ba42$0$31334$5a62ac22@per-qv1-newsreader-01.iinet.net.au> <42b6bb80$0$31334$5a62ac22@per-qv1-newsreader-01.iinet.net.au> Ok, for the moment, I just encode the sprites and tiles. My program just test if the sprite animations go well. I won't use this code for the game coding. I'll use optimized code like you show me ;) Fred. ==== Subject: Re: HPGCC: how to animate tiles? <1gycsop.1fnvid1bdgki3N%thomas-ml@deniau.org> My advice for animations, based in my own tests with the LCD screen of the HP49G+: * For monochrome graphics, anything above 16 frames per second looks blurry * For grayscale, more than 8 frames per second starts showing like snow due to the internal dithering algorithm. My preference is to use sys_waitRTCTicks(), which can be calibrated in 1/128th of a second using sys_setRTCTickPeriod(). The default speed of 16/128th for each tick generates 8 frames per second and it is appropriate for grayscale animation. Claudio ==== Subject: Re: People who have [HP 40G] > There's someone who have this calculator? > I need informations and some program. > Please contact me!!! > I need statistic and math program How about doing a search on the internet first. http://www.hphomeview.com/ TW ==== Subject: move graphical objects with HPGCC hi, is there a possibility to move graphic objects on the screen without being forced to draw them again. so to speak a function that accesses the graphic memory directly and does a simple operation e.g. move it some bits. ==== Subject: Re: HPGCC: how to clear a given area? <42b54497$0$31375$5a62ac22@per-qv1-newsreader-01.iinet.net.au> ok for this technique. I use an 8x8 blank tile and I cleanup only necessary tiles for testing my animations :) Fred. ==== Subject: Read PDF file on 49g+ Is it possible to put PDF files on the SD card, and read it on the 49g+? I guess my actual question is, will the 49g+ OS (or any other software, for that matter) understand PDF files and display them appropriately? ==== Subject: Re: Read PDF file on 49g+ > Is it possible to put PDF files on the SD card, and read it on the > 49g+? I guess my actual question is, will the 49g+ OS (or any other > software, for that matter) understand PDF files and display them > appropriately? Currently there exist no PDF reader for the HP49G+. It would be a nice project though, if you have the time. Steen ==== Subject: Re: SD Card & FAT32 > JYA, and furthermore does that mean that the only type of card that can >> be used to upgrade the ROM is a 16meg card since it is the only card >> the calculator will format in FAT16 by default ? (asuming ROM 2.0 is >> installed) >> You can reformat your card using the PC-reader & PC >> (where you get your 2.01 upgrade anyway) >> Naturally you back-up everything first >> (time to do a backup anyway) >> So there really should be no propblem at all >> even for the average Joe >> VPN > Well, I am an average Joe. I don't think I have that option in my > formatting > utility. I suppose ther is a way to drop to DOS and do so? Scott Chapin Windows XP > START => [button in lower left corner - click it once] > All Programs => [A selection in the lower left corner - move to right] > Accessories => [usually the first choice - move right] > Command Prompt [right below Calculator - click it once] On command prompt type: > format/? [ENTER] <- yes, press the ENTER key, not [ = ] key ;-) Is this enough help for all Joe's out there? > VPN Sorry I missed this response yesterday. I kinda assumed that, but was expecting a switch for 12/16/32 or whatever. Are you saying the format defaults to FAT16 in DOS? Scott