http://sc.cemetech.net/?hash=NJPxmyQun2YEDpRp75Anr+IOzUuM

I'm currently trying to write a small full-scale RSA implementation (yes, it's going to be horribly slow).
The problem lies in the BIGINT program, which is my library for big-number operations.

I've found out that despite it being seemingly impossible to happen, BI is jumped to twice.
You can test this behavior by running the program BITEST and waiting for it to pause with the text "BI" (line 35 in BIGINT).

Press Enter, and after a short while and loads of debug output it pops again. How?!
You fell for the trap where the return value from a program is in Ans. Look at how the Addition method operates.
MateoConLechuga wrote:
You fell for the trap where the return value from a program is in Ans. Look at how the Addition method operates.


Yes, it stores something in Ans.
But the jumps are at the beginning of the program, so I don't think that's the case.
You need a then/end statement around the

Code:
If C
      1:prgmBIGINT
MateoConLechuga wrote:
You need a then/end statement around the

Code:
If C
      1:prgmBIGINT

<expanding on the above post>
because a : is equivalent to a newline, so your current code looks like this to the compiler:

Code:

If C
      1
prgmBIGINT

which leads to unintended behavior.

The compiler doesn't really care about how things are visually laid out, and it executes (from what I know) token-by-token.

As Mateo said, the correct code is as follows:

Code:

If C
Then
      1:prgmBIGINT
End
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement