Re: How to develop a random number generation device



On Sep 9, 7:35 pm, John Larkin
<jjlar...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
On Sun, 09 Sep 2007 16:21:24 -0700, MooseFET <kensm...@xxxxxxxxx>
wrote:

On Sep 9, 1:48 pm, John Larkin
<jjlar...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
[....]
Watch dogs don't always recover the system from a glitch. If you are
storing data in battery back RAM or flash, you need to be sure that
wrong values don't cause things to hang in some non-recoverable way.

One of my programming rules is that data should never be able to crash
code.

The assignment statement is more dangerous than a GOTO.

Assignments don't crash in assembly, since assembly is untyped. The
only math error possible is a divide-by-zero trap, or a stupid
pointer. What's important is that program flow doesn't bomb just
because some cal table is trashed.

I think you missed the point. What I mean is that an assignment can
change all of the future operation of the program so it can (if you
don't code carefully) lead to hang up states and the like.


There's nothing wrong with GOTO; hell, Dijkstra didn't even have
regular access to a computer, and didn't actually program much. I
think in state machines, so GOTO is perfectly logical. In assembly, a
conditional branch, or a computed/table driven jump, are the primary
control structures.

I certainly agree. Quite a lot of my coding contains GOTOs in the
form of jump instructions. When you write on an 8051 you often do
things like this:

SqrtFastOut:
RET

Sqrt:
MOV A,Work1
ORL A,Work1+1
ORL A,Work1+2
ORL A,Work1+3
JZ SqrtFastOut

Zero is a special case that my sqrt routine would get wrong otherwise.


Nested curly brackets are just as dangerous, or moreso.

As are the declares of any soft of array.


.



Relevant Pages

  • Priority & Ranking Assignments
    ... Dim Names As Integer ... If Item= Pri1Then GoTo found ... >On a separate daily task worksheet assignments need to be ... check priority1 for all ...
    (microsoft.public.excel.programming)
  • Re: Goto - finally
    ... all assembler includes a direct JUMP... ... As for programming in C, I don't know what kind of programming other ... people have done in C but some things are by far easiest in C with goto. ... State machines are also easily handled without goto statements. ...
    (comp.lang.php)
  • Re: Programming for Electronics Engineers
    ... >>I feel that GOTO can be valid in a certain circumstances. ... >>Given the scope for appalling abuse, it might be wise to recommend very ... > I prefer very flat programs controlled by conditional GOTOs (or JMPs, ... I prefer to use CASE like statements to implement state machines. ...
    (sci.electronics.design)
  • Re: goto
    ... But who needs tail recursion when you've got loops? ... goto label; // pass the control ... In Lisp, I have experimented with parametrized goto, which then became portable ... It's the assignments that are the problem. ...
    (comp.lang.c)
  • Re: goto
    ... But who needs tail recursion when you've got loops? ... goto label; // pass the control ... In Lisp, I have experimented with parametrized goto, which then became portable ... Suppose that, further, we take on the discipline that we will avoid assignments ...
    (comp.lang.c)