Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth Mac > Re: Is this is ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 67 of 157
Post > Topic >>

Re: Is this is the sort of thing Mathwallah can do?

by Gnarlodious <gnarlodiousNULL@[EMAIL PROTECTED] > Jun 15, 2004 at 03:29 PM

Entity Mark Butcher spoke thus:

> If I'm understanding you correctly, I think the answer is no. Are you
> asking if MathWallah will execute a program for an HP-49? I'm afraid
> not.
http://approtec.org/mathwallah/
I see, it is not a Forth emulator although it does use RPN and a stack.

> I have an HP-48, by the way. A major problem for me with the
> Reverse Polish Language is its readability. It's very hard to figure
> out what the program is doing. If you can convert the program to AS,
> then MathWallah could run it from one of its custom keys.
Well, I'm using X48 which looks like
http://Spectrumology.com/Time/Time.html#Hp48
I don't like algebraic expressions as they are slow and too symbolic.

I will tell you, writing Forth routines can be a real challenge because of
the interaction of what the stack is doing with the program. In worst
cases
it's helpful to lay squares of paper with actual values out on a table and
pretend it's the stack. A Forth emulator to do this task on the Mac would
be
a great tool tool.
 
> But I'm intrigued. How did you get the HP-49 program onto your mac? I
> thought HP didn't support macs any more.
They don't and I don't think they ever did. But I transferred its memory
to
a PC then to my Mac as text files.

> Also, I'm not familiar with
> Forth. When you say 'straight out of an HP-49', do you mean Reverse
> Polish Language (RPL)?
Yes, I suppose so. Actually Forth is nothing more than an extension of
your
stack-based arithmetic.
On your "Stack" keyboard you already have DUP(licate) SWAP ROLL ROLLD(own)
DROP(1 object) DROPN (Clear N Stack objects) etc.

Now imagine commands like :

PICKN duplicate N stack object to the bottom
DUPN duplicate N objects sequentially to the bottom
SIZE puts number of objects in a list on the stack
DO...UNTIL...END should be obvious
OVER duplicate line 2
ROT rotate 3 lines up (line 3 will be on bottom)
EVAL evaluate (execute as a program, even a list)
DROP2 delete bottom 2 objects
-> var assign object to this variable
«  » delimits a program object
{1,2,3...} delimits a data object


Hope that all makes sense, obviously I'm a Forthhead.

-- Gnarlie
http://www.PowerMops.com/
PowerMops: Forth Programming Language for Macintosh



> On Jun 14, 2004, at 3:30 PM, Gnarlodious wrote:
> 
>> Mark:
>>  Rather than flounder around trying to figure it out for myself, will
>> you tell me if this is the sort of thing Mathwallah can do? It is
>> Forth straight out of an HP-49.
>> 
>>  Thanks, Rachel.
>> 
>> 
>>  CHOP:
>> 
>>  Stack in:
>> 
>>  2: .66666
>>  1:  {  
>> 1,1.00148787245,1.00154083222,1.00185529972,1.00286558276,1.00502512563
>>  }
>> 
>> 
>> 
>>          << DUP SIZE SWAP OBJ-> DUP 3 + ROLL UVAL SWAP { 1 36 / 22 *
>> DUP 1 - 3 PICK > SWAP 3 PICK < - } -> g
>>            <<
>>              DO SWAP FP g EVAL + OVER 2 + ROLL * g EVAL SWAP DUP2 XOR
>> * DUP NOT 22 * ROT ABS SIGN - DUP ROT + OVER NOT 36 * ROT SIGN + * DUP
>> DUP SIGN + IP 3 PICK 3 + ROLLD
>>              UNTIL
>>  SWAP 1 - DUP NOT
>>              END
>>           >> DROP2
>>          >>
>> 
>> 
>>  Stack out:
>> 
>>  n: most significant element
>>  ~
>>  2: least significant element
>>  1: number of elements on stack
>>




 1 Posts in Topic:
Re: Is this is the sort of thing Mathwallah can do?
Gnarlodious <gnarlodio  2004-06-15 15:29:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 6:45:32 CDT 2008.