Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Infinite Loops and Explicit Exits
Joe Zitzelberger <joe_zitzelberger@nospam.com> wrote

> It looks like the BRN is a 'branch routine' opcode?

An unconditional BRaNch or GO TO.

> And exit point is some address inside the routine 'start' where you
> insert an branch that returns to the BRN + 1?
>
> Did you ever accidentally overlay part of the 'start' routine with a
> misplaced return branch?

> Cobol has had four major redesigns since that time...

'Redesign' ? I don't think so.

> Absolute file numbers -- like Fortrans devices 1-6 or Cs 0,1,2
> stdin/out/err remain as a convention only with plenty of ways to alter
> them to adjust to the modern computer.

Modern computers do use stdin/stdout/stderr.
 
>
> Have not other things been removed from the language?  ALTER seems to be
> on its way out...

ALTER has not been removed.
 
>
> Perform is a GOTO with a guarenteed return to the PERFORM + 1 statement
> after the execution is complete.  Just like a GOSUB in basic or a
> function/procedure invokation in one of the block languages.
>
> In all those cases, the CALLED routine decides when to invoke the return
> to PERFORM+1 -- only THRU allows the CALL to say "stop when you get
> here, even if the CALLEE isn't finished".
>
> With the exception of the THRU clause, PERFORM follows the semantics of
> a CALL.

No it doesn't.  But the problem is not with the starting point, but
with the end.  PERFORMs may be of SECTIONs or paragraphs with or
without THRU and the ranges can overlap.

For example there could be:

PERFORM A
PERFORM A THRU B

In the first case the end of A should do a 'return', in the second
case it should drop thru.  Even more pathological may be:

PERFORM A THRU C
..
A. PERFORM B
..
B. ...
C. ...

And what if the first PERFORM was PERFORM A THRU B.

CALL and RETURN just don't work for these.

That is why on the 1900 they used a mechanism, which had previously
been developed for assembler programs, of having the PERFORM set up
the return branch at the exit point and then BRaNching to the start
point.  Afterwards they would reset the exit point back to what it
was.  Initially all exit points (ie every end of paragraph and section
was a NULop.

The 1900 compilers that I used would put the NULops in automatically
and would know the address to use for that, so the EXIT paragraph was
not needed, as it was with earlier ones. With assembler though this
style would require a label in order to get the address to access to
modify the code and a specific NULop instruction as a place holder for
the branch back.

AEXIT  NULL

Becomes, in Cobol:

A-Exit. EXIT.

Report this thread to moderator Post Follow-up to this message
Old Post
Richard
11-18-04 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:03 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.